src/: Use get_[ug]id() where appropriate
Reviewed-by: "Serge E. Hallyn" <serge@hallyn.com> Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
+11
-5
@@ -13,6 +13,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "atoi/getnum.h"
|
||||
#include "atoi/str2i.h"
|
||||
#include "defines.h"
|
||||
#include "prototypes.h"
|
||||
@@ -20,13 +21,18 @@
|
||||
#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);
|
||||
|
||||
@@ -36,7 +42,7 @@ int main(int argc, char **argv)
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user