Index: scheduler/conf.c =================================================================== --- scheduler/conf.c (revision 314) +++ scheduler/conf.c (working copy) @@ -658,7 +658,8 @@ * writable by the user and group in the cupsd.conf file... */ - if (check_permissions(CacheDir, NULL, 0775, RunUser, Group, 1, 1) < 0 || + if (check_permissions(RequestRoot, NULL, 0710, RunUser, Group, 1, 1) < 0 || + check_permissions(CacheDir, NULL, 0775, RunUser, Group, 1, 1) < 0 || check_permissions(StateDir, NULL, 0755, RunUser, Group, 1, 1) < 0 || check_permissions(StateDir, "certs", RunUser ? 0711 : 0511, User, SystemGroupIDs[0], 1, 1) < 0 || @@ -710,13 +711,9 @@ } /* - * Make sure the request and temporary directories have the right - * permissions... + * Make sure the temporary directory has the right permissions... */ - if (check_permissions(RequestRoot, NULL, 0710, RunUser, Group, 1, 1) < 0) - return (0); - if (!strncmp(TempDir, RequestRoot, strlen(RequestRoot)) || access(TempDir, 0)) { Index: scheduler/log.c =================================================================== --- scheduler/log.c (revision 314) +++ scheduler/log.c (working copy) @@ -38,6 +38,7 @@ #include "cupsd.h" #include #include +#include /* @@ -469,6 +470,7 @@ filename[1024], /* Formatted log filename */ *ptr; /* Pointer into filename */ const char *logptr; /* Pointer into log filename */ + struct stat statbuf; /* Directory information */ /* @@ -546,10 +548,32 @@ if ((*lf = cupsFileOpen(filename, "a")) == NULL) { - syslog(LOG_ERR, "Unable to open log file \"%s\" - %s", filename, - strerror(errno)); + /* + * If the file is in CUPS_LOGDIR then try to create a missing directory... + */ - return (0); + if (!strncmp(filename, CUPS_LOGDIR, strlen(CUPS_LOGDIR)) && + stat(CUPS_LOGDIR, &statbuf) == -1 && + errno == ENOENT) + { + syslog(LOG_WARNING, "Creating missing directory \"%s\"", CUPS_LOGDIR); + + if (mkdir(CUPS_LOGDIR, 0755)) + { + syslog(LOG_ERR, "Unable to create directory \"%s\" - %s", CUPS_LOGDIR, + strerror(errno)); + return (-1); + } + + *lf = cupsFileOpen(filename, "a"); + } + + if (*lf == NULL) + { + syslog(LOG_ERR, "Unable to open log file \"%s\" - %s", filename, + strerror(errno)); + return (0); + } } if (strncmp(filename, "/dev/", 5))