git: pw_scan: remove checks for (u|g)ids > USHRT_MAX.

Sascha Wildner swildner at crater.dragonflybsd.org
Wed Jun 9 07:43:45 PDT 2021


commit 8f13a1c5481b54b10c81c0fb1c1f2b46f93cd643
Author: Dan Cross <cross at gajendra.net>
Date:   Fri May 21 15:09:40 2021 +0000

    pw_scan: remove checks for (u|g)ids > USHRT_MAX.
    
    Remove the check and simplify the logic for checking
    UID/GID validity in `pw_scan()` by calling `strtonum`
    instead of `strtoul`.
    
    I ran into this because I use a non-default UID/GID
    numbering scheme where both are typically greater
    than 2^16 for normal users.  The width of UIDs has
    been 32 bits since before 4.4BSD in 1994, almost 27
    years ago; if larger UIDs were going to show up as
    a problem it would have already happened.
    
    Signed-off-by: Dan Cross <cross at gajendra.net>

Summary of changes:
 lib/libc/gen/pw_scan.c       | 52 ++++++++++----------------------------------
 usr.bin/chpass/chpass.1      |  8 +------
 usr.sbin/pwd_mkdb/pwd_mkdb.8 | 11 +---------
 usr.sbin/vipw/vipw.8         |  8 ++-----
 4 files changed, 15 insertions(+), 64 deletions(-)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/8f13a1c5481b54b10c81c0fb1c1f2b46f93cd643


-- 
DragonFly BSD source repository



More information about the Commits mailing list