[Bug 2052925] Re: lpoptions -d as root

2024-03-07 Thread Launchpad Bug Tracker
This bug was fixed in the package cups - 2.4.1op1-1ubuntu4.8

---
cups (2.4.1op1-1ubuntu4.8) jammy; urgency=medium

  * The "lpoptions" utility, when run as root was writing into the file
/root/.cups/lpoptions instread of /etc/cups/lpoptions. System software
should never write into /root/ (LP: #2052925).

 -- Till Kamppeter   Wed, 14 Feb 2023 14:10:00
+0100

** Changed in: cups (Ubuntu Jammy)
   Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2052925

Title:
  lpoptions -d as root

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/2052925/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2052925] Re: lpoptions -d as root

2024-03-07 Thread Andreas Hasenack
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 Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2052925

Title:
  lpoptions -d as root

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/2052925/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2052925] Re: lpoptions -d as root

2024-03-01 Thread Rudra Trivedi
I've successfully tested this package on jammy using -proposed:

ubuntu@jammy-vm:~$ lsb_release -rd
Description:Ubuntu 22.04.3 LTS
Release:22.04
ubuntu@jammy-vm:~$
ubuntu@jammy-vm:~$ apt-cache policy cups
cups:
  Installed: 2.4.1op1-1ubuntu4.8
  Candidate: 2.4.1op1-1ubuntu4.8
  Version table:
 *** 2.4.1op1-1ubuntu4.8 500
500 http://archive.ubuntu.com/ubuntu jammy-proposed/main amd64 Packages
...


root@jammy-vm:~# cat /root/.cups/lpoptions
cat: /root/.cups/lpoptions: No such file or directory
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:~# 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:~# 
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
[...]
root@jammy-vm:~# 
root@jammy-vm:~# cat /root/.cups/lpoptions
cat: /root/.cups/lpoptions: No such file or directory
root@jammy-vm:~# 
root@jammy-vm:~# cat /etc/cups/lpoptions
Default HP-Officejet-Pro-8710


** Tags removed: verification-needed-jammy
** Tags added: verification-done-jammy

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2052925

Title:
  lpoptions -d as root

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/2052925/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 2052925] Re: lpoptions -d as root

2024-02-25 Thread Rudra Trivedi
I will test this once I'm back from PTO on 1Mar.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2052925

Title:
  lpoptions -d as root

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cups/+bug/2052925/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs