apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.93k stars 464 forks source link

Too many files are owned by CUPS_USER #283

Closed michaelrsweet closed 21 years ago

michaelrsweet commented 21 years ago

Version: 1.1.20rc1 CUPS.org User: jlovell

It seems that too many files end up being owned by the CUPS_USER. There are two classes of these:

*.conf: Although they are initially set up correctly in conf.c as "run_user" they change ownership to "User" when they are rewritten. Having them owned by "User" allows, in theory, any of the filters to change these (i.e. hijack them by changing the device URIs) or to snoop passwords from printers.conf.

spool files: Have these writable by "User" would allow any of the filters to change them. If they are owned by root (run_user) then only cupsd can change them.

The attached patch fixes these (a review of the other chown's may be in order as well). Note that in printers.c I also threw a few sprinklings of "static const".

Comments?

Thanks.

michaelrsweet commented 21 years ago

CUPS.org User: mike

Thanks, applied to CVS for 1.1.20.

michaelrsweet commented 21 years ago

"cups-perms.patch":

? cups-perms.patch

Index: classes.c

RCS file: /home/anoncvs/cups/scheduler/classes.c,v retrieving revision 1.52 diff -u -d -b -w -r1.52 classes.c --- classes.c 26 Apr 2003 17:09:55 -0000 1.52 +++ classes.c 12 Sep 2003 21:32:37 -0000 @@ -610,7 +610,7 @@

Index: log.c

RCS file: /home/anoncvs/cups/scheduler/log.c,v retrieving revision 1.36 diff -u -d -b -w -r1.36 log.c --- log.c 22 Aug 2003 22:01:24 -0000 1.36 +++ log.c 12 Sep 2003 21:32:42 -0000 @@ -525,7 +525,7 @@

 if (strncmp(filename, "/dev/", 5))
 {