I noticed this SRU was prepared without the SRU Template[1] filled in.
While most of the data we want is in the bug description as is (what's
wrong, test plan), it's lacking an analysis of what could go wrong.
That boat has sailed now, and doing an analysis of the patch right now,
basically what could go wrong is if someone was relying on the old
behavior, of the command only changing the local user's (root in this
case) config, instead of system-wide.
The lpoptions[1] manpage doesn't really special case root when the -d
option is used:
-d destination[/instance]
Sets the user default printer to destination. If instance is
supplied then that
particular instance is used. This option overrides the system
default printer for
the current user.
But later down, in "FILES", we see:
~/.cups/lpoptions - user defaults and instances created by non-root
users.
/etc/cups/lpoptions - system-wide defaults and instances created by the
root user.
So it does seem the intention of that option when used by the root user
was to update the system-wide /etc/cups/lpoptions file instead.
So even if someone was relying on the previous behavior, it was
incorrect, and the documentation (which could be clearer, but isn't)
seems to agree that the previous behavior was incorrect.
That's the kind of analysis we would like to see in "what could go
wrong", and "other info" sections of the SRU template.
1. https://manpages.ubuntu.com/manpages/jammy/en/man1/lpoptions.1.html
--
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to cups in Ubuntu.
https://bugs.launchpad.net/bugs/2052925
Title:
lpoptions -d as root
Status in cups package in Ubuntu:
Fix Released
Status in cups source package in Jammy:
Fix Released
Bug description:
Copied from https://github.com/OpenPrinting/cups/issues/454
Yair Yarom submitted Debian bug 1008053 and observed that running
lpoptions as root does not update /etc/cups/lpoptions but
/root/.cups/lpoptions.
Running lpoptions as root (e.g. "lpoptions -d HP-OfficeJet") should
update /etc/cups/lpoptions to be the defaults for all users. But
instead it tries to update /root/.cups/lpoptions.
This has been fixed upstream in cups, in debian sid, and mantic.
Proposing to add this change in jammy and older (still supported)
series as well.
The fix is a one line change in
https://github.com/OpenPrinting/cups/pull/456
Thanks.
1) The release of Ubuntu you are using, via 'lsb_release -rd' or
System -> About Ubuntu
ubuntu@jammy-vm:~$ lsb_release -rd
Description: Ubuntu 22.04.3 LTS
Release: 22.04
2) The version of the package you are using, via 'apt-cache policy
pkgname' or by checking in Software Center
ubuntu@jammy-vm:~$ apt-cache policy cups
cups:
Installed: 2.4.1op1-1ubuntu4.7
Candidate: 2.4.1op1-1ubuntu4.7
Version table:
*** 2.4.1op1-1ubuntu4.7 500
500 http://archive.ubuntu.com/ubuntu jammy-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu jammy-security/main amd64
Packages
100 /var/lib/dpkg/status
2.4.1op1-1ubuntu4 500
500 http://archive.ubuntu.com/ubuntu jammy/main amd64 Packages
3) What you expected to happen:
root@jammy-vm:~# lpstat -p
printer HP-Officejet-Pro-8710 is idle. enabled since Thu 01 Feb 2024
03:17:49 PM UTC
root@jammy-vm:~#
root@jammy-vm:~# lpoptions -d HP-Officejet-Pro-8710
copies=1 device-uri=lpd://10.20.135.153:515/PASSTHRU finishings=3
job-cancel-after=10800 job-hold-until=no-hold job-priority=50
job-sheets=none,none marker-change-time=0 number-up=1 print-color-mode=color
printer-commands=none printer-info=HP-Officejet-Pro-8710
printer-is-accepting-jobs=true printer-is-shared=true
printer-is-temporary=false printer-location printer-make-and-model='HP
Officejet Pro 8710, hpcups 3.21.12' printer-state=3
printer-state-change-time=1706800669 printer-state-reasons=none
printer-type=4124
printer-uri-supported=ipp://localhost/printers/HP-Officejet-Pro-8710
root@jammy-vm:~#
root@jammy-vm:~# cat /etc/cups/lpoptions
Default HP-Officejet-Pro-8710
root@jammy-vm:~#
root@jammy-vm:~# cat /root/.cups/lpoptions
cat: /etc/cups/lpoptions: No such file or directory
root@jammy-vm:~#
4) What happened instead:
root@jammy-vm:~# lpstat -p
printer HP-Officejet-Pro-8710 is idle. enabled since Thu 01 Feb 2024
03:17:49 PM UTC
root@jammy-vm:~#
root@jammy-vm:~# lpoptions -d HP-Officejet-Pro-8710
copies=1 device-uri=lpd://10.20.135.153:515/PASSTHRU finishings=3
job-cancel-after=10800 job-hold-until=no-hold job-priority=50
job-sheets=none,none marker-change-time=0 number-up=1 print-color-mode=color
printer-commands=none printer-info=HP-Officejet-Pro-8710
printer-is-accepting-jobs=true printer-is-shared=true
printer-is-temporary=false printer-location printer-make-and-model='HP
Officejet Pro 8710, hpcups 3.21.12' printer-state=3
printer-state-change-time=1706800669 printer-state-reasons=none
printer-type=4124
printer-uri-supported=ipp://localhost/printers/HP-Officejet-Pro-8710
root@jammy-vm:~#
root@jammy-vm:~# cat /etc/cups/lpoptions
cat: /etc/cups/lpoptions: No such file or directory
root@jammy-vm:~#
root@jammy-vm:~# cat /root/.cups/lpoptions
Default HP-Officejet-Pro-8710
root@jammy-vm:~#
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/2052925/+subscriptions
--
Mailing list: https://launchpad.net/~desktop-packages
Post to : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help : https://help.launchpad.net/ListHelp