]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Make droproot say something when successful.
authorWesley Shields <[email protected]>
Fri, 16 May 2014 14:32:55 +0000 (10:32 -0400)
committerDenis Ovsienko <[email protected]>
Sun, 15 Jun 2014 18:09:39 +0000 (22:09 +0400)
I've seen people run into situations where they were using a command like this:

tcpdump -i eth0 -G 500 -w /root/%H%M%S.pcap

The first file would be created successfully but the second file would not
because their version of tcpdump was dropping privs. It was unclear to them
that this was going on and was causing confusion.

At least with this message in there it should become more evident that
privs are being altered and aid in debugging these kinds of problems.

tcpdump.c

index a2bd5a6da9f397f47b3c53cd23cc5a5f71183866..fc15b42367fa280f5d687832094dedf5f967b378 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -730,6 +730,9 @@ droproot(const char *username, const char *chroot_dir)
                            pcap_strerror(errno));
                        exit(1);
                }
+               else {
+                       printf("dropped privs to %s\n", username);
+               }
 #endif /* HAVE_CAP_NG_H */
        }
        else {