OSDN Git Service

uuidd: Avoid closing the server socket when calling create_daemon()
authorTheodore Ts'o <tytso@mit.edu>
Mon, 29 Jun 2009 23:32:50 +0000 (19:32 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 29 Jun 2009 23:32:50 +0000 (19:32 -0400)
commit2842bb31880643f270e79622769def0f9b1fac59
tree0a83b473532c4a4232a48513de52ad66e997dfb6
parente8b9466fc9d4aec66476f1bc7a48436da02ab557
uuidd: Avoid closing the server socket when calling create_daemon()

In the event that file descriptors 0-2 are closed when uuidd is
started, the server socket could be created as a file descriptor that
will get closed when create_daemon() tries detaching the uuidd daemon
from its controlling tty.   Avoid this case by using dup(2).

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
misc/uuidd.c