lib: simplify daemon_become_new_user__()
authorAndy Zhou <azhou@nicira.com>
Sat, 10 Oct 2015 01:48:59 +0000 (18:48 -0700)
committerAndy Zhou <azhou@nicira.com>
Thu, 12 Nov 2015 02:05:44 +0000 (18:05 -0800)
commit6069edb0ea9c861d32016473a86d330f5ce60123
treeeda86c3a357897ad234e0ffd8bc7104046e14c26
parentc4e34c6114bcf4cf9248fe910ae8f202b6293f40
lib: simplify daemon_become_new_user__()

A global variable 'switch_user' was used to make sure
we switch process's current user only once. This logic is now
simplified by testing for uid directly; if switch process has
taken place, the current uid will be not be zero.

Signed-off-by: Andy Zhou <azhou@nicira.com>
Acked-by: Ansis Atteka <aatteka@nicira.com>
lib/daemon-unix.c
lib/daemon.man