Bug 24626

Summary: Trying to change printer driver locks system-config-printer run as user but elevated with polkit
Product: Mageia Reporter: Ben McMonagle <westel>
Component: RPM PackagesAssignee: Nicolas Lécureuil <mageia>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Normal CC: marja11, ouaurelien, yvesbrungard
Version: CauldronKeywords: Triaged
Target Milestone: Mageia 8   
Hardware: All   
OS: Linux   
Whiteboard:
Source RPM: system-config-printer-1.5.12-4.mga8.src.rpm CVE:
Status comment:

Description Ben McMonagle 2019-04-05 22:47:32 CEST
Description of problem: After installing a printer via "Print settings"  using "recommended drivers", test page incorrectly printed. 
opened "Print Settings" from application menu launcher.
double clicked the printer icon to bring up "printer properties" 
click "change" beside "Make and Model"
at prompt enter correct password
Change driver page presented, with "searching for drivers" notice: please wait.
and wait - maybe forever
after pressing cancel or close "x" a window comes up "this application is busy and not responding. do you want to terminate?

you cannot delete the printer from this application.

running the MCC  configure printing works correctly 


Version-Release number of selected component (if applicable):


How reproducible: always


Steps to Reproduce:
1.install a printer via "Print settings"
2. try to change the printer from within the same application, by deleting or changing driver.
3. Invoke MCC and configure printing..
4. attempt to delete printer -yes, change driver -yes
Ben McMonagle 2019-04-05 22:48:06 CEST

Keywords: (none) => 7beta3

Comment 1 Marja Van Waes 2019-04-06 10:24:06 CEST
This is about system-config-printer, right?

Assignee: bugsquad => mageiatools
Source RPM: (none) => system-config-printer
CC: (none) => mageia, marja11

Comment 2 Ben McMonagle 2019-05-13 01:27:36 CEST
(In reply to Marja Van Waes from comment #1)
> This is about system-config-printer, right?

Possibly, but why it does not work from the application menu launcher, but ok from MCC?

Gnome on Wayland
Comment 3 papoteur 2019-05-13 08:37:33 CEST
Hello,
It could be related to bug 19498.

CC: (none) => yves.brungard_mageia

Comment 4 Ben McMonagle 2019-06-19 09:11:39 CEST
no.

tried lightdm / xfce - failed.
fails when invoked from application menu launcher (print settings)
fails when system-config-printer invoked from a user terminal.

works when system-config-printer invoked from a root terminal.
works when mcc invoked from user terminal. 
works when mcc invoked from a root terminal

Priority: Normal => release_blocker
Keywords: 7beta3 => 7RC

Comment 5 Aurelien Oudelet 2020-08-15 16:23:13 CEST
Is this still valid today ?

CC: (none) => ouaurelien

Comment 6 Ben McMonagle 2020-08-16 05:25:58 CEST
sadly, valid for Mga8.

Plasma, 32
Aurelien Oudelet 2020-09-19 17:53:20 CEST

Target Milestone: --- => Mageia 8
Keywords: 7RC => (none)

Comment 7 Aurelien Oudelet 2020-09-19 18:03:32 CEST
Hi,

This is release_blocker for a reason.
Making Mageia even better than ever is best direction.
In order to do right thing, this bug should be examined and fixed as soon as possible.

Packagers, please change the status to "Assigned" when you are working on this.


We will make a decision on the relevance of the release_blocker tag on 1st October 2020 QA meeting.
Comment 8 Aurelien Oudelet 2020-10-20 21:31:30 CEST
Testing this.
Printer is Canon MG7700 Multi-functions Printer.

1. Open MCC.
2. Hardware => "Configure Printer..."
3. Select previously configured printer.
4. Open with right click Properties.
5. In driver, change it.
6. Selecting an other driver: my choice was driver-less, so change to CUPS + Gutenprint.
Dialog ask for keep default PPD or try apply previous PPD settings.
7. Choose keep default PPD information.
No crash.
Printer is OK.

When changing a driver, always keep new settings from PPD files. But, for the sake of this, apply "PPD settings" from a driver-less one to a "true PPD" CUPS + Gutenprint is crazy. Driver-less model PPD is to teach CUPS to send print job as-is to printer.

Change back to previous driver-less.
Always choose keep default PPD information.
No crash.

CUPS SRPM: cups-2.3.3-6.mga8.src.rpm
Installed task-printing, for the records:
# urpmi task-printing
To satisfy dependencies, the following packages are going to be installed:
  Package                        Version      Release       Arch    
(medium "Core Release")
  a2ps                           4.14         22.mga8       x86_64  
  avahi                          0.8          4.mga8        x86_64  (recommended)
  binutils                       2.34         14.mga8       x86_64  
  c2050                          0.4          17.mga8       x86_64  
  c2070                          0.99         17.mga8       x86_64  
  cjet                           0.8.9        17.mga8       x86_64  
  colord                         1.4.4        3.mga8        x86_64  
  cups                           2.3.3        6.mga8        x86_64  
  cups-common                    2.3.3        6.mga8        x86_64  
  cups-drivers                   2008         16.mga8       noarch  
  cups-drivers-capt              0.1          18.mga8       x86_64  
  cups-drivers-foo2kyo           0.1.0a       17.mga8       x86_64  
  cups-drivers-foo2zjs           0.0          1.20121012.1> x86_64  
  cups-drivers-lbp660            0.3.1        13.mga8       x86_64  (recommended)
  cups-drivers-lxx74             0.8.4.2      17.mga8       x86_64  
  cups-drivers-lz11              1.2          16.mga8       x86_64  
  cups-drivers-m2300w            0.51         17.mga8       x86_64  
  cups-drivers-magicolor2430dl   1.6.1        23.mga8       x86_64  
  cups-drivers-magicolor5430dl   1.8.1        23.mga8       x86_64  
  cups-drivers-magicolor5440dl   1.2.1        23.mga8       x86_64  
  cups-drivers-pegg              0.23         17.mga8       x86_64  
  cups-drivers-ptouch            1.5.1        1.mga8        x86_64  
  cups-drivers-splix             2.0.1        0.20130826sv> x86_64  
  cups-filesystem                2.3.3        6.mga8        noarch  
  cups-filters                   1.28.2       2.mga8        x86_64  
  drv_z42                        0.4.3        20.mga8       x86_64  
  epsoneplijs                    0.4.1        13.mga8       x86_64  
  foomatic-db                    4.0          3.20180326.2> noarch  
  foomatic-db-engine             4.0.13       1.20180326.5> x86_64  
  groff-perl                     1.22.4       2.mga8        x86_64  
  gutenprint-common              5.3.3        4.mga8        x86_64  
  gutenprint-cups                5.3.3        4.mga8        x86_64  
  gutenprint-escputil            5.3.3        4.mga8        x86_64  
  gutenprint-gimp2               5.3.3        4.mga8        x86_64  (recommended)
  hplip                          3.20.6       1.mga8        x86_64  
  hplip-gui                      3.20.6       1.mga8        x86_64  (recommended)
  hplip-hpijs                    3.20.6       1.mga8        x86_64  
  hplip-hpijs-ppds               3.20.6       1.mga8        x86_64  
  lexmark2070                    0.6          19.mga8       x86_64  
  lexmark7000linux               990516       18.mga8       x86_64  
  lib64avahi-core7               0.8          4.mga8        x86_64  (recommended)
  lib64cups-filters1             1.28.2       2.mga8        x86_64  
  lib64gnet2.0_0                 2.0.8        19.mga8       x86_64  
  lib64gsnmp0                    0.3.0        12.mga8       x86_64  
  lib64gutenprint9               5.3.3        4.mga8        x86_64  
  lib64gutenprintui2_2           5.3.3        4.mga8        x86_64  (recommended)
  lib64poppler-cpp0              20.09.0      1.mga8        x86_64  
  lib64qpdf28                    10.0.1       1.mga8        x86_64  
  lib64sane-hpaio1               3.20.6       1.mga8        x86_64  
  lib64xm4                       2.3.8        2.mga8        x86_64  
  lib64xp6                       1.0.3        4.mga8        x86_64  
  lm1100                         1.0.2a       22.mga8       x86_64  
  lxcontrol                      1.3          25.mga8       noarch  
  min12xxw                       0.0.9        19.mga8       x86_64  
  ml85p                          0.2.0        15.mga8       x86_64  
  motif                          2.3.8        2.mga8        x86_64  
  mpage                          2.5.7        3.mga8        x86_64  
  mscompress                     0.4          7.mga8        x86_64  
  mtink                          1.0.16       21.mga8       x86_64  
  net-snmp-mibs                  5.8          13.mga8       x86_64  
  netcat-traditional             1.10         42.mga8       x86_64  
  oki4linux                      2.1gst       19.mga8       x86_64  
  pbm2l2030                      1.4          18.mga8       x86_64  
  pbm2lwxl                       0            17.mga8       x86_64  
  pbmtozjs                       0            19.mga8       x86_64  
  pentaxpj                       1.0.0        17.mga8       x86_64  
  perl-File-HomeDir              1.4.0        3.mga8        noarch  
  perl-File-Which                1.230.0      2.mga8        noarch  
  pnm2ppa                        1.13         10.mga8       x86_64  
  poppler                        20.09.0      1.mga8        x86_64  
  poster                         0            0.20060221.1> x86_64  
  postscript-ppds                2006         16.mga8       noarch  
  ppmtocpva                      1.0          20.mga8       x86_64  
  ppmtomd                        1.6          7.mga8        x86_64  
  printer-filters                2008         16.mga8       noarch  
  printer-testpages              2006         14.mga8       noarch  
  printer-tools                  2008         15.mga8       x86_64  
  printer-utils                  2008         16.mga8       noarch  
  python3-qt5-dbus               5.15.1       1.mga8        x86_64  (recommended)
  python3-qt5-widgets            5.15.1       1.mga8        x86_64  (recommended)
  python3-reportlab              3.5.49       1.mga8        x86_64  
  python3-sip                    4.19.24      1.mga8        x86_64  
  scli                           0.4.0        13.mga8       x86_64  
  stylewriter                    0.9.9.1      0.git2017042> x86_64  
  task-printing                  2018         6.mga8        x86_64  
  task-printing-canon            2018         6.mga8        x86_64  
  task-printing-epson            2018         6.mga8        x86_64  
  task-printing-hp               2018         6.mga8        x86_64  
  task-printing-lexmark          2018         6.mga8        x86_64  
  task-printing-misc             2018         6.mga8        x86_64  
  task-printing-okidata          2018         6.mga8        x86_64  
  task-printing-server           2018         6.mga8        x86_64  
  x125                           0.2.3        15.mga8       x86_64  
  z42tool                        0.4.3        20.mga8       x86_64  
190MB of additional disk space will be used.
92MB of packages will be retrieved.

I really don't think this is a release blocker.

Testing with updated M8-Cauldron GNOME Wayland and X11 and Plasma X11.
Can't reproduce this bug.

Decreasing this Bug.

@Ben, Does this still apply to you after a proper install?

Keywords: (none) => NEEDINFO
Status comment: (none) => not reproducible
Source RPM: system-config-printer => system-config-printer-1.5.12-4.mga8.src.rpm
Priority: release_blocker => Normal

Comment 9 Ben McMonagle 2020-10-20 21:47:58 CEST
yes, the problem is not reproducible if you use MCC - works every time :)
see original post.

how-ever, it you use the application menu "Print Setting" entry. it will always  fail if you try to change the settings.
it does not crash the system, it  just locks the application.

reproducible on multiple hardware (HP, Asus and Compaq), various DE, with multiple printer brands.
Comment 10 Aurelien Oudelet 2020-10-20 22:13:01 CEST
Yeah. OK.

Doing in Plasma 5.20: Menu => Tools => System Tools => Printer Settings
This launches system-config-printer as user.
A PolKit icon is on right corner to unlock functionality.
Enter credentials. Try changing driver, NOK : freeze, completely.

journalctl -f output, while testing this:
systemd[2298]: Started Configuration de l'impression - Configuration de l'impression.
oct. 20 21:51:31 mageia.local dbus-daemon[1241]: [system] Activating via systemd: service name='org.freedesktop.hostname1' unit='dbus-org.freedesktop.hostname1.service' requested by ':1.249' (uid=1000 pid=13614 comm="/usr/bin/python3 /usr/share/system-config-printer/")
oct. 20 21:51:31 mageia.local dbus-daemon[1241]: [system] Successfully activated service 'org.freedesktop.hostname1'
oct. 20 21:51:31 mageia.local systemd[1]: Starting Hostname Service...
oct. 20 21:51:31 mageia.local systemd[1]: Started Hostname Service.
oct. 20 21:51:31 mageia.local cupsd[2001]: REQUEST localhost - - "POST / HTTP/1.1" 200 277 Create-Printer-Subscriptions successful-ok
oct. 20 21:51:49 mageia.local polkitd[1337]: Operator of unix-session:c2 successfully authenticated as unix-user:aurelien to gain TEMPORARY authorization for action org.opensuse.cupspkhelper.mechanism.all-edit for unix-process:13614:818655 [/usr/bin/python3 /usr/share/system-config-printer/system-config-printer.py] (owned by unix-user:aurelien)
oct. 20 21:52:12 mageia.local dbus-daemon[1241]: [system] Activating service name='org.opensuse.CupsPkHelper.Mechanism' requested by ':1.250' (uid=1000 pid=13614 comm="/usr/bin/python3 /usr/share/system-config-printer/") (using servicehelper)
oct. 20 21:52:12 mageia.local dbus-daemon[1241]: [system] Successfully activated service 'org.opensuse.CupsPkHelper.Mechanism'
oct. 20 21:52:12 mageia.local cupsd[2001]: REQUEST localhost - - "POST / HTTP/1.1" 401 100 CUPS-Get-Devices successful-ok
oct. 20 21:52:14 mageia.local cupsd[2001]: REQUEST localhost - root "POST / HTTP/1.1" 200 175 CUPS-Get-Devices -
oct. 20 21:52:15 mageia.local cupsd[2001]: [cups-driverd] Bad driver information file "/usr/share/cups/model/foomatic-db-ppds/Kyocera/ReadMe.htm"!
oct. 20 21:52:15 mageia.local cupsd[2001]: [cups-driverd] Skipping "/usr/local/share/ppd": loop detected!
oct. 20 21:52:15 mageia.local cupsd[2001]: [cups-driverd] Skipping "/usr/share/ppd": loop detected!
oct. 20 21:52:15 mageia.local cupsd[2001]: [cups-driverd] Skipping "/opt/share/ppd": loop detected!
oct. 20 21:52:19 mageia.local cupsd[2001]: REQUEST localhost - - "POST / HTTP/1.1" 200 5375677 CUPS-Get-PPDs -
oct. 20 21:52:28 mageia.local systemd[1]: systemd-hostnamed.service: Succeeded.
oct. 20 21:52:32 mageia.local kwin_killer_helper[13708]: kf.i18n.kuit: "Tag 'p' is not defined in message {<__kuit_internal_top__><p>Vous avez essayé de fermer la fenêtre « Modifier le pi...}."

So, this is completely broken launching system-config-printer as user.

But, using MCC is correct way to do administrative tasks.

Workaround that run well:
Under GNOME, running from GNOME Settings => Printers: this is OK.
Under Plasma, after installing print-manager-20.08.2-1.mga8 (which is not installed by default, see https://bugs.mageia.org/show_bug.cgi?id=27255)
user can change drivers withing systemsettings5 => Printers.

So there is clearly a bug here. Not a release_blocker one.

Assigning really to maintainer of system-config-printer.
(Please set the status to 'assigned' if you are working on it)

Status comment: not reproducible => (none)
Keywords: (none) => Triaged
Assignee: mageiatools => mageia
CC: mageia => (none)

Aurelien Oudelet 2020-10-20 22:14:10 CEST

Keywords: NEEDINFO => (none)
Summary: trying to change printer driver locks printer utility "Print settings" => Trying to change printer driver locks system-config-printer run as user but elevated with polkit

Comment 11 Aurelien Oudelet 2020-10-20 22:18:21 CEST
$ sudo system-config-printer

from Konsole in unaffected.


Bug is when system-config-printer is launching from:
Menu => Tools => System Tools => Configure Printer
Comment 12 Ben McMonagle 2021-01-29 08:51:31 CET
fixed in rc1

Resolution: (none) => FIXED
Status: NEW => RESOLVED