Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/sockstat undo previous, now sockstat works without p...



details:   https://anonhg.NetBSD.org/src/rev/3cd448339b15
branches:  trunk
changeset: 975318:3cd448339b15
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Aug 26 22:57:55 2020 +0000

description:
undo previous, now sockstat works without privs

diffstat:

 usr.bin/sockstat/Makefile   |  5 +----
 usr.bin/sockstat/sockstat.c |  9 ++-------
 2 files changed, 3 insertions(+), 11 deletions(-)

diffs (46 lines):

diff -r cc75a8ccd712 -r 3cd448339b15 usr.bin/sockstat/Makefile
--- a/usr.bin/sockstat/Makefile Wed Aug 26 22:56:55 2020 +0000
+++ b/usr.bin/sockstat/Makefile Wed Aug 26 22:57:55 2020 +0000
@@ -1,11 +1,8 @@
-#      $NetBSD: Makefile,v 1.6 2020/08/25 16:39:16 christos Exp $
+#      $NetBSD: Makefile,v 1.7 2020/08/26 22:57:55 christos Exp $
 
 .include <bsd.own.mk>
 
 RUMPPRG=       sockstat
-BINGRP= kmem
-BINMODE=2555
-USE_FORT?= yes # setgid
 
 .PATH:  ${.CURDIR}/../../lib/libc/gen
 CPPFLAGS+= -DRUMP_ACTION
diff -r cc75a8ccd712 -r 3cd448339b15 usr.bin/sockstat/sockstat.c
--- a/usr.bin/sockstat/sockstat.c       Wed Aug 26 22:56:55 2020 +0000
+++ b/usr.bin/sockstat/sockstat.c       Wed Aug 26 22:57:55 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sockstat.c,v 1.22 2020/08/25 14:05:17 christos Exp $ */
+/*     $NetBSD: sockstat.c,v 1.23 2020/08/26 22:57:55 christos Exp $ */
 
 /*
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: sockstat.c,v 1.22 2020/08/25 14:05:17 christos Exp $");
+__RCSID("$NetBSD: sockstat.c,v 1.23 2020/08/26 22:57:55 christos Exp $");
 #endif
 
 #define _KMEMUSER
@@ -179,11 +179,6 @@
        if (prog_init && prog_init() == -1)
                err(1, "init");
 
-       /* Not used, but we set the PK_KMEM flag like this */
-       int fd = open("/dev/mem", O_RDONLY);
-       if (fd == -1)
-               err(EXIT_FAILURE, "Can't open `/dev/mem'");
-       close(fd);
        if ((portmap != NULL) && (pf_list == 0)) {
                pf_list = PF_LIST_INET;
 #ifdef INET6



Home | Main Index | Thread Index | Old Index