summaryrefslogtreecommitdiffstats
path: root/pw/pw.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2015-07-28 12:20:57 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2015-07-28 12:20:57 +0000
commitbbb9b6125f26fff5ecf0b96aefc7a3bbdfea91cb (patch)
tree25ae03df4409d87133f5b110510cabcb7f4020f5 /pw/pw.c
parent0c5493f59d93a71f8aba80245084182c94c22f53 (diff)
downloadpw-darwin-bbb9b6125f26fff5ecf0b96aefc7a3bbdfea91cb.tar.gz
pw-darwin-bbb9b6125f26fff5ecf0b96aefc7a3bbdfea91cb.tar.zst
pw-darwin-bbb9b6125f26fff5ecf0b96aefc7a3bbdfea91cb.zip
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 'pw/pw.c')
-rw-r--r--pw/pw.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/pw/pw.c b/pw/pw.c
index 5ad2511..3db427a 100644
--- a/pw/pw.c
+++ b/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)