Fix authentication
ClosedPublic

Authored by nicolasfella on Aug 24 2019, 4:25 PM.

Details

Summary

According to the CUPS code (https://github.com/apple/cups/blob/master/cups/auth.c#L105) cupsDoAuthentication returns 0 on success and -1 on error. The code was assuming the opposite

Now the CUPS password dialog is shown when needed. This is quite often, e.g directly at startup due to getServerSettings() so it might be worth checking if that's really necessary.

BUG: 408512

Test Plan

Open print-manager with a user that is not in a CUPS system group. Privileged operations work after entering a password

Diff Detail

Repository
R363 Print Manager
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
nicolasfella created this revision.Aug 24 2019, 4:25 PM
Restricted Application added a subscriber: kde-utils-devel. · View Herald TranscriptAug 24 2019, 4:25 PM
nicolasfella requested review of this revision.Aug 24 2019, 4:25 PM
dantti accepted this revision.Mar 12 2020, 1:32 PM

Looks Great To Me!

This revision is now accepted and ready to land.Mar 12 2020, 1:32 PM
ognarb added a subscriber: ognarb.Mar 12 2020, 3:05 PM
ognarb added inline comments.
libkcups/KCupsConnection.cpp
852

Can't you just use retrurn ret == 0;?

This revision was automatically updated to reflect the committed changes.
nicolasfella marked an inline comment as done.Mar 12 2020, 11:17 PM
nicolasfella added inline comments.
libkcups/KCupsConnection.cpp
852

Of course