3 The idea is that whenever the user is queried for a password this
4 login/pw combination gets a seq-nr. When a slave needs a login/pw
5 it asks kpasswdserver and sends along the last seqnr it received. If
6 this seqnr is older (lower) than the seq nr of the login/pw
7 combination stored in kpasswdserver then appearantly the user has
8 already been prompted for a new login/pw combination since the last
9 time this slave asked for a login/pw and therefor it is not necessary
10 to prompt the user again but kpassword will send the io-slave this
11 new login/pw combination. If this new combination fails as well the
12 user is being prompted for a new login/pw combo since the one stored
13 in kpasswdserver doesn't work.
15 Let me try to draw the situation I had in mind when writing this:
17 Slave1 Slave2 kpasswdserver
19 asks user for login/pw (1)
20 sends login/pw (1) to ftp site
22 sends back login/pw (1)
23 sends login/pw (1) to ftp site
28 asks user for new login/pw (2)
29 sends login/pw (2) to ftp site
34 don't ask user for new login/pw
35 but send back login/pw (2) without asking
36 sends login/pw (2) to ftp site
39 Actually, I had mostly http in mind, and not so much ftp. In http you
40 typically try without password first, and only when you get an
41 authentication error you ask for a password. The above scenario is
42 then suddenly a lot more common than with ftp because it can happen
43 that you have 4 requests /io-slaves who alll discover at about the
44 same time that they need to have authentication credentials. The
45 above scenario (and the seq. nrs) is to prevent that you get 4 login
48 Now the assumption in this all, looking back on it, seems to be that
49 when you ask for the same auth credentials twice in a row, it must be
50 that the credentials issued the first time where wrong, and you will
51 be prompted again. But if the user goes to ftp-site1, then
52 ftp-site2 and then back to ftp-site1 again, the credentials for ftp-site1
53 are still valid. This is why we reset the seq.nr stored in the io-slave
54 to 0 whenever the io-slave switches hosts (or logins).
56 Waldo Bastian <bastian@kde.org>