root privileges needed to set default printer

Bug #41304 reported by mannheim
18
Affects Status Importance Assigned to Milestone
cupsys (Ubuntu)
New
Medium
Unassigned
gnome-cups-manager (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

I have two printers configured and working, with dapper. Then:

1. I launch gnome-cups-manager as an ordinary user (a member of the lpadmin group).

2. Right-click on the icon for one printer and select "Make default".

Actual results: nothing appears to happen.

Expected results: a "check" emblem appears, and the selected printer becomes the default.

Additional information: If I call gnome-cups-manager as root, using sudo, then I can change the default printer as expected, no problem.

The permissions on the file /etc/cups/printers.conf are

-rw------- owner=cupsys, group=lp

My version of cupsys is cupsys_1.1.99.rc2-0ubuntu2, but the problem did not start with this version.

Revision history for this message
Michael Crider (mecrider) wrote :

I just filed this same bug (41303), but I hadn't checked it as root.

Revision history for this message
mannheim (kronheim) wrote :

Further information: as a normal user, I can execute "/usr/sbin/lpadmin -d MyPrinter" in a terminal to set the default printer without problem (and the new default printer is indicated in the gnome-cups-manager window).

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

I just tested this. Indeed the 'check mark' emblem does not appear, but it works nevertheless. 'lpq' shows the status of the default printer, and it's properly changed for me if I use gnome-cups-manager. Can you confirm this?

Revision history for this message
mannheim (kronheim) wrote :

Yes, I can confirm that. I did:

1. Open gnome-cups-manger, select PrinterA as default; emblem does not change.

2. lpq now shows status of "PrinterA"; and lpr sends output to "PrinterA".

Is the following diagnosis correct:

(a) There is system-wide default printer, which is indicated in /etc/cups/printers.conf; but there is also a per-user default printer, which is indicated in ~/.cups/lpoptions.

(b) The command lpadmin sets the system-wide default.

(c) The gnome-cups-manager interface sets the per-user default when run as a normal user.

(d) In the gnome-cups-manager interface, the "check" emblem appears on the system-wide default printer, which is a bug. The "check" emblem should appear on the user's default printer.

This is all consistent with what I have seen and what you pointed out above: selecting "Make default" in gnome-cups-manager does indeed set my per-user default printer; but the "check" mark remains on the sytem-wide default printer.

Revision history for this message
mannheim (kronheim) wrote :

In light of the above, the summary of this bug is incorrect. Also, it probably should be changed:

   "Affects cupsys --> Affects gnome-cups-manager"

Revision history for this message
Michael Crider (mecrider) wrote :

mannheim, I agree with your diagnosis. It makes sense for gnome-cups-manager to set the per-user default printer, and I think this problem arose when g-c-m started running as user (I think I had to give my password to run it in Dapper Alpha - maybe somebody else can confirm that?). Initially I disagreed with Martin's test (before actually performing it), because when I had the cups LogLevel at debug to work on another bug, it filled the error_log with messages about No Default Printer (after I deleted all my printers and reinstalled them to check the affects on default printer). I guess an advanced user (i.e. system administrator, or one that knows enough to change the LogLevel on cups) should realize that g-c-m has to be run as root to make system-wide changes.

Revision history for this message
Michael Crider (mecrider) wrote :

Another interesting aspect of this bug is that once the per-user default printer is set to anything other than the system default, it is impossible to change it back to the system default in g-c-m. "Make Default" is grayed out for the system default printer.

Changed in cupsys:
status: Unconfirmed → Confirmed
Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

reverting to cupsys

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

For informations, here is an extract from cups error log with Loglevel=debug2.
This extract is when i assign a specific printer to be the default printer.

D [27/Apr/2006:21:48:00 +0200] CUPS-Get-Default
d [27/Apr/2006:21:48:00 +0200] get_default(0x80ec7c8[8])
d [27/Apr/2006:21:48:00 +0200] cupsdFindPolicyOp(p=0x80b9f18, op=4001(CUPS-Get-Default))
d [27/Apr/2006:21:48:00 +0200] cupsdFindPolicyOp: Found wildcard match...
d [27/Apr/2006:21:48:00 +0200] cupsdIsAuthorized: con->uri="/", con->best=0x80bb0d8((null))
d [27/Apr/2006:21:48:00 +0200] cupsdIsAuthorized: level=AUTH_ANON, type=AUTH_NONE, satisfy=AUTH_SATISFY_ALL, num_names=0
d [27/Apr/2006:21:48:00 +0200] cupsdIsAuthorized: op=0(unknown-0000)
d [27/Apr/2006:21:48:00 +0200] cupsdIsAuthorized: auth=AUTH_ALLOW...
I [27/Apr/2006:21:48:00 +0200] CUPS-Get-Default client-error-not-found: No default printer
D [27/Apr/2006:21:48:00 +0200] cupsdProcessIPPRequest: 8 status_code=406 (client-error-not-found)
d [27/Apr/2006:21:48:00 +0200] cupsdProcessIPPRequest: Adding fd 8 to OutputSet...
d [27/Apr/2006:21:48:00 +0200] cupsdWriteClient: 8 bytes < 0
d [27/Apr/2006:21:48:00 +0200] cupsdWriteClient: Removing fd 8 from OutputSet...
d [27/Apr/2006:21:48:00 +0200] cupsdAcceptClient(lis=0x80bd478) 2 Clients = 3
D [27/Apr/2006:21:48:00 +0200] cupsdAcceptClient: 10 from localhost (Domain)
d [27/Apr/2006:21:48:00 +0200] cupsdAcceptClient: 10 connected to server on localhost:631
d [27/Apr/2006:21:48:00 +0200] cupsdAcceptClient: Adding fd 10 to InputSet...
d [27/Apr/2006:21:48:00 +0200] cupsdReadClient: 8, used=0, file=-1 state=0
d [27/Apr/2006:21:48:00 +0200] cupsdReadClient: httpGets returned EOF...
D [27/Apr/2006:21:48:00 +0200] cupsdCloseClient: 8
d [27/Apr/2006:21:48:00 +0200] cupsdCloseClient: Removing fd 8 from InputSet and OutputSet...
d [27/Apr/2006:21:48:00 +0200] cupsdReadClient: 10, used=0, file=-1 state=0
D [27/Apr/2006:21:48:00 +0200] cupsdReadClient: 10 POST / HTTP/1.1
d [27/Apr/2006:21:48:00 +0200] cupsdFindBest: uri = "/"...
d [27/Apr/2006:21:48:00 +0200] cupsdFindBest: Location CUPS_INTERNAL_BROWSE_ACL Limit 0
d [27/Apr/2006:21:48:00 +0200] cupsdFindBest: Location /admin/conf Limit 7f
d [27/Apr/2006:21:48:00 +0200] cupsdFindBest: Location /admin Limit 7f
d [27/Apr/2006:21:48:00 +0200] cupsdFindBest: Location / Limit 7f
d [27/Apr/2006:21:48:00 +0200] cupsdFindBest: best = /

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote : CUPS-Get-Default.txt

CUPS-Get-Default.txt
cups error log when trying to assign the default printer

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

Changing assignement, because client like xpp work well so it's not a bug in cupsys. I must investigate g-c-m now

Revision history for this message
mannheim (kronheim) wrote :

There is a similar (related?) issue with setting printer preference via the "Properties" dialog box in gnome-cups-manager.

When opening the "Properties" dialog box, the preferences which are shown reflect choices recorded in /etc/cups/printers.conf (or so it seems). That is, the system-wide prefs are shown. But when a normal user uses the dialog to change preferences, the per-user preferences are changed, and recorded in ~/.cups/lpoptions.

The result is that user preferences appear not to stick. To reproduce this:

1. Launch gnome-cups-manager as a user.

2. Select a printer, and select "Properties".

3. Change a property and close the dialog.

4. Open the Properties dialog and observe that it does not reflect the change you made in step 3.

5. Do "less ~/.cups/lpotions" to see that the preference you recorded in step 3 is reflected in change to this file.

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

I confirm that.
Tests, I made, shown that kdeprint don't use ~/.cups/lpotions.
I don't know yet where kdeprint store the user configuration, but gnome-cups-manager show the enblem of the user default printer assigned by kdeprint, and do not care about ~/.cups/lpotions.

In the same time as it has been discuted, assigning default printer and properties with g-c-m is saved in ~/.cups/lpotions.

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.