1
Do not use tmpfile to run script anymore (Closes: #149270)
4
Index: logrotate-3.7.1/logrotate.c
5
===================================================================
6
--- logrotate-3.7.1.orig/logrotate.c 2006-04-08 20:38:58.314755223 +0100
7
+++ logrotate-3.7.1/logrotate.c 2006-04-08 20:42:11.628324134 +0100
11
static int runScript(char * logfn, char * script) {
18
message(MESS_DEBUG, "running script with arg %s: \"%s\"\n",
24
- snprintf(buf, sizeof(buf), "%s/logrotate.XXXXXX", getenv("TMPDIR") ?: "/tmp");
26
- if (!filespec || (fd = mkstemp(filespec)) < 0 || fchmod(fd, 0700)) {
27
- message(MESS_DEBUG, "error creating %s: %s\n", filespec,
36
- if (write(fd, "#!/bin/sh\n\n", 11) != 11 ||
37
- write(fd, script, strlen(script)) != strlen(script)) {
38
- message(MESS_DEBUG, "error writing %s\n", filespec);
47
- execlp(filespec, filespec, logfn, NULL);
48
+ execl("/bin/sh", "sh", "-c", script, NULL);