/etc/cups/ppd contains root-owned files

Bug #12879 reported by Timothy Morris
10
Affects Status Importance Assigned to Milestone
cupsys (Ubuntu)
Fix Released
Medium
Martin Pitt

Bug Description

The recommended Gnome admin to add a printer does not accept my parallel port
attached HP LaserJet 3P /PCL.

After "Apply" returns the opening screen with Add Printer. Tried CUPs admin,
but it is, as you know, disabled.

lpstat gives no indication of a printer.

Thanks.

(I'm trying this Debian based system to replace Fedora Core 3. apt-get is a
great tool. Gnome takes some geting used to (been with KDE for 5 years.)

Revision history for this message
Michael Knight (miknight) wrote :

I experience the same problem with my Epson Stylus C-65 (using the C-64 driver
which worked in Warty), however mine is connected via USB. "gnome-cups-add"
detects the printer correctly, after clicking "Apply" it seems to exit cleanly,
yet no printer was actually added. This is using the latest updates to Hoary
(Feb 15).

Revision history for this message
Sebastien Bacher (seb128) wrote :

are you using warty or hoary ? do you have any error in ~/.xsession-errors ? do
you have the printer after restarting gnome-cups-manager ?

Revision history for this message
Michael Knight (miknight) wrote :

(In reply to comment #2)

Sorry for the delayed reply (could have sworn I put myself on the CC list).

I do get an error in ~/.xsession-errors. Here's what happens when trying to
install the detected printer:

Selected ppd file = epson24.ppd
Selected ppd file = gimp-print/4.2/escp2-c60.ppd.gz
Selected ppd file = gimp-print/4.2/escp2-c64.ppd.gz

** (gnome-cups-add:7599): WARNING **: failed request with status 1280

And I do not have a printer after restarting gnome-cups-manager. I'm using Hoary
and just dist-upgraded today and tried again, unfortunately with the same result.

Revision history for this message
Sebastien Bacher (seb128) wrote :

no problem, I've opened a bug upstream, based on your comments, about this:
http://bugzilla.gnome.org/show_bug.cgi?id=170053

Revision history for this message
Sebastien Bacher (seb128) wrote :

upstream comment:

"Can you check your cups logs to see where it's getting irrate ?

status = 1280 is IPP_INTERNAL_ERROR = 0x0500,"

Can you look on the /var/log/cups/ logs ?

Revision history for this message
Michael Knight (miknight) wrote :

(In reply to comment #5)

Here's the relevant tail of the /var/log/cups/error_log file after adding a printer:

I [17/Mar/2005:12:21:09 +1100] Full reload complete.
I [17/Mar/2005:12:32:35 +1100] Setting Stylus-C64 device-uri to
"usb://EPSON/Stylus%20C65" (was "file:/dev/null".)
I [17/Mar/2005:12:32:35 +1100] Setting Stylus-C64 printer-is-accepting-jobs to 1
(was 0.)
I [17/Mar/2005:12:32:35 +1100] Setting Stylus-C64 printer-state to 3 (was 5.)
E [17/Mar/2005:12:32:35 +1100] add_printer: Unable to copy PPD file from
/usr/share/cups/model/gimp-print/4.2/escp2-c64.ppd.gz to
/etc/cups/ppd/Stylus-C64.ppd - Permission denied

Again, this is using the latest Hoary from today (17 Mar). I was under the
impression that printing administration no longer needed root privileges in
Ubuntu (i.e. through gksudo or whatever it used to use). I'm not prompted for a
password during the process.

Revision history for this message
Matt Zimmerman (mdz) wrote :

That sounds suspiciously like bug #13170, which was fixed in cupsys
1.1.23-1ubuntu9. Check your cupsys version.

Revision history for this message
Michael Knight (miknight) wrote :

"dpkg-query -s cupsys | grep Version" gives "Version: 1.1.23-1ubuntu10".

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #6)
.)
> E [17/Mar/2005:12:32:35 +1100] add_printer: Unable to copy PPD file from
> /usr/share/cups/model/gimp-print/4.2/escp2-c64.ppd.gz to
> /etc/cups/ppd/Stylus-C64.ppd - Permission denied
>
> Again, this is using the latest Hoary from today (17 Mar). I was under the
> impression that printing administration no longer needed root privileges in
> Ubuntu (i.e. through gksudo or whatever it used to use). I'm not prompted for a
> password during the process.

Indeed, this should be the case and this works well for me. This is certainly
not a fresh installation, is it? Is this a Warty upgrade?

Can you please show me the result of

 ls -l /etc/cups

?

Revision history for this message
Michael Knight (miknight) wrote :

(In reply to comment #9)
> This is certainly not a fresh installation, is it? Is this a Warty upgrade?

No, not a fresh installation. Yeap, a Warty upgrade.

> Can you please show me the result of
>
> ls -l /etc/cups
>
> ?

Most certainly:

$ ls -l /etc/cups/
total 1590
lrwxrwxrwx 1 root lpadmin 19 2005-03-24 01:22 certs -> /var/lib/cups/certs
-rw-r----- 1 cupsys lpadmin 2416 2005-01-21 05:07 classes.conf
-rw-r--r-- 1 root root 2328 2005-01-21 05:07 client.conf
-rw-r--r-- 1 root root 1215 2004-10-09 23:09 command.types
-rw-r--r-- 1 root root 141 2005-03-01 05:44 cupsd-browsing.conf
-rw-r----- 1 cupsys lpadmin 22931 2005-03-01 05:43 cupsd.conf
drwxr-xr-x 2 root root 48 2004-09-15 15:22 interfaces
-rw-r--r-- 1 root root 4582 2005-01-21 05:07 mime.convs
-rw-r--r-- 1 root root 5920 2005-01-21 05:07 mime.types
lrwxrwxrwx 1 root root 14 2005-03-24 01:15 pdftops.conf -> ../xpdf/xpdfrc
drwxrwsr-x 2 cupsys lpadmin 120 2005-03-24 01:27 ppd
-rw-r--r-- 1 root root 1540288 2005-03-24 01:23 ppds.dat
-rw-r----- 1 cupsys lpadmin 2737 2005-01-21 05:07 printers.conf
-rw-r----- 1 cupsys lpadmin 453 2005-01-11 17:13 printers.conf.dpkg-old
-rw-r----- 1 cupsys lpadmin 434 2004-12-30 16:24 printers.conf.O
-rw-r--r-- 1 root root 947 2004-08-13 15:04 pstoraster.convs
-rw-r--r-- 1 root root 242 2004-09-19 00:28 raw.convs
-rw-r--r-- 1 root root 213 2004-09-19 00:28 raw.types

Revision history for this message
Martin Pitt (pitti) wrote :

Hm, "/etc/cups/ppd/Stylus-C64.ppd - Permission denied" is really puzzling, the
directory permissions

  drwxrwsr-x 2 cupsys lpadmin 120 2005-03-24 01:27 ppd

really look okay. Can you please do

  ls -l /etc/cups/ppd

copy the output here, then do

  sudo -u cupsys touch /etc/cups/ppd/Stylus-C64.ppd

(check if this works without error)
and then

  ls -l /etc/cups/ppd

again?

Revision history for this message
Michael Knight (miknight) wrote :

(In reply to comment #11)
> really look okay. Can you please do
>
> ls -l /etc/cups/ppd

$ ls -l /etc/cups/ppd
total 52
-rw-r--r-- 1 cupsys lpadmin 11916 2004-10-05 08:57 PostScript-Printer.ppd
-rw-r--r-- 1 root root 40355 2005-04-08 12:21 Stylus-C64.ppd

> copy the output here, then do
>
> sudo -u cupsys touch /etc/cups/ppd/Stylus-C64.ppd
>
> (check if this works without error)

$ sudo -u cupsys touch /etc/cups/ppd/Stylus-C64.ppd
touch: cannot touch `/etc/cups/ppd/Stylus-C64.ppd': Permission denied

> and then
>
> ls -l /etc/cups/ppd
>
> again?

(No change from the first listing.)

After chowning the Stylus-C64.ppd file to cupsys:lpadmin, adding the printer now works! Sorry if this has been a bit of a
goose chase. I assume that eariler attempts to add the printer with a buggy cups were the cause.

$ sudo chown cupsys:lpadmin /etc/cups/ppd/Stylus-C64.ppd
$ ls -l /etc/cups/ppd
total 52
-rw-r--r-- 1 cupsys lpadmin 11916 2004-10-05 08:57 PostScript-Printer.ppd
-rw-r--r-- 1 cupsys lpadmin 40371 2005-04-08 12:46 Stylus-C64.ppd

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #12)
> (In reply to comment #11)
> > really look okay. Can you please do
> >
> > ls -l /etc/cups/ppd
>
> $ ls -l /etc/cups/ppd
> total 52
> -rw-r--r-- 1 cupsys lpadmin 11916 2004-10-05 08:57 PostScript-Printer.ppd
> -rw-r--r-- 1 root root 40355 2005-04-08 12:21 Stylus-C64.ppd

Ah, I expected this, but I wanted to have it confirmed.

That's indeed odd, cups does not run as root any more since pre-Warty times. Did
you happen to upgrade this system from an early Warty Sounder CD?

Unless you manually copied this file as root, this can really only be an
upgrading problem. I'm unsure whether to just ignore this problem ("you used an
unsupported test version, kthxbye") or chown all files in /etc/cups/ppd to
cupsys:lpadmin during installation/upgrade of the cupsys package. The latter
would actually conflict with the Debian/Ubuntu policy since technically this
means to change a conffile.

Revision history for this message
Daniel Robitaille (robitaille) wrote :

I wonder how many people are like this, and thus if it should be ignored or not.
 After reading this bug report I discovered that indeed my Hoary machine was in
a similar state; also an upgrade from a pre-release Warty from last September:

$ ls -l /etc/cups/ppd
total 40
-rw-r--r-- 1 root root 39560 2005-03-31 17:10 LEXMARK-Z53.ppd

maybe the least disruptive way would be, instead of playing chown games during
package upgrades, to add an entry in the Ubuntu wiki and the docs in the
sections related to upgrades between versions of Ubuntu? At least that way it
would be documented that this could be a gotcha in some installations.

Revision history for this message
Martin Pitt (pitti) wrote :

I guess I'll just fix this once and for all by chowning the files when upgrading
from a version earlier than the one that corrects the permissions.

Revision history for this message
Martin Pitt (pitti) wrote :

 cupsys (1.1.99.b1.r4929-0ubuntu2) dapper; urgency=low
 .
   * Add 50_truncate_ppd.dpatch:
     - cups/file.c: Do not forget to write the pending uncompressed tail when
       copying a compressed file. Fixes cropped PPD files in /etc/cups/ppd.
     - Patch taken from upstream svn commit 4942.
     - Malone #28642
   * debian/cupsys.init.d: Create access_log with proper permissions if it does
     not yet exist. (Malone #28492)
   * debian/cupsys.preinst: If we upgrade from a version earlier than this one,
     change all root-owned PPD files in /etc/cups/ppd to be owned by cupsys.
     (Malone #12879)

Changed in cupsys:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.