]> git.ipfire.org Git - thirdparty/bind9.git/commit
Don't change effective uid when we already dropped privileges
authorOndřej Surý <ondrej@isc.org>
Mon, 27 Apr 2020 13:58:45 +0000 (15:58 +0200)
committerOndřej Surý <ondrej@sury.org>
Tue, 28 Apr 2020 15:31:26 +0000 (17:31 +0200)
commit89ad4912e95f8a003d1f8737430f1ad3aeb3f01a
tree2c8ffa891fdd3ed2b82599a8a2230e1daec54b67
parent126c9d94cf62410e14ee1487452a698fbff9ecc8
Don't change effective uid when we already dropped privileges

When running on Linux and system capabilities are available, named will
drop the extra capabilities before loading the configuration.  This led
to spurious warnings from `seteuid()` because named already dropped
CAP_SETUID and CAP_GETUID capabilities.

The fix removes setting the effective uid/gid when capabilities are
available, and adds a check that we are running under the user we were
requested to run.

(cherry picked from commit 6c82e2af92c741b52585e67054a67862211875b0)
bin/named/unix/os.c