Cannot declare itself as another username with CUPS server

Bug #856776 reported by Jonathan Allard
76
This bug affects 15 people
Affects Status Importance Assigned to Milestone
Common Print Dialog
New
Wishlist
Unassigned
cups (Ubuntu)
Invalid
Wishlist
Unassigned

Bug Description

Originally posted on http://askubuntu.com/questions/61095/use-different-username-on-cups-remote-printing :

> I'm using CUPS to print on an enterprise network. The job gets submitted fine, but I need to submit it as another username. Now I'm `jon` but I need to send it as say `jonallard`.
>
> On the command line, one could print as such
>
> lp -U jonallard -d printer1 file.ext
>
> How do I customize the *username* part when using the GUI printing dialogs and the Printing system settings?
>
> It is possible that it isn't, in fact, possible to add this username to the Ubuntu print config. If so, where should I ask for an improvement?"

Martin Owens -doctormo-@AskUbuntu suggested I add the username in the IPP URI directly. The printer address dialog won't let me do that.

Is this a bug or is there some hidden place to put this username or should it be improved?

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: system-config-printer-gnome 1.3.1+20110222-0ubuntu16.3
ProcVersionSignature: Ubuntu 2.6.38-11.48-generic 2.6.38.8
Uname: Linux 2.6.38-11-generic x86_64
NonfreeKernelModules: nvidia
Architecture: amd64
CupsErrorLog:

Date: Thu Sep 22 16:17:38 2011
ExecutablePath: /usr/share/system-config-printer/system-config-printer.py
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
InterpreterPath: /usr/bin/python2.7
Lpstat: device for uprint-mono: ipp://cups.ncs.mcgill.ca:631/printers/mcgill_mono
MachineType: LENOVO 427637U
PackageArchitecture: all
Papersize: letter
PpdFiles: uprint-mono: Generic PCL Laser Printer
ProcEnviron:
 LANGUAGE=en_CA:en
 LANG=en_CA.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-2.6.38-11-generic root=UUID=264a98b8-d582-4814-bb46-81adf856e638 ro splash vga=795 quiet splash vt.handoff=7
SourcePackage: system-config-printer
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 05/13/2011
dmi.bios.vendor: LENOVO
dmi.bios.version: 8BET44WW (1.24 )
dmi.board.asset.tag: Not Available
dmi.board.name: 427637U
dmi.board.vendor: LENOVO
dmi.board.version: Not Available
dmi.chassis.asset.tag: No Asset Information
dmi.chassis.type: 10
dmi.chassis.vendor: LENOVO
dmi.chassis.version: Not Available
dmi.modalias: dmi:bvnLENOVO:bvr8BET44WW(1.24):bd05/13/2011:svnLENOVO:pn427637U:pvrThinkPadW520:rvnLENOVO:rn427637U:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
dmi.product.name: 427637U
dmi.product.version: ThinkPad W520
dmi.sys.vendor: LENOVO

Revision history for this message
Jonathan Allard (joallard) wrote :
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

What you could try is to edit the URIs in the /etc/cups/printers.conf file. Stop CUPS, edit the file and after that start CUPS.

You have to edit the URIs adding "<USER>@" before the host name.

Turn

ipp://cups.ncs.mcgill.ca:631/printers/mcgill_mono

into

ipp://<email address hidden>:631/printers/mcgill_mono

Does this work for you?

Changed in system-config-printer (Ubuntu):
status: New → Incomplete
Revision history for this message
Jonathan Allard (joallard) wrote :

At my surprise, the file was already configured as such. Upon submitting a new job, it looks like my alternate username still wasn't sent.

## /etc/cups/printers.conf ##
# Printer configuration file for CUPS v1.4.6
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
<Printer uprint-mono>
AuthInfoRequired none
Info McGill uPrint (Mono)
MakeModel Generic PCL Laser Printer
DeviceURI ipp://<email address hidden>:631/printers/mcgill_mono
State Idle
StateTime 1316732489
Type 4206676
Product (PCL Laser Printer)
Filter application/vnd.cups-raw 0 -
Filter application/vnd.cups-raster 50 rastertohp
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy authenticated
ErrorPolicy retry-job
Option User jonallard
</Printer>

Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

This is a missing feature in CUPS upstream. CUPS has no possibility to set an alternative user as a default setting for a queue.

Report this on the upstream bug tracking system of CUPS:

http://www.cups.org/str.php

affects: system-config-printer (Ubuntu) → cups (Ubuntu)
Changed in cups (Ubuntu):
importance: Undecided → Wishlist
status: Incomplete → Confirmed
Revision history for this message
Jonathan Allard (joallard) wrote :

Actually, under cups 1.5.0, it is possible to use the option '-U' to identify as another user on the remote server.

Revision history for this message
Jonathan Allard (joallard) wrote :

Since it works on cups' `lp`, I'll move this back to the system dialogs

affects: cups (Ubuntu) → system-config-printer (Ubuntu)
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

As CUPS does not support setting the job user name as default, on system-config-printer we cannot do anything, as it is only for setting the defaults for a print queue. The print dialogs of the applications are not part of system-config-printer.

So what needs improvement is:

1. CUPS, to allow job user names as default, via URIs like ipp://<email address hidden>:631/printers/mcgill_mono

2. The print dialogs of the applications, to allow to set a job user name on a per-job basis

tags: added: cpd
Revision history for this message
Till Kamppeter (till-kamppeter) wrote :

Lars, consider this as a feature request for the Common Print Dialog. It should offer the possibility to enter a job user name.

affects: system-config-printer (Ubuntu) → cups (Ubuntu)
Changed in common-print-dialog-gtk:
importance: Undecided → Wishlist
Revision history for this message
Guy Taylor (thebiggerguy) wrote :

In 12.04 when entering user@host/printer format into the add printer wizard the final added printer URI is host/printer thus breaking the suggested fix.

Revision history for this message
jhoechtl (johann-hoechtl) wrote :

I can't believe this is still in. Is CUPS unused in enterprise environments? At our offce we identiy with an account number as to assign printout costs to department accounts rather than individual users. I have to set a username for printig, without identifiication, printouts get silently ignored.

Revision history for this message
Ketil Malde (ketil-ii) wrote : Re: [Bug 856776] Re: Cannot declare itself as another username with CUPS server

> I can't believe this is still in. Is CUPS unused in enterprise
> environments?

In my opinion, CUPS is good infrastructure, but it needs a bit of love
with documentation and user interaction and so on. Which it somehow
isn't getting, and it puzzles me why - most other system critical stuff
seems to attract developers more or less automatically...

-k
--
If I haven't seen further, it is by standing in the footprints of giants

Revision history for this message
Migas (migaxmoitax) wrote :

I worked around this by adding

Option job-originating-user-name <username>

In the printer under printers.conf file.

You can also go to printing > properties > Job Options > Other Options (Advanced)
add: job-originating-user-name
value: <username>

Revision history for this message
p-dot (pseubodot) wrote :

# User-Agent: CUPS/1.6.2 (Linux 3.8.0-29-generic; x86_64) IPP/2.0

We have a 'secure' (= cannot print without logging in with a fob) printing system working on a Ricoh printer. The cups server is running on my workstation, and I'm working mostly off of packet capture.

I *CAN* send a secured job to the printer *if* I do it from the command line and invoke the -U flag (lp -p <printer> -U <username> <filename>); I can see in the request packet the 'requesting-user-name' is set properly (my 'organizational' user name, not my username on the local system).

I have tried the following:
* putting 'Option job-originating-user-name <username>' in the /etc/cups/printers.conf file (per Migas)
* adding 'job-originating-user-name' 'requesting-user-name' 'user-name' with my institutional user name in the printer dialog box ('job options') ... and combinations thereof. I can also confirm that these get indeed added to the printers.conf file.
* adding 'job-originating-user-name=<username>' and 'requesting-user-name <username>' to the local printer options in ~/.cups/lpoptions ('Dest <printer> job-originating-user-name=<username> requesting-user-name <username>') and I have also set each one in turn in that file.

In *none* of these cases does the cups server appear to pick up on any of the settings, because I only ever find my username on the local system in print requests (as obtained via packet captures).

Clearly, the plumbing to be able to *send* a print job as another 'user' exists in cups (as evidenced by the ability to set it manually on a cli-based print request). The information supplied to the printer config dialog is clearly going into the printers.conf file. Other print options are being read by the server, so in theory these other options should be read as well (how to confirm?). Either the option is not being read (ignored because it's not an option the server thinks it can handle?) or it isn't being passed on even though the server will otherwise send the local user name.

Revision history for this message
Ted (ted276) wrote :

Apparently CUPS added support for specifying a username in CUPS 1.6b1 (May 24, 2012):

* CUPS now supports a User directive in client.conf and the CUPS_USER environment variable for overriding the default username (STR #3114)

http://www.cups.org/documentation.php/doc-1.6/relnotes.html
http://www.cups.org/str.php?L3114

The version of CUPS in Ubuntu releases:

precise (12.04LTS) 1.5.3-0ubuntu5.1
precise-updates 1.5.3-0ubuntu8
quantal (12.10) 1.6.1-0ubuntu11.5
raring (13.04) 1.6.2-1ubuntu8
saucy (13.10) 1.7.0~rc1-0ubuntu5.2
trusty 1.7.1-4

1.6b1 precedes 1.6.0, so the version of CUPS in Quantal should have the feature. I haven't tested this myself.

The question now is, since CUPS has underlying support for this, have the user interfaces in Ubuntu been updated to take advantage of it? The areas that should be updated are, at minimum:

1. The popup username/password dialog that is displayed when AuthInfoRequired requires a username. Currently the username that is entered appears to be completely ignored (in 12.04 LTS at least).

2. The Job tab or Advanced tab in the standard print dialog.

3. Anywhere else a user configures client.conf.

4. The Add Printer dialog should ask for the username/password to be used for all jobs sent to the printer. The method of doing so may be different than what is needed for 1-3 though, since this one would be attached to the printer, and that might mean modifying printers.conf instead of client.conf. I really don't know what the conceptual separation is for those, so someone who knows the system better can chime in on that.

I'll be upgrading just for this. For those stuck on 12.04 LTS like I currently am, using "lp -U username" is the only way I've found to get the username to be sent. pseudobot's findings above were the same as mine. Adding "job-originating-user-name" and "requesting-user-name" in /etc/cups/printers.conf had no effect. Also, whether or not there was a user account on the system with that username had no effect.

If you really can't leave 12.04 LTS and are willing to repackage cups for local use, the function to change appears to be cupsUser() in cups/usersys.c. That is used everywhere to decide what the current username is, including when sending "requesting-user-name".

Revision history for this message
gf (gf-interlinks-deactivatedaccount) wrote :

Hello Jonathan,
Thank you for submitting this feature/enhancement request for the cups package. You made this request quite some time ago and Ubuntu has been updated since then.

Do you think this feature/enhancement is still needed or can we close this bug report?

Thank you again for helping make Ubuntu better.
G
[Ubuntu Bug Squad volunteer triager]

Changed in cups (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Jonathan Allard (joallard) wrote : Re: [Bug 856776] Re: Cannot declare itself as another username with CUPS server

*laughs*

Indeed, I do not need this anymore. I've had time to graduate university
(where CUPS was useful), move homes a bunch of times, change OSes, among
other things. Have a good triage!

On Thu, Nov 1, 2018 at 11:06 AM gf <email address hidden> wrote:

> Hello Jonathan,
> Thank you for submitting this feature/enhancement request for the cups
> package. You made this request quite some time ago and Ubuntu has been
> updated since then.
>
> Do you think this feature/enhancement is still needed or can we close
> this bug report?
>
> Thank you again for helping make Ubuntu better.
> G
> [Ubuntu Bug Squad volunteer triager]
>
> ** Changed in: cups (Ubuntu)
> Status: Confirmed => Incomplete
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/856776
>
> Title:
> Cannot declare itself as another username with CUPS server
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/common-print-dialog-gtk/+bug/856776/+subscriptions
>

Revision history for this message
gf (gf-interlinks-deactivatedaccount) wrote :

Hi Jonathan. Thanks for the update on your life! (chuckle!)
Congratulations on graduating university. :)
I hope you still have time for Ubuntu or some form of Linux in your life. I am just clearing up these old bug reports that are still open from years ago.

I will close the report now.
Have a great day!
:)
G
Oshawa, Ontario (hello, fellow Canadian!)

Closed per reporter’s feedback.

Changed in cups (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers