Bug 1299051

Summary: lpinfo -U doesn't work
Product: [Fedora] Fedora Reporter: Veteran <lfelia>
Component: cupsAssignee: Zdenek Dohnal <zdohnal>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: edgar.hoch, jpopelka, twaugh, zdohnal
Target Milestone: ---Keywords: Patch
Target Release: ---   
Hardware: i686   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-06-16 06:02:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Proposed patch none

Description Veteran 2016-01-15 19:51:18 UTC
Description of problem:
man lpinfo says that lpinfo -U <username> is used to specify an alternate user name to connect to cups server. When I try to use lpinfo -U I get the error

lpinfo: Unknown option "U"



Version-Release number of selected component (if applicable): cups-2.0.3-1.fc22.i686


How reproducible:


Steps to Reproduce:
1. type lpinfo -U <username> -v to list printers
2.
3.

Actual results:
lpinfo: Unknown option "U"


Expected results:
expect a password prompt to connect to print server

Additional info:
Also doesn't work in Ubuntu, possibly broken upstream.

Comment 1 Zdenek Dohnal 2016-05-13 13:22:50 UTC
After looking into source code I found out that argument -U isn't implemented in lpinfo.c at all (the last commit in lpinfo.c is six years old, even in upstream). I asked upstream (via mailing lists and github pull request) about this matter (I asked if they mention option -U as same future feature, which is not implemented right now, or I misinterpreted something and this functionality is somewhere in the code), but with no response. So I think this bug results in feature request, but it will need to write all client-server authentication for concrete user (option -v uses basic authentication), so it can be time consuming. 
Veteran, do you need this option working for purpose, which is important to you? Because if this functionality is not critical to you, I propose a patch, which removes option -U from manual pages.

Comment 3 Zdenek Dohnal 2016-05-26 10:48:12 UTC
Upstream sent following email on cups-devel mailing list. It contains information about option -U <username> in lpmove tool, but I think it is applicable even in lpinfo case: 

"Currently lpmove does not support the -U option, despite what the man page says."

And upstream presented possible workaround:

CUPS_USER=foo lpmove ...

https://www.cups.org/pipermail/cups-devel/2016-May/016829.html

Comment 4 Zdenek Dohnal 2016-05-30 11:28:42 UTC
Created attachment 1162784 [details]
Proposed patch

Comment 5 Veteran 2016-05-31 18:21:41 UTC
I do not need the functionality. It works for me as is.

Comment 6 Zdenek Dohnal 2016-06-16 06:02:09 UTC
Upstream accepted my patch and merged it into its github project. They marked it as RFE.