I forgot the initialization of group_id in find_new_gid().
This commit is contained in:
parent
b4f6b853f8
commit
da37da30e1
@ -208,6 +208,11 @@ static void find_new_gid (void)
|
|||||||
gid_min = getdef_unum ("GID_MIN", 1000);
|
gid_min = getdef_unum ("GID_MIN", 1000);
|
||||||
gid_max = getdef_unum ("GID_MAX", 60000);
|
gid_max = getdef_unum ("GID_MAX", 60000);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Start with the lowest GID.
|
||||||
|
*/
|
||||||
|
group_id = gid_min;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Search the entire group file, looking for the largest unused
|
* Search the entire group file, looking for the largest unused
|
||||||
* value.
|
* value.
|
||||||
@ -404,7 +409,7 @@ static void process_flags (int argc, char **argv)
|
|||||||
* note: -K GID_MIN=10,GID_MAX=499 doesn't work yet
|
* note: -K GID_MIN=10,GID_MAX=499 doesn't work yet
|
||||||
*/
|
*/
|
||||||
cp = strchr (optarg, '=');
|
cp = strchr (optarg, '=');
|
||||||
if (!cp) {
|
if (NULL == cp) {
|
||||||
fprintf (stderr,
|
fprintf (stderr,
|
||||||
_
|
_
|
||||||
("%s: -K requires KEY=VALUE\n"),
|
("%s: -K requires KEY=VALUE\n"),
|
||||||
@ -444,7 +449,7 @@ static void process_flags (int argc, char **argv)
|
|||||||
* Check if the group already exist.
|
* Check if the group already exist.
|
||||||
*/
|
*/
|
||||||
/* local, no need for xgetgrnam */
|
/* local, no need for xgetgrnam */
|
||||||
if (getgrnam (group_name)) {
|
if (getgrnam (group_name) != NULL) {
|
||||||
/* The group already exist */
|
/* The group already exist */
|
||||||
if (fflg) {
|
if (fflg) {
|
||||||
/* OK, no need to do anything */
|
/* OK, no need to do anything */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user