Comment 9 for bug 72545

Revision history for this message
kko (kko) wrote :

I will concisely document here my reasoning.

In essence, 'kdesu' needs two instances of 'sudo', and each 'sudo' needs a terminal (tty) or, in this case, a pseudo-terminal (pts). This is because '/etc/sudoers' defines that we are using "tty_tickets", i.e. that for each tty or pts we need to input the password separately.

Now, on a clean boot (that has removed all sudo tickets), if we open Konsole, do 'sudo foo' and input the password, we get a verified sudo ticket for pts/1. If we then close the Konsole, we free the pseudo-terminal.

When we after this invoke kdesu (which in turn invokes processes of kdesu_stub and sudo), the processes involved will use the first two available pseudo-terminals, 1 and 2. Now, pts/1 has a valid sudo ticket, and pts/2 doesn't, which confuses 'kdesu' and causes this bug.

(This explanation assumes that we have no other processes occupying a pts. The numbers of the pts's are not important, however, as this is perfectly reproducible even with other pairs of pts's. The only condition that needs to be met is that we have a valid sudo ticket for the first pts used by 'kdesu' and we don't have one for the second.)