Commit 25437b69 authored by Ray Strode's avatar Ray Strode

daemon: fix leak in useradd code

The admin group variable is getting leaked when
there are extra admin groups.

This commit fixes that.
parent c17b57e1
......@@ -1076,10 +1076,11 @@ daemon_create_user_authorized_cb (Daemon *daemon,
argv[2] = "-c";
argv[3] = cd->real_name;
if (cd->account_type == ACCOUNT_TYPE_ADMINISTRATOR) {
admin_groups = g_strdup (ADMIN_GROUP);
if (EXTRA_ADMIN_GROUPS != NULL && EXTRA_ADMIN_GROUPS[0] != '\0')
admin_groups = g_strconcat (admin_groups, ",",
admin_groups = g_strconcat (ADMIN_GROUP, ",",
EXTRA_ADMIN_GROUPS, NULL);
else
admin_groups = g_strdup (ADMIN_GROUP);
argv[4] = "-G";
argv[5] = admin_groups;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment