Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/bsd/tcpdump/dist When running as root and wanting t...



details:   https://anonhg.NetBSD.org/src/rev/d9cf52f78baf
branches:  trunk
changeset: 329187:d9cf52f78baf
user:      christos <christos%NetBSD.org@localhost>
date:      Tue May 13 20:29:59 2014 +0000

description:
When running as root and wanting to write a file and not having CAPNG, don't
drop privs, because we cannot open the file if we drop privs.

diffstat:

 external/bsd/tcpdump/dist/tcpdump.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 669f4f9da7ab -r d9cf52f78baf external/bsd/tcpdump/dist/tcpdump.c
--- a/external/bsd/tcpdump/dist/tcpdump.c       Tue May 13 20:06:41 2014 +0000
+++ b/external/bsd/tcpdump/dist/tcpdump.c       Tue May 13 20:29:59 2014 +0000
@@ -34,7 +34,7 @@
 static const char rcsid[] _U_ =
     "@(#) Header: /tcpdump/master/tcpdump/tcpdump.c,v 1.283 2008-09-25 21:45:50 guy Exp  (LBL)";
 #else
-__RCSID("$NetBSD: tcpdump.c,v 1.7 2013/12/31 17:33:31 christos Exp $");
+__RCSID("$NetBSD: tcpdump.c,v 1.8 2014/05/13 20:29:59 christos Exp $");
 #endif
 #endif
 
@@ -1482,8 +1482,12 @@
 #endif /* HAVE_CAP_NG_H */
 
        if (getuid() == 0 || geteuid() == 0) {
-               if (username || chroot_dir)
+               if (username || chroot_dir) {
+#ifndef HAVE_CAP_NG_H
+                       if (!WFileName)
+#endif
                        droproot(username, chroot_dir);
+               }
 
        }
 #endif /* WIN32 */



Home | Main Index | Thread Index | Old Index