Bug 443205

Summary: system-config-printer does not always start from non root login
Product: [Fedora] Fedora Reporter: n_k_samal
Component: system-config-printerAssignee: Tim Waugh <twaugh>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: urgent Docs Contact:
Priority: low    
Version: 9CC: antonio.montagnani, wwoods
Target Milestone: ---   
Target Release: ---   
Hardware: i686   
OS: Linux   
Whiteboard:
Fixed In Version: 0.7.82.3-2.fc9 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-19 06:01:17 EDT Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On:    
Bug Blocks: 235705    
Attachments:
Description Flags
screen of system-config-printer as user
none
Screen as root none

Description n_k_samal 2008-04-19 04:56:50 EDT
Description of problem:
The root user generally works by logging as ordinary user. In cases of need the 
root user does a "su root" or enters the root password when asked by gui tool 
system-config-printer and carries out necessary configuration changes. Most of 
the time the system does not respond when the root user tries to use the 
graphical gui tool system-config-printer.

Version-Release number of selected component (if applicable):
Fedora-9-Beta-i386

How reproducible:
Log in as root and run the gui tool from system-config-printer from applications

Steps to Reproduce:
1.Log in as ordinary uses
2.Go to applications > printing.
3.Press enter
4.If no response for about 20 seconds log out and re-login again as non root 
user and repeat steps 2 and 3
5. If no response try step 4 once again.
6. After two /three/four trials the system asks to enter root password.
7. Now necessary changes can be made.
  
Actual results:
Most of the times no response.

Expected results:
The system should have asked the non root user to enter root password on the 
first time itself since he does not has the required privilages.

Additional info:
Full system profile is at http://www/smolt.org/show?/uuid=pub_85955a62-7804-
46c3-9010-eb5cf098549a.
No such problem was seen in F7. Every time the graphical GUI tools system-
config-printer was invoked by not root user, the system used to ask for root 
password. Once root password was entered necessary changes could be made.
Comment 1 Tim Waugh 2008-04-21 10:12:17 EDT
I haven't been able to reproduce this.

Whta does 'rpm -q system-config-printer' say?
Comment 2 antonio montagnani 2008-05-09 04:03:27 EDT
I have same problem:

If I start as root the graphical tool for printing everything seems o.k, but as
standard user I am not requested for password and I get a message stating:

CUPS server error
HTTP error: not connected
Comment 3 antonio montagnani 2008-05-09 04:04:50 EDT
system-config-printer-0.7.82.2-4.fc9.i386

I forgot this piece of info
Comment 4 Tim Waugh 2008-05-09 04:20:22 EDT
I'm a little confused: in the original report it seemed like the problem was
that system-config-printer wouldn't start when logged in as root, but in comment
#2 it looks like the problem only occurs when logged in as a *non-root* user.

When I try this here I don't see any problem at all.

Please attach your /etc/cups/cupsd.conf file.
Comment 5 antonio montagnani 2008-05-09 04:33:35 EDT
Here it is......

MaxLogSize 0
# Show troubleshooting information in error_log.
LogLevel debug
SystemGroup sys root
# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock
# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all
DefaultAuthType Basic
<Location />
  # Restrict access to the server...
  Order allow,deny
</Location>
<Location /admin>
  Encryption Required
  # Restrict access to the admin pages...
  Order allow,deny
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  # Restrict access to the configuration files...
  Order allow,deny
</Location>
<Policy default>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs
Set-Job-Attributes Create-Job-Subscription Renew-Subscription
Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job
Suspend-Current-Job Resume-Job CUPS-Move-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class
CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer
Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs
Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer
Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
Comment 6 Tim Waugh 2008-05-09 07:48:24 EDT
Please try running 'system-config-printer' from the GNOME terminal window --
does that make any difference?  What output does it give?
Comment 7 antonio montagnani 2008-05-09 07:59:23 EDT
Created attachment 304935 [details]
screen of system-config-printer as user

I will submit same screen as root
Comment 8 antonio montagnani 2008-05-09 08:02:22 EDT
Created attachment 304936 [details]
Screen as root

I apologize for the Italian :-)

It was working fine!!! because sometimes I used to open this window to test if
Bugzilla Bug 439154: Cannot print on a Windows shared printer had been
solved!!!
Comment 9 Tim Waugh 2008-05-09 08:13:14 EDT
When logged in as the non-root user, what output do these commands give?:

1. ls ~/.cups
2. lpstat -s
3. system-config-printer
Comment 10 antonio montagnani 2008-05-09 08:35:45 EDT
 ls ~/.cups
ls: impossibile accedere a /home/antonio/.cups: No such file or directory
[antonio@acer ~]$ lpstat -s
destinazione predefinita di sistema: LaserJet_1200
dispositivo per Cups-PDF: cups-pdf:/
dispositivo per LaserJet_1200: smb://WORKGROUP/CELERON/HPLaserJ
dispositivo per LaserJet_12002: smb://WORKGROUP/CELERON/HPLaserJ
[antonio@acer ~]$ system-config-printer

usual error
Comment 11 Tim Waugh 2008-05-09 08:40:35 EDT
Please try this:

PYCUPS_DEBUG=1 system-config-printer

What output do you get?
Comment 12 antonio montagnani 2008-05-09 08:51:45 EDT
 PYCUPS_DEBUG=1 system-config-printer
-> Connection_init()
httpConnectEncrypt(...)
<- Connection_init() = 0
-> Connection_getPrinters()
cupsDoRequest("/")
Attribute: printer-is-shared
Added printer-is-shared to dict
Attribute: printer-state
Added printer-state to dict
Attribute: printer-state-message
Added printer-state-message to dict
Attribute: printer-state-reasons
-> build_list_from_attribute_strings()
none
<- build_list_from_attribute_strings()
Added printer-state-reasons to dict
Attribute: printer-type
Added printer-type to dict
Attribute: printer-uri-supported
Added printer-uri-supported to dict
Attribute: printer-name
Attribute: printer-location
Added printer-location to dict
Attribute: printer-info
Added printer-info to dict
Attribute: device-uri
Added device-uri to dict
Attribute: printer-make-and-model
Added printer-make-and-model to dict
Attribute: printer-is-shared
Added printer-is-shared to dict
Attribute: printer-state
Added printer-state to dict
Attribute: printer-state-message
Added printer-state-message to dict
Attribute: printer-state-reasons
-> build_list_from_attribute_strings()
none
<- build_list_from_attribute_strings()
Added printer-state-reasons to dict
Attribute: printer-type
Added printer-type to dict
Attribute: printer-uri-supported
Added printer-uri-supported to dict
Attribute: printer-name
Attribute: printer-location
Added printer-location to dict
Attribute: printer-info
Added printer-info to dict
Attribute: device-uri
Added device-uri to dict
Attribute: printer-make-and-model
Added printer-make-and-model to dict
Attribute: printer-is-shared
Added printer-is-shared to dict
Attribute: printer-state
Added printer-state to dict
Attribute: printer-state-message
Added printer-state-message to dict
Attribute: printer-state-reasons
-> build_list_from_attribute_strings()
none
<- build_list_from_attribute_strings()
Added printer-state-reasons to dict
Attribute: printer-type
Added printer-type to dict
Attribute: printer-uri-supported
Added printer-uri-supported to dict
Attribute: printer-name
Attribute: printer-location
Added printer-location to dict
Attribute: printer-info
Added printer-info to dict
Attribute: device-uri
Added device-uri to dict
Attribute: printer-make-and-model
Added printer-make-and-model to dict
<- Connection_getPrinters() = dict
-> Connection_getClasses()
cupsDoRequest("/")
<- Connection_getClasses() = dict
-> Connection_getFile(/admin/conf/printers.conf, /tmp/tmplW1lLgprinter.conf)
cupsGetFile()
set_http_error: 401
<- Connection_getFile() (error)
-> Connection_init()
httpConnectEncrypt(...)
<- Connection_init() = 0
-> Connection_getFile(/admin/conf/printers.conf, /tmp/tmplW1lLgprinter.conf)
cupsGetFile()
set_http_error: -1
<- Connection_getFile() (error)
httpClose()
Comment 13 Tim Waugh 2008-05-09 09:35:12 EDT
The exact circumstance this occurs is when a local queue exists that uses an
'smb://...' URI.
Comment 14 Will Woods 2008-05-09 17:29:12 EDT
Note added to http://fedoraproject.org/wiki/Bugs/F9Common. Moving to F9Target.

Tim, is there a fix for this in the current s-c-printer build for F9 in koji? 
Comment 15 Tim Waugh 2008-05-12 04:58:10 EDT
Yes, system-config-printer-0.7.82.3-1.fc9 has the fix.
Comment 16 Bug Zapper 2008-05-14 05:42:30 EDT
Changing version to '9' as part of upcoming Fedora 9 GA.
More information and reason for this action is here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping