]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Merge pull request #812 from martinwilli/root-user
authorfxlb <[email protected]>
Thu, 24 Aug 2023 01:11:43 +0000 (01:11 +0000)
committerGitHub <[email protected]>
Thu, 24 Aug 2023 01:11:43 +0000 (01:11 +0000)
Skip privilege dropping when using -Z root on --with-user builds

tcpdump.c

index b5893eba86f9467260101bfe1dde18cd8cc6c770..3474396646c056e786b4a355a46077749e2431f7 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -2078,6 +2078,8 @@ main(int argc, char **argv)
                /* Run with '-Z root' to restore old behaviour */
                if (!username)
                        username = WITH_USER;
+               else if (strcmp(username, "root") == 0)
+                       username = NULL;
        }
 #endif