diff options
author | 2018-12-31 14:25:00 +0000 | |
---|---|---|
committer | 2018-12-31 14:25:00 +0000 | |
commit | 446b5bda9172e4a20975f6b3064e462e1e213d10 (patch) | |
tree | 58b9069705daa6f66b57a5a50585ab7a8f1f50c1 | |
parent | If there is an invalid character in the uuencoded stream, uudecode(1) (diff) | |
download | wireguard-openbsd-446b5bda9172e4a20975f6b3064e462e1e213d10.tar.xz wireguard-openbsd-446b5bda9172e4a20975f6b3064e462e1e213d10.zip |
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; |