]> The Tcpdump Group git mirrors - tcpdump/blobdiff - tcpdump.c
Give more details for --time-stamp-precision.
[tcpdump] / tcpdump.c
index 95b5ac0a10849da2ff898dabc46026ad374a76cd..d9f3e0fa96761fa993b0360fca4c53585c254d90 100644 (file)
--- a/tcpdump.c
+++ b/tcpdump.c
@@ -652,7 +652,7 @@ show_devices_and_exit (void)
 #define OPTION_VERSION 129
 #define OPTION_TSTAMP_PRECISION 130
 
-static struct option longopts[] = {
+static const struct option longopts[] = {
 #if defined(HAVE_PCAP_CREATE) || defined(WIN32)
        { "buffer-size", required_argument, NULL, 'B' },
 #endif
@@ -713,7 +713,10 @@ droproot(const char *username, const char *chroot_dir)
 #ifdef HAVE_CAP_NG_H
                int ret = capng_change_id(pw->pw_uid, pw->pw_gid, CAPNG_NO_FLAG);
                if (ret < 0) {
-                       printf("error : ret %d\n", ret);
+                       fprintf(stderr, "error : ret %d\n", ret);
+               }
+               else {
+                       printf("dropped privs to %s\n", username);
                }
                /* We don't need CAP_SETUID and CAP_SETGID */
                capng_update(CAPNG_DROP, CAPNG_EFFECTIVE, CAP_SETUID);
@@ -732,6 +735,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 {