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 b77b308..e2f77ae 100644
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -736,7 +736,7 @@
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 @@
exit(1);
}
else {
- printf("dropped privs to %s\n", username);
+ fprintf(stderr, "dropped privs to %s\n", username);
}
#endif /* HAVE_CAP_NG_H */
}