summaryrefslogtreecommitdiffstats
path: root/usr.bin/netstat/main.c
diff options
context:
space:
mode:
authorlum <lum@openbsd.org>2010-06-30 03:32:55 +0000
committerlum <lum@openbsd.org>2010-06-30 03:32:55 +0000
commit548ad328a32b5a1a64430f0c5089d4a2d8a22a3a (patch)
treedd5ae4e1d1becae91f95a196d5d9361c72e08204 /usr.bin/netstat/main.c
parentValidate that all attributes are allowed by any of its object classes. (diff)
downloadwireguard-openbsd-548ad328a32b5a1a64430f0c5089d4a2d8a22a3a.tar.xz
wireguard-openbsd-548ad328a32b5a1a64430f0c5089d4a2d8a22a3a.zip
Make deprecated command line argument for extracting
name list work properly. ok deraadt@ millert@
Diffstat (limited to 'usr.bin/netstat/main.c')
-rw-r--r--usr.bin/netstat/main.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/usr.bin/netstat/main.c b/usr.bin/netstat/main.c
index 72d4afc3f52..204e58ce0d3 100644
--- a/usr.bin/netstat/main.c
+++ b/usr.bin/netstat/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.83 2010/06/29 03:09:29 blambert Exp $ */
+/* $OpenBSD: main.c,v 1.84 2010/06/30 03:32:55 lum Exp $ */
/* $NetBSD: main.c,v 1.9 1996/05/07 02:55:02 thorpej Exp $ */
/*
@@ -306,6 +306,24 @@ main(int argc, char *argv[])
exit(0);
}
+#define BACKWARD_COMPATIBILITY
+#ifdef BACKWARD_COMPATIBILITY
+ if (*argv) {
+ if (isdigit(**argv)) {
+ interval = atoi(*argv);
+ if (interval <= 0)
+ usage();
+ ++argv;
+ iflag = 1;
+ }
+ if (*argv) {
+ nlistf = *argv;
+ if (*++argv)
+ memf = *argv;
+ }
+ }
+#endif
+
/*
* Discard setgid privileges if not the running kernel so that bad
* guys can't print interesting stuff from kernel memory.
@@ -326,24 +344,6 @@ main(int argc, char *argv[])
if (setresgid(gid, gid, gid) == -1)
err(1, "setresgid");
-#define BACKWARD_COMPATIBILITY
-#ifdef BACKWARD_COMPATIBILITY
- if (*argv) {
- if (isdigit(**argv)) {
- interval = atoi(*argv);
- if (interval <= 0)
- usage();
- ++argv;
- iflag = 1;
- }
- if (*argv) {
- nlistf = *argv;
- if (*++argv)
- memf = *argv;
- }
- }
-#endif
-
if (kvm_nlist(kvmd, nl) < 0 || nl[0].n_type == 0) {
if (nlistf)
fprintf(stderr, "%s: %s: no namelist\n", __progname,