summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pw/pw.c
diff options
context:
space:
mode:
authorbapt <bapt@FreeBSD.org>2015-07-28 12:20:57 +0000
committerbapt <bapt@FreeBSD.org>2015-07-28 12:20:57 +0000
commit6a2604d87526baf5ee286d62d014c0afee6f8e9d (patch)
treece68798916e85bee61335b14a69c8e9ece61478f /usr.sbin/pw/pw.c
parent708e81ab605491cabb2679145103182543685426 (diff)
downloadFreeBSD-src-6a2604d87526baf5ee286d62d014c0afee6f8e9d.zip
FreeBSD-src-6a2604d87526baf5ee286d62d014c0afee6f8e9d.tar.gz
when -n is passed to any pw subcommand it is always expected to be considered as
a name so do not try to convert it to an id if it is a numeric value PR: 31933 Reported by: ted@impulse.net Sponsored by: gandi.net
Diffstat (limited to 'usr.sbin/pw/pw.c')
-rw-r--r--usr.sbin/pw/pw.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/usr.sbin/pw/pw.c b/usr.sbin/pw/pw.c
index 5ad2511..3db427a 100644
--- a/usr.sbin/pw/pw.c
+++ b/usr.sbin/pw/pw.c
@@ -287,14 +287,7 @@ main(int argc, char *argv[])
errstr);
break;
case 'n':
- if (strspn(optarg, "0123456789") != strlen(optarg)) {
- name = optarg;
- break;
- }
- id = strtonum(optarg, 0, LONG_MAX, &errstr);
- if (errstr != NULL)
- errx(EX_USAGE, "Bad id '%s': %s", optarg,
- errstr);
+ name = optarg;
break;
case 'H':
if (conf.fd != -1)
OpenPOWER on IntegriCloud