#! /bin/sh /usr/share/dpatch/dpatch-run ## 42-execlp-bin-sh.dpatch by ## ## DP: Invoke postrotate script through /bin/sh again ## DP: This enables mounting /tmp noexec without setting TMPDIR ## DP: See #279965. @DPATCH@ diff -urNad logrotate-3.7/logrotate.c /tmp/dpep.421nlr/logrotate-3.7/logrotate.c --- logrotate-3.7/logrotate.c 2005-05-24 08:46:32.000000000 +0200 +++ /tmp/dpep.421nlr/logrotate-3.7/logrotate.c 2005-05-24 08:46:45.000000000 +0200 @@ -89,7 +89,7 @@ filespec = buf; snprintf(buf, sizeof(buf), "%s/logrotate.XXXXXX", getenv("TMPDIR") ?: "/tmp"); fd = -1; - if (!filespec || (fd = mkstemp(filespec)) < 0 || fchmod(fd, 0700)) { + if (!filespec || (fd = mkstemp(filespec)) < 0 || fchmod(fd, 0600)) { message(MESS_DEBUG, "error creating %s: %s\n", filespec, strerror(errno)); if (fd >= 0) { @@ -110,7 +110,7 @@ close(fd); if (!fork()) { - execlp(filespec, filespec, logfn, NULL); + execlp("/bin/sh", filespec, filespec, logfn, NULL); exit(1); }