Summary: | print-manager is too greedy for permissions, unusable for non cups admin | ||
---|---|---|---|
Product: | [Frameworks and Libraries] print-manager | Reporter: | Pierre <pierre.sauter> |
Component: | general | Assignee: | Daniel Nicoletti <dantti12> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version First Reported In: | 4.11.0 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | http://commits.kde.org/print-manager/013721bbc64433921c77b6f650f706e86bf22ccd | Version Fixed In: | |
Sentry Crash Report: | |||
Attachments: |
Patch to get a sane behaviour for my setup.
How about that? Sorry, should be std::string(cupsServer()) == "localhost" |
Description
Pierre
2013-09-09 14:25:56 UTC
Created attachment 82239 [details]
Patch to get a sane behaviour for my setup.
Works for me, however I doubt it will work for other use cases.
hmm most of the patch should be fine, only the last part that can't be simply commented. I was to investigate why some s-c-p requests didn't need root password, but it seems you find out, thanks. Still the last line works on s-c-p and I even looked at it's sources and don't know why... I'll test and probably apply most of it, if you can bitsec the last line that would be great. Thanks for looking at my proposal. Let me explain the last change: In PrintKCM::getServerSettings you call cupsAdminGetServerSettings from cups/adminutil. This requires admin privileges on the cups server. Right now it is called already in the constructor, which causes the root password dialog to popup as soon as I enter the printer panel in systemsettings. When its commented out in the constructor, the dialog only appears when I click on the settings button in the printer panel, which is more acceptable in my opinion. I am not sure if the first change is good for everyone. Our cups server (1.4.4) just does not return 'printer-name' in the job attributes, which causes print-manager to always have an empty job list. Right, but understand that the settings page needs to know if the Server is allowing printers to be shared to enable the Share button, and that can only happens if I call cupsAdminGetServerSettings. Ah yes, the first one was recently removed since I increased the CUPS requirement as we needed a feature present only in CUPS 1.5, can't you upgrade? Created attachment 82254 [details]
How about that?
If the cups Server is not localhost, you can not assume to get cups admin privileges.
Comment on attachment 82254 [details]
How about that?
hmm that needs testing (I believe that doesn't tell you it is localhost), also you can't compare char * strings like that.
Created attachment 82255 [details]
Sorry, should be std::string(cupsServer()) == "localhost"
Tested on my system.
If I move away the /etc/cups/client.conf with the line "ServerName XXX" in it then I get either "localhost" or "/var/run/cups/cups.sock". However this is not generic as the cups admin can configure it arbitrarily in /etc/cups/cupsd.conf. I wonder if there is a method in the cups api to get what I want.
Git commit 013721bbc64433921c77b6f650f706e86bf22ccd by Daniel Nicoletti. Committed on 22/10/2013 at 18:46. Pushed by dantti into branch 'KDE/4.11'. Avoid talking to /admin with CUPS server to avoid unneded password dialogs M +2 -2 libkcups/KCupsRequest.cpp http://commits.kde.org/print-manager/013721bbc64433921c77b6f650f706e86bf22ccd |