diff options
author | bluhm <bluhm@openbsd.org> | 2016-03-22 00:06:55 +0000 |
---|---|---|
committer | bluhm <bluhm@openbsd.org> | 2016-03-22 00:06:55 +0000 |
commit | fe266b8dbb140fb7855a7f892731e868a51d6828 (patch) | |
tree | 77bfd26118e27a6801cb8c706fa0613979b7300c /usr.sbin/tokenadm | |
parent | System call sendsyslog2 is gone, adapt tests. (diff) | |
download | wireguard-openbsd-fe266b8dbb140fb7855a7f892731e868a51d6828.tar.xz wireguard-openbsd-fe266b8dbb140fb7855a7f892731e868a51d6828.zip |
tokenadm(8) is already pledged, do the same for tokeninit(8).
- bring comment in both programms in line
- tokeninit(8) needs "tty" for readpassphrase(3)
- call token_init() after pledge(2)
- fix whitespace
OK millert@
Diffstat (limited to 'usr.sbin/tokenadm')
-rw-r--r-- | usr.sbin/tokenadm/tokenadm.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/tokenadm/tokenadm.c b/usr.sbin/tokenadm/tokenadm.c index b9ce29e0758..d5cb514f566 100644 --- a/usr.sbin/tokenadm/tokenadm.c +++ b/usr.sbin/tokenadm/tokenadm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tokenadm.c,v 1.11 2015/12/30 12:27:18 mestre Exp $ */ +/* $OpenBSD: tokenadm.c,v 1.12 2016/03/22 00:06:55 bluhm Exp $ */ /*- * Copyright (c) 1995 Migration Associates Corp. All Rights Reserved @@ -88,11 +88,6 @@ main(int argc, char **argv) openlog(NULL, LOG_ODELAY, LOG_AUTH); - if (token_init(argv[0]) < 0) { - syslog(LOG_ERR, "unknown token type"); - errx(1, "unknown token type"); - } - /* * Make sure we never dump core as we might have a * valid user shared-secret in memory. @@ -106,6 +101,11 @@ main(int argc, char **argv) if (pledge("stdio rpath wpath cpath fattr flock getpw", NULL) == -1) err(1, "pledge"); + if (token_init(argv[0]) < 0) { + syslog(LOG_ERR, "unknown token type"); + errx(1, "unknown token type"); + } + while ((c = getopt(argc, argv, "BDERT1dem:r")) != -1) switch (c) { case 'B': |