1 diff -up cups-2.1b1/scheduler/log.c.logrotate cups-2.1b1/scheduler/log.c
2 --- cups-2.1b1/scheduler/log.c.logrotate 2015-06-04 20:00:31.000000000 +0200
3 +++ cups-2.1b1/scheduler/log.c 2015-06-29 13:25:09.623350218 +0200
5 # include <systemd/sd-journal.h>
6 #endif /* HAVE_ASL_H */
8 +#include <sys/types.h>
14 @@ -135,12 +138,10 @@ cupsdCheckLogFile(cups_file_t **lf, /* I
18 - * Format the filename as needed...
19 + * Format the filename...
23 - (strncmp(logname, "/dev/", 5) && cupsFileTell(*lf) > MaxLogSize &&
25 + if (strncmp(logname, "/dev/", 5))
28 * Handle format strings...
29 @@ -254,6 +255,34 @@ cupsdCheckLogFile(cups_file_t **lf, /* I
31 * Change ownership and permissions of non-device logs...
34 + fchown(cupsFileNumber(*lf), RunUser, Group);
35 + fchmod(cupsFileNumber(*lf), LogFilePerm);
40 + * Has someone else (i.e. logrotate) already rotated the log for us?
42 + else if (strncmp(filename, "/dev/", 5))
45 + if (stat(filename, &st) || st.st_size == 0)
47 + /* File is either missing or has zero size. */
50 + if ((*lf = cupsFileOpen(filename, "a")) == NULL)
52 + syslog(LOG_ERR, "Unable to open log file \"%s\" - %s", filename,
59 + * Change ownership and permissions of non-device logs...
62 fchown(cupsFileNumber(*lf), RunUser, Group);
63 fchmod(cupsFileNumber(*lf), LogFilePerm);