https://bugs.kde.org/show_bug.cgi?id=397125

--- Comment #4 from Michael Weghorn <m.wegh...@posteo.de> ---
(In reply to Steven De Herdt from comment #3)
> How can we detect when a password is required for a remote server?  Is that
> only through the KCupsConnection in ChooseUri.cpp:122, or am I mistaken?

I have investigated this a bit and as far as I understand the relevant code is
in KCupsConnection.cpp:

1) A callback function is set using

    cupsSetPasswordCB2(password_cb, m_passwordDialog);

s.a. the CUPS programming manual for that function:
https://www.cups.org/doc/cupspm.html#cupsSetPasswordCB2

2) With this callback function set, CUPS calls this function 'password_cb' also
defined in 'KCupsConnection.cpp' whenever authentication is required, and that
function shows the dialog in question.

I have created a demo change that shows how the prompt can be adapted:
https://paste.kde.org/pqwlthsjx

This just uses the prompt as directly passed via CUPS to the callback function,
but further information can probably retrieved from the other parameters to the
callback function as needed. (In my sample setup, this would show "Password for
myuser on 192.168.122.238?" as the prompt text.)

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to