Hopefully the last change to the setuid code.  Only call initgroups() if getuid() == 0.  Don't call ns_os_changeuser() more than once (it could happen on Linux).
Hopefully the last change to the setuid code.  Only call initgroups()
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.

each/bind9-collab,each/bind9-collab,each/bind9-collab,pecharmin/bind9,pecharmin/bind9,pecharmin/bind9,pecharmin/bind9,each/bind9-collab,pecharmin/bind9,pecharmin/bind9,each/bind9-collab,each/bind9-collab