[PATCH 0/2] sulogin: fixing Control-D and --timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I recently discovered that sulogin in Debian stretch didn't time out,
and even was unresponsive to EOF after the failed timeout.  This was
reported as Debian bugs:

 https://bugs.debian.org/846107
 https://bugs.debian.org/846112

since I assumed it was a problem with the Debian migration to
util-linux sulogin.

But then I checked the upstream repo and was surprised to find the
same bugs there...  I don't know how these have crept in, or how to
properly fix them.  But from looking at the code, it is pretty clear
that getpasswd() must return NULL if the main program is supposed to
exit.  It is also clear that getpasswd() must return immediately if
the read() is interrupted by a SIGALRM, without waiting for any
further keypress.

I do not know if pressing any key is supposed to reset the alarm, but
it if is then I believe that should be done with an explicit alarm()
on every keypress.

So here are two basic oneline fixes for these issues. The testing
state is: Works for me.


Note that I tried to be consistent with the existing code, using
(char *)0 instead of NULL.  It looks odd, but...



Bjørn Mork (2):
  sulogin: make --timeout actually time out
  sulogin: make Control-D break out of the main loop

 login-utils/sulogin.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.10.2

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux