diff options
author | Daniel Gryniewicz <dang@gentoo.org> | 2005-05-26 17:59:10 +0000 |
---|---|---|
committer | Daniel Gryniewicz <dang@gentoo.org> | 2005-05-26 17:59:10 +0000 |
commit | 16846d492888357acb1d691d696f9a97f64633a5 (patch) | |
tree | bc67383854c8246bb139f0ca63d55540aaa493bf /app-admin/logrotate/files | |
parent | typo in ChangeLog (diff) | |
download | gentoo-2-16846d492888357acb1d691d696f9a97f64633a5.tar.gz gentoo-2-16846d492888357acb1d691d696f9a97f64633a5.tar.bz2 gentoo-2-16846d492888357acb1d691d696f9a97f64633a5.zip |
Add no-tmpdir patch
(Portage version: 2.0.51.19)
Diffstat (limited to 'app-admin/logrotate/files')
-rw-r--r-- | app-admin/logrotate/files/digest-logrotate-3.7.1-r1 | 1 | ||||
-rw-r--r-- | app-admin/logrotate/files/logrotate-3.7.1-no-tmpdir.patch | 54 |
2 files changed, 55 insertions, 0 deletions
diff --git a/app-admin/logrotate/files/digest-logrotate-3.7.1-r1 b/app-admin/logrotate/files/digest-logrotate-3.7.1-r1 new file mode 100644 index 000000000000..8b29cfeb69d0 --- /dev/null +++ b/app-admin/logrotate/files/digest-logrotate-3.7.1-r1 @@ -0,0 +1 @@ +MD5 1fc20d457b35bbfb0c5bc2e2b47759df logrotate-3.7.1.tar.bz2 31953 diff --git a/app-admin/logrotate/files/logrotate-3.7.1-no-tmpdir.patch b/app-admin/logrotate/files/logrotate-3.7.1-no-tmpdir.patch new file mode 100644 index 000000000000..fb95f1ee3e8f --- /dev/null +++ b/app-admin/logrotate/files/logrotate-3.7.1-no-tmpdir.patch @@ -0,0 +1,54 @@ +diff -u -ruN logrotate-3.7.1-cur/logrotate.c logrotate-3.7.1/logrotate.c +--- logrotate-3.7.1-cur/logrotate.c 2005-05-25 18:20:41.000000000 -0400 ++++ logrotate-3.7.1/logrotate.c 2005-05-25 18:21:10.000000000 -0400 +@@ -90,10 +90,7 @@ + } + + static int runScript(char * logfn, char * script) { +- int fd; +- char *filespec; + int rc; +- char buf[256]; + + if (debug) { + message(MESS_DEBUG, "running script with arg %s: \"%s\"\n", +@@ -101,38 +98,12 @@ + return 0; + } + +- filespec = buf; +- snprintf(buf, sizeof(buf), "%s/logrotate.XXXXXX", getenv("TMPDIR") ?: "/tmp"); +- fd = -1; +- if (!filespec || (fd = mkstemp(filespec)) < 0 || fchmod(fd, 0700)) { +- message(MESS_DEBUG, "error creating %s: %s\n", filespec, +- strerror(errno)); +- if (fd >= 0) { +- close(fd); +- unlink(filespec); +- } +- return -1; +- } +- +- if (write(fd, "#!/bin/sh\n\n", 11) != 11 || +- write(fd, script, strlen(script)) != strlen(script)) { +- message(MESS_DEBUG, "error writing %s\n", filespec); +- close(fd); +- unlink(filespec); +- return -1; +- } +- +- close(fd); +- + if (!fork()) { +- execlp(filespec, filespec, logfn, NULL); ++ execl("/bin/sh", "sh", "-c", script, NULL); + exit(1); + } + + wait(&rc); +- +- unlink(filespec); +- + return rc; + } + |