[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-bugs-dist
Subject:    [kdm] [Bug 312947] KDM never returns from the console login mode
From:       =?UTF-8?Q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B5=D0=B9=20=D0=A8=D0=B8=D0=BB=D0=B8=
Date:       2013-02-25 18:35:47
Message-ID: bug-312947-17878-M5H0W9VldV () http ! bugs ! kde ! org/
[Download RAW message or body]

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

--- Comment #2 from Алексей Шилин <rootlexx@mail.ru> ---
(In reply to comment #1)
> i'm not sure how to fix this. the easiest is just keeping a delta between
> the monotonic and the wall clock and applying it to ut_time. of course this
> is subject to the time jump problem which using the monotonic clock
> addresses in the first place. though i guess the worst that can happen is
> that we immediately return to the graphical login (provided we cap underflow
> and times in the future).

I don't think, that there is a way to fix the time jump problem completely,
while the utmp database keeps using a real clock time, and these timestamps are
being used to calculate timeouts.
Simply applying delta won't fix it too. Here is a possible scenario.
1. A user logs out.
2. A timestamp is being written to the utmp database.
3. The real clock time changes to the past. The timestamp is in the future now.
4. KDM calculates new (smaller) delta and applies it to the old (before time
change) utmp timestamp.
There is, however, a possible solution, although not ideal: if ut->ut_time >
now, then use current now value instead of the timestamp. This change will make
console login timeouts a bit volatile, but will limit the consequences of the
bug a lot.
However, it will require a way to save state to prevent assigning a new now
value every time. This can be implemented with an array of structs like {
time_t ut_time, used_time; }, bijectively mapped to consoleTTYs values, like
shown below.
---------- >8 ----------
if (ut->ut_time != $struct.ut_time) {
  $struct.ut_time = ut->ut_time;
  $struct.used_time =  ut->ut_time - delta > now ? now : ut->ut_time - delta;
}
utp->time = $struct.used_time;
---------- 8< ----------

-- 
You are receiving this mail because:
You are watching all bug changes.=
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic