Print this page
4078 groupadd execs getent unnecessarily
Reviewed by: Rich Lowe <richlowe@richlowe.net>
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: Milan Jurik <milan.jurik@xylab.cz>
Reviewed by: Gordon Ross <Gordon.W.Ross@gmail.com>

*** 25,49 **** */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ ! ! #pragma ident "%Z%%M% %I% %E% SMI" #include <sys/types.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <limits.h> #include <userdefs.h> #include <users.h> #include <errno.h> #include "messages.h" extern int errmsg(); - extern gid_t findnextgid(); extern int valid_gid(), add_group(); /* * groupadd [-g gid [-o]] group * --- 25,51 ---- */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */ ! /* ! * Copyright (c) 2013 RackTop Systems. ! */ #include <sys/types.h> + #include <sys/param.h> #include <stdio.h> #include <stdlib.h> #include <ctype.h> #include <limits.h> #include <userdefs.h> #include <users.h> #include <errno.h> + #include <libcmdutils.h> #include "messages.h" extern int errmsg(); extern int valid_gid(), add_group(); /* * groupadd [-g gid [-o]] group *
*** 134,144 **** } } else { ! if ((gid = findnextgid()) < 0) { errmsg(M_GID_INVALID, "default id"); exit(EX_ID_EXISTS); } } --- 136,146 ---- } } else { ! if (findnextgid(DEFRID+1, MAXUID, &gid) != 0) { errmsg(M_GID_INVALID, "default id"); exit(EX_ID_EXISTS); } }