CHANGES IN CUPS V1.1.21rc1
+ - When using RunAsUser, the scheduler did not correctly
+ set the ownership of the log files, preventing log
+ file rotation (STR #686)
- The image filters did not correctly load 1-bit PNG
files (STR #687)
- The pdftops filter did not show all annotation objects
/*
- * "$Id: cert.c,v 1.7.2.10 2003/03/30 20:01:41 mike Exp $"
+ * "$Id: cert.c,v 1.7.2.11 2004/04/20 13:40:30 mike Exp $"
*
* Authentication certificate routines for the Common UNIX
* Printing System (CUPS).
fchmod(fd, 0440);
if ((grp = getgrnam(SystemGroups[0])) == NULL)
- fchown(fd, getuid(), 0);
+ fchown(fd, RunUser, 0);
else
- fchown(fd, getuid(), grp->gr_gid);
+ fchown(fd, RunUser, grp->gr_gid);
endgrent();
/*
- * End of "$Id: cert.c,v 1.7.2.10 2003/03/30 20:01:41 mike Exp $".
+ * End of "$Id: cert.c,v 1.7.2.11 2004/04/20 13:40:30 mike Exp $".
*/
/*
- * "$Id: classes.c,v 1.34.2.19 2004/02/26 20:12:13 mike Exp $"
+ * "$Id: classes.c,v 1.34.2.20 2004/04/20 13:40:30 mike Exp $"
*
* Printer class routines for the Common UNIX Printing System (CUPS).
*
* Restrict access to the file...
*/
- fchown(cupsFileNumber(fp), getuid(), Group);
+ fchown(cupsFileNumber(fp), RunUser, Group);
fchmod(cupsFileNumber(fp), ConfigFilePerm);
/*
/*
- * End of "$Id: classes.c,v 1.34.2.19 2004/02/26 20:12:13 mike Exp $".
+ * End of "$Id: classes.c,v 1.34.2.20 2004/04/20 13:40:30 mike Exp $".
*/
/*
- * "$Id: client.c,v 1.91.2.80 2004/03/24 21:28:56 mike Exp $"
+ * "$Id: client.c,v 1.91.2.81 2004/04/20 13:40:30 mike Exp $"
*
* Client routines for the Common UNIX Printing System (CUPS) scheduler.
*
SetStringf(&con->filename, "%s/%08x", RequestRoot, request_id ++);
con->file = open(con->filename, O_WRONLY | O_CREAT | O_TRUNC, 0640);
fchmod(con->file, 0640);
- fchown(con->file, getuid(), Group);
+ fchown(con->file, RunUser, Group);
LogMessage(L_DEBUG2, "ReadClient: %d REQUEST %s=%d", con->http.fd,
con->filename, con->file);
SetStringf(&con->filename, "%s/%08x", RequestRoot, request_id ++);
con->file = open(con->filename, O_WRONLY | O_CREAT | O_TRUNC, 0640);
fchmod(con->file, 0640);
- fchown(con->file, getuid(), Group);
+ fchown(con->file, RunUser, Group);
LogMessage(L_DEBUG2, "ReadClient: %d REQUEST %s=%d", con->http.fd,
con->filename, con->file);
* Child comes here... Close stdin if necessary and dup the pipe to stdout.
*/
- if (getuid() == 0)
+ if (!RunUser)
{
/*
* Running as root, so change to a non-priviledged user...
/*
- * End of "$Id: client.c,v 1.91.2.80 2004/03/24 21:28:56 mike Exp $".
+ * End of "$Id: client.c,v 1.91.2.81 2004/04/20 13:40:30 mike Exp $".
*/
/*
- * "$Id: conf.c,v 1.77.2.49 2004/02/25 20:01:37 mike Exp $"
+ * "$Id: conf.c,v 1.77.2.50 2004/04/20 13:40:30 mike Exp $"
*
* Configuration routines for the Common UNIX Printing System (CUPS).
*
char *language; /* Language string */
struct passwd *user; /* Default user */
struct group *group; /* Default group */
- int run_user; /* User that will be running cupsd */
char *old_serverroot, /* Old ServerRoot */
*old_requestroot; /* Old RequestRoot */
return (0);
if (RunAsUser)
- run_user = User;
+ RunUser = User;
else
- run_user = getuid();
+ RunUser = getuid();
/*
* Use the default system group if none was supplied in cupsd.conf...
SetStringf(&ServerCertificate, "%s/%s", ServerRoot, ServerCertificate);
# if defined(HAVE_LIBSSL) || defined(HAVE_GNUTLS)
- chown(ServerCertificate, run_user, Group);
+ chown(ServerCertificate, RunUser, Group);
chmod(ServerCertificate, ConfigFilePerm);
if (ServerKey[0] != '/')
SetStringf(&ServerKey, "%s/%s", ServerRoot, ServerKey);
- chown(ServerKey, run_user, Group);
+ chown(ServerKey, RunUser, Group);
chmod(ServerKey, ConfigFilePerm);
# endif /* HAVE_LIBSSL || HAVE_GNUTLS */
#endif /* HAVE_SSL */
* writable by the user and group in the cupsd.conf file...
*/
- chown(ServerRoot, run_user, Group);
+ chown(ServerRoot, RunUser, Group);
chmod(ServerRoot, 0775);
snprintf(temp, sizeof(temp), "%s/certs", ServerRoot);
- chown(temp, run_user, Group);
+ chown(temp, RunUser, Group);
chmod(temp, 0711);
snprintf(temp, sizeof(temp), "%s/ppd", ServerRoot);
- chown(temp, run_user, Group);
+ chown(temp, RunUser, Group);
chmod(temp, 0755);
snprintf(temp, sizeof(temp), "%s/ssl", ServerRoot);
- chown(temp, run_user, Group);
+ chown(temp, RunUser, Group);
chmod(temp, 0700);
snprintf(temp, sizeof(temp), "%s/cupsd.conf", ServerRoot);
- chown(temp, run_user, Group);
+ chown(temp, RunUser, Group);
chmod(temp, ConfigFilePerm);
snprintf(temp, sizeof(temp), "%s/classes.conf", ServerRoot);
- chown(temp, run_user, Group);
+ chown(temp, RunUser, Group);
#ifdef __APPLE__
chmod(temp, 0600);
#else
#endif /* __APPLE__ */
snprintf(temp, sizeof(temp), "%s/printers.conf", ServerRoot);
- chown(temp, run_user, Group);
+ chown(temp, RunUser, Group);
#ifdef __APPLE__
chmod(temp, 0600);
#else
* permissions...
*/
- chown(RequestRoot, run_user, Group);
+ chown(RequestRoot, RunUser, Group);
chmod(RequestRoot, 0710);
if (strncmp(TempDir, RequestRoot, strlen(RequestRoot)) == 0)
* is under the spool directory...
*/
- chown(TempDir, run_user, Group);
+ chown(TempDir, RunUser, Group);
chmod(TempDir, 01770);
}
/*
- * End of "$Id: conf.c,v 1.77.2.49 2004/02/25 20:01:37 mike Exp $".
+ * End of "$Id: conf.c,v 1.77.2.50 2004/04/20 13:40:30 mike Exp $".
*/
/*
- * "$Id: conf.h,v 1.36.2.21 2003/10/09 19:13:52 mike Exp $"
+ * "$Id: conf.h,v 1.36.2.22 2004/04/20 13:40:30 mike Exp $"
*
* Configuration file definitions for the Common UNIX Printing System (CUPS)
* scheduler.
/* Root certificate update interval */
RunAsUser VALUE(FALSE),
/* Run as unpriviledged user? */
+ RunUser, /* User to run as, used for files */
PrintcapFormat VALUE(PRINTCAP_BSD);
/* Format of printcap file? */
VAR cups_file_t *AccessFile VALUE(NULL),
/*
- * End of "$Id: conf.h,v 1.36.2.21 2003/10/09 19:13:52 mike Exp $".
+ * End of "$Id: conf.h,v 1.36.2.22 2004/04/20 13:40:30 mike Exp $".
*/
/*
- * "$Id: ipp.c,v 1.127.2.80 2004/03/24 21:32:24 mike Exp $"
+ * "$Id: ipp.c,v 1.127.2.81 2004/04/20 13:40:30 mike Exp $"
*
* IPP routines for the Common UNIX Printing System (CUPS) scheduler.
*
}
fchmod(cupsFileNumber(out), 0640);
- fchown(cupsFileNumber(out), getuid(), Group);
+ fchown(cupsFileNumber(out), RunUser, Group);
if (con->language)
{
/*
- * End of "$Id: ipp.c,v 1.127.2.80 2004/03/24 21:32:24 mike Exp $".
+ * End of "$Id: ipp.c,v 1.127.2.81 2004/04/20 13:40:30 mike Exp $".
*/
/*
- * "$Id: job.c,v 1.124.2.84 2004/02/25 20:01:37 mike Exp $"
+ * "$Id: job.c,v 1.124.2.85 2004/04/20 13:40:30 mike Exp $"
*
* Job management routines for the Common UNIX Printing System (CUPS).
*
}
fchmod(fd, 0600);
- fchown(fd, getuid(), Group);
+ fchown(fd, RunUser, Group);
ippWriteFile(fd, job->attrs);
* Change user to something "safe"...
*/
- if (!root && getuid() == 0)
+ if (!root && !RunUser)
{
/*
* Running as root, so change to non-priviledged user...
/*
- * End of "$Id: job.c,v 1.124.2.84 2004/02/25 20:01:37 mike Exp $".
+ * End of "$Id: job.c,v 1.124.2.85 2004/04/20 13:40:30 mike Exp $".
*/
/*
- * "$Id: log.c,v 1.19.2.18 2003/10/09 19:13:52 mike Exp $"
+ * "$Id: log.c,v 1.19.2.19 2004/04/20 13:40:30 mike Exp $"
*
* Log file routines for the Common UNIX Printing System (CUPS).
*
if (strncmp(filename, "/dev/", 5))
{
- fchown(cupsFileNumber(*log), getuid(), Group);
+ fchown(cupsFileNumber(*log), RunUser, Group);
fchmod(cupsFileNumber(*log), LogFilePerm);
}
}
if (strncmp(filename, "/dev/", 5))
{
- fchown(cupsFileNumber(*log), getuid(), Group);
+ fchown(cupsFileNumber(*log), RunUser, Group);
fchmod(cupsFileNumber(*log), LogFilePerm);
}
}
/*
- * End of "$Id: log.c,v 1.19.2.18 2003/10/09 19:13:52 mike Exp $".
+ * End of "$Id: log.c,v 1.19.2.19 2004/04/20 13:40:30 mike Exp $".
*/