diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-07-14 18:33:21 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-07-14 18:33:21 +0000 |
commit | 2df666ab6946c86d6f646d4417a3bbd60f66cafc (patch) | |
tree | 7b237a9a815ebecee5a81581d64c132cdb4d7b2e /sbin/ifconfig/ifconfig.c | |
parent | 7d7962bcb4d05f4d0a962e25d0b68318c03f4ecd (diff) | |
download | FreeBSD-src-2df666ab6946c86d6f646d4417a3bbd60f66cafc.zip FreeBSD-src-2df666ab6946c86d6f646d4417a3bbd60f66cafc.tar.gz |
Add a new flag '-k' to ifconfig(8), indicating that it is alright to
print potentially sensitive keying material to stdout. With the new
802.11 support, ifconfig(8) is now capable of printing 802.11 keys,
and did by default for the root user, which is undesirable in some
environments. Now it will not print keying material unless requested
(and available to the user).
MFC after: 1 week
Diffstat (limited to 'sbin/ifconfig/ifconfig.c')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 40e6787..3f4fe71 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -91,6 +91,7 @@ int newaddr = 1; int verbose; int supmedia = 0; +int printkeys = 0; /* Print keying material for interfaces. */ int printname = 0; /* Print the name of the created interface. */ static int ifconfig(int argc, char *const *argv, const struct afswtch *afp); @@ -156,7 +157,7 @@ main(int argc, char *argv[]) all = downonly = uponly = namesonly = verbose = 0; /* Parse leading line options */ - strlcpy(options, "adlmuv", sizeof(options)); + strlcpy(options, "adklmuv", sizeof(options)); for (p = opts; p != NULL; p = p->next) strlcat(options, p->opt, sizeof(options)); while ((c = getopt(argc, argv, options)) != -1) { @@ -167,6 +168,9 @@ main(int argc, char *argv[]) case 'd': /* restrict scan to "down" interfaces */ downonly++; break; + case 'k': + printkeys++; + break; case 'l': /* scan interface names only */ namesonly++; break; |