diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2018-12-31 14:25:01 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2018-12-31 14:25:01 +0000 |
commit | 9ff98d5993340c37727299a2e4edac7241422679 (patch) | |
tree | cf52a086c4e8d47fe9f8087e7f0d3db8386ed624 | |
parent | a7b02dad2ffe9edfbbb8e14f89f13c7184f0355e (diff) |
A bad uid range on the command line should be a fatal error.
Based on a diff from Stefan R. Filipek.
-rw-r--r-- | usr.sbin/user/user.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/user/user.c b/usr.sbin/user/user.c index 451e6041e13..c6ad407c22c 100644 --- a/usr.sbin/user/user.c +++ b/usr.sbin/user/user.c @@ -1,4 +1,4 @@ -/* $OpenBSD: user.c,v 1.123 2018/10/15 18:27:27 millert Exp $ */ +/* $OpenBSD: user.c,v 1.124 2018/12/31 14:25:00 millert Exp $ */ /* $NetBSD: user.c,v 1.69 2003/04/14 17:40:07 agc Exp $ */ /* @@ -724,7 +724,7 @@ save_range(user_t *up, char *cp) up->u_rc += 1; } } else { - warnx("Bad range `%s'", cp); + warnx("Bad uid range `%s'", cp); return 0; } return 1; @@ -1848,7 +1848,8 @@ useradd(int argc, char **argv) break; case 'r': defaultfield = 1; - (void) save_range(&u, optarg); + if (!save_range(&u, optarg)) + exit(EXIT_FAILURE); break; case 's': defaultfield = 1; |