diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 16:18:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-26 16:18:39 +0000 |
commit | 5242eef8fc54636a41701fd9d7083ba6e4a4e0b3 (patch) | |
tree | e6a0980092957865a937cc0f34446df3d5194e99 /src/check_subid_range.c | |
parent | Releasing progress-linux version 1:4.13+dfsg1-5~progress7.99u1. (diff) | |
download | shadow-5242eef8fc54636a41701fd9d7083ba6e4a4e0b3.tar.xz shadow-5242eef8fc54636a41701fd9d7083ba6e4a4e0b3.zip |
Merging upstream version 1:4.15.2.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/check_subid_range.c')
-rw-r--r-- | src/check_subid_range.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/check_subid_range.c b/src/check_subid_range.c index 38703b6..68266f5 100644 --- a/src/check_subid_range.c +++ b/src/check_subid_range.c @@ -12,20 +12,21 @@ #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> + +#include "atoi/str2i.h" #include "defines.h" #include "prototypes.h" #include "subordinateio.h" #include "idmapping.h" #include "shadowlog.h" -const char *Prog; +static const char Prog[] = "check_subid_range"; int main(int argc, char **argv) { char *owner; unsigned long start, count; bool check_uids; - Prog = Basename (argv[0]); log_set_progname(Prog); log_set_logfd(stderr); @@ -34,11 +35,10 @@ int main(int argc, char **argv) owner = argv[1]; check_uids = argv[2][0] == 'u'; - start = strtoul(argv[3], NULL, 10); - if (start == ULONG_MAX && errno == ERANGE) + errno = 0; + if (str2ul(&start, argv[3]) == -1) exit(1); - count = strtoul(argv[4], NULL, 10); - if (count == ULONG_MAX && errno == ERANGE) + if (str2ul(&count, argv[4]) == -1) exit(1); if (check_uids) { if (have_sub_uids(owner, start, count)) |