From: Wesley Shields Date: Fri, 16 May 2014 14:32:55 +0000 (-0400) Subject: Make droproot say something when successful. X-Git-Tag: tcpdump-4.6.0~12 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/923919d11485eee7dc9118ebca7e6ca91aea2907 Make droproot say something when successful. 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. --- diff --git a/tcpdump.c b/tcpdump.c index a2bd5a6d..fc15b423 100644 --- 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 {