if getuid() == 0. Don't call ns_os_changeuser() more than once (it
could happen on Linux).
The code in its current form doesn't check for root before calling
setgid() or setuid(), since they'll fail and print reasonable error
messages (unless -u is supplied with the non-root user that ran named,
in which case it would succeed). The call to initgroups() would fail for
non root, so it shouldn't be tried.
The previous (as of a few days ago) code just ignored the -u parameter
when named was run as non-root. This was not good.
root directory, so the administrator does not need to
keep a copy of the user and group databases in the
chroot'ed environment. Suggested by Hakan Olsson.
Cleanup of redundant/useless header file inclusion.
ISC style lint, primarily for function declarations and standalone
comments -- ie, those that appear on a line without any code, which
should be written as follows:
/*
* This is a comment.
*/
included, we get conflicts between <string.h> and <linux/string.h> that
make the compilation fail. This change also eliminates compiler warnings when
os.c is compiled on a system with a 2.2 <linux/capability.h>.