]> granicus.if.org Git - sudo/commit
Add atoid() function to convert a string to an id_t (uid, gid or
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 7 Aug 2013 17:23:19 +0000 (11:23 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 7 Aug 2013 17:23:19 +0000 (11:23 -0600)
commit5dc56ea81de2805cbf4f485e53956a51c3657982
tree8cef6e47d9623b1e764347fcbc2274a70e117696
parent972ee9a0fb1c61d82effcc468586b82f6afe650e
Add atoid() function to convert a string to an id_t (uid, gid or
pid).  We have to be careful to choose() either strtol() or strtoul()
depending on whether the string appears to be signed or unsigned.
Always using strtoul() is unsafe on 64-bit platforms since the
uid might be represented as a negative number and (unsigned long)-1
on a 64-bit system is 0xffffffffffffffff not 0xffffffff.
Fixes a problem with uids larger than 0x7fffffff on 32-bit platforms.
MANIFEST
config.h.in
configure
configure.in
plugins/sudoers/Makefile.in
plugins/sudoers/policy.c
plugins/sudoers/sudoers.h