Skip to content
  • Brian Wellington's avatar
    Hopefully the last change to the setuid code. Only call initgroups() · c336121f
    Brian Wellington authored
    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.
    c336121f