]> granicus.if.org Git - shadow/commit
Fixed signal races in shadow tools.
authorTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 2 Jul 2016 16:11:09 +0000 (18:11 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Sat, 2 Jul 2016 16:11:09 +0000 (18:11 +0200)
commitdd50014055a36969153e83cf3675d9559fa6a200
tree1298e69d9ea372445c84bc1ee3fb34f11879b039
parenta4dee3d1ad4162142b5ea50e11781e5a3356c072
Fixed signal races in shadow tools.

Some of the supplied tools use functions which are not signal-safe.

Most of the times it's exit() vs. _exit().

In other times it's how the standard output or standard error is
handled. FILE-related functions shall be avoided, therefore I replaced
them with write().

Also there is no need to call closelog(). At worst, it allows to
trigger a deadlock by issuing different signal types at bad timings.
But as these fixes are about race conditions, expect bad timings in
general for these bugs to be triggered. :)
src/expiry.c
src/gpasswd.c
src/login.c
src/su.c
src/sulogin.c