#include <sys/stat.h>
#include <fcntl.h>
+#include "atoi/getnum.h"
#include "atoi/str2i.h"
#include "defines.h"
#include "prototypes.h"
#include "idmapping.h"
#include "shadowlog.h"
+
static const char Prog[] = "check_subid_range";
-int main(int argc, char **argv)
+
+int
+main(int argc, char **argv)
{
- char *owner;
- unsigned long start, count;
- bool check_uids;
+ bool check_uids;
+ char *owner;
+ uid_t start;
+ unsigned long count;
+
log_set_progname(Prog);
log_set_logfd(stderr);
owner = argv[1];
check_uids = argv[2][0] == 'u';
errno = 0;
- if (str2ul(&start, argv[3]) == -1)
+ if (get_uid(argv[3], &start) == -1)
exit(1);
if (str2ul(&count, argv[4]) == -1)
exit(1);
#include <stdio.h>
-#include "atoi/str2i.h"
+#include "atoi/getnum.h"
#include "subid.h"
#include "stdlib.h"
#include "prototypes.h"
usage();
}
if (argc == 3 && strcmp(argv[1], "-g") == 0) {
- str2i(uid_t, &u, argv[2]);
+ get_uid(argv[2], &u);
n = subid_get_gid_owners(u, &uids);
} else if (argc == 2 && strcmp(argv[1], "-h") == 0) {
usage();
} else {
- str2i(uid_t, &u, argv[1]);
+ get_gid(argv[1], &u);
n = subid_get_uid_owners(u, &uids);
}
if (n < 0) {