In case there was wrong group in DEFAULT_USR_GROUP, user home directory was not created.
This patch will prevent abnormal termination of creating user by wrong default groups.
Change-Id: I74176fbce066ec160d518b228a2f7bd019de4d52
Signed-off-by: Hurnjoo Lee <hurnjoo.lee@samsung.com>
GUM_CONFIG_GENERAL_DEF_USR_GROUPS), ",", -1);
if (def_groupsv) {
GUM_CONFIG_GENERAL_DEF_USR_GROUPS), ",", -1);
if (def_groupsv) {
gint ind = 0;
while (def_groupsv[ind]) {
GumdDaemonGroup *agroup = gumd_daemon_group_new (self->priv->config);
gint ind = 0;
while (def_groupsv[ind]) {
GumdDaemonGroup *agroup = gumd_daemon_group_new (self->priv->config);
added = gumd_daemon_group_add_member (agroup,
self->priv->pw->pw_uid, FALSE, error);
g_object_unref (agroup);
added = gumd_daemon_group_add_member (agroup,
self->priv->pw->pw_uid, FALSE, error);
g_object_unref (agroup);
+ if (!added) {
+ WARN ("Failed to set group : %s", def_groupsv[ind]);
+ }
} else {
GUM_RETURN_WITH_ERROR (GUM_ERROR_USER_GROUP_ADD_FAILURE,
"Unable to add default groups", error, FALSE);
} else {
GUM_RETURN_WITH_ERROR (GUM_ERROR_USER_GROUP_ADD_FAILURE,
"Unable to add default groups", error, FALSE);
- if (!_set_default_groups (self, error) ||
- !_create_home_dir (self, error)) {
+ _set_default_groups (self, error);
+
+ if (!_create_home_dir (self, error)) {
gum_lock_pwdf_unlock ();
return FALSE;
}
gum_lock_pwdf_unlock ();
return FALSE;
}