diff --git a/docs/changes.txt b/docs/changes.txt index 7ab30ade..d8d88200 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -464,3 +464,4 @@ v70.4 nfqws,tpws: ^ prefix in hostlist to disable subdomain matches nfqws,tpws: optional systemd notify support. compile using 'make systemd' nfqws,tpws: systemd instance templates for nfqws and tpws +nfqws,tpws: separate droproot from dropcaps diff --git a/nfq/nfqws.c b/nfq/nfqws.c index bd6e8b9d..b469fe11 100644 --- a/nfq/nfqws.c +++ b/nfq/nfqws.c @@ -293,7 +293,7 @@ static int nfq_main(void) ssize_t rd; sec_harden(); - if (params.droproot && !droproot(params.uid, params.gid)) + if (params.droproot && !droproot(params.uid, params.gid) || !dropcaps()) return 1; print_id(); if (params.droproot && !test_list_files()) diff --git a/nfq/sec.c b/nfq/sec.c index 71ba1c75..4fabd16a 100644 --- a/nfq/sec.c +++ b/nfq/sec.c @@ -287,7 +287,7 @@ bool can_drop_root(void) { #ifdef __linux__ // has some caps - return checkpcap((1<