]> The Tcpdump Group git mirrors - tcpdump/commitdiff
droproot(): always print to stderr (GH #425)
authorDenis Ovsienko <[email protected]>
Mon, 9 Feb 2015 01:21:51 +0000 (01:21 +0000)
committerDenis Ovsienko <[email protected]>
Mon, 9 Feb 2015 01:40:23 +0000 (01:40 +0000)
Otherwise it interferes with the output of "tcpdump -w -".

tcpdump.c

index b77b30818625a01fc555221e084d0e07bd5aa6bc..e2f77aefaae4d6893995d1af4d46f15c383624d6 100644 (file)
--- 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 */
        }