Skip to content

Commit

Permalink
Increase default users for primary groups
Browse files Browse the repository at this point in the history
  • Loading branch information
zhuyaliang committed Jan 11, 2019
1 parent 0387c1f commit 73c0fa9
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/group-server.c
Expand Up @@ -176,6 +176,7 @@ static void LoadPrimaryGroup (GHashTable *groups)
struct group *grent;
Group *group = NULL;
FILE *fd;
const gchar *users[2];

fd = fopen (PATH_PASSWD, "r");
if(fd == NULL)
Expand All @@ -200,6 +201,14 @@ static void LoadPrimaryGroup (GHashTable *groups)
continue;
}
g_object_freeze_notify (G_OBJECT (group));
g_warning("name = %s\r\n", grent->gr_name);
if(grent->gr_mem[0] == NULL)
{
users[0] = g_strdup(pwent->pw_gecos);
users[1] = NULL;
user_group_list_set_users(USER_GROUP_LIST(group),users);
g_free(users[0]);
}
user_group_list_set_primary_group(USER_GROUP_LIST(group), TRUE);
g_object_thaw_notify (G_OBJECT (group));
}
Expand Down

0 comments on commit 73c0fa9

Please sign in to comment.