From: Denis Ovsienko Date: Mon, 9 Feb 2015 01:21:51 +0000 (+0000) Subject: droproot(): always print to stderr (GH #425) X-Git-Tag: tcpdump-4.7.2~1^2~37 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/3f15ae25c25046b9ebdf8ab0283f2e6382a4df0e droproot(): always print to stderr (GH #425) Otherwise it interferes with the output of "tcpdump -w -". --- diff --git a/tcpdump.c b/tcpdump.c index b77b3081..e2f77aef 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -736,7 +736,7 @@ droproot(const char *username, const char *chroot_dir) fprintf(stderr, "error : ret %d\n", ret); } else { - printf("dropped privs to %s\n", username); + fprintf(stderr, "dropped privs to %s\n", username); } /* We don't need CAP_SETUID and CAP_SETGID */ capng_updatev( @@ -758,7 +758,7 @@ droproot(const char *username, const char *chroot_dir) exit(1); } else { - printf("dropped privs to %s\n", username); + fprintf(stderr, "dropped privs to %s\n", username); } #endif /* HAVE_CAP_NG_H */ }