From 049ec6dab12d9e7752380a9045ce478289818b34 Mon Sep 17 00:00:00 2001 From: Imran Zaman Date: Thu, 5 Dec 2013 10:54:32 +0200 Subject: [PATCH] enable directory creation and deletion for guest user as well --- src/daemon/gumd-daemon-user.c | 9 +++------ test/daemon/daemon-test.c | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/daemon/gumd-daemon-user.c b/src/daemon/gumd-daemon-user.c index 1b3a179..6483dae 100644 --- a/src/daemon/gumd-daemon-user.c +++ b/src/daemon/gumd-daemon-user.c @@ -749,8 +749,7 @@ _set_uid ( } _set_uid_property (self, uid); - if (self->priv->user_type == GUM_USERTYPE_NORMAL || - self->priv->user_type == GUM_USERTYPE_ADMIN) { + if (self->priv->user_type != GUM_USERTYPE_SYSTEM) { gchar *dir = g_strdup_printf ("%s/%s", gum_config_get_string (self->priv->config, GUM_CONFIG_GENERAL_HOME_DIR_PREF), @@ -1155,8 +1154,7 @@ _create_home_dir ( GumdDaemonUser *self, GError **error) { - if (self->priv->user_type == GUM_USERTYPE_SYSTEM || - self->priv->user_type == GUM_USERTYPE_GUEST) { + if (self->priv->user_type == GUM_USERTYPE_SYSTEM) { return TRUE; } @@ -1171,8 +1169,7 @@ _delete_home_dir ( GumdDaemonUser *self, GError **error) { - if (self->priv->user_type == GUM_USERTYPE_SYSTEM || - self->priv->user_type == GUM_USERTYPE_GUEST) { + if (self->priv->user_type == GUM_USERTYPE_SYSTEM) { return TRUE; } diff --git a/test/daemon/daemon-test.c b/test/daemon/daemon-test.c index 8e7d2ac..10b57b7 100644 --- a/test/daemon/daemon-test.c +++ b/test/daemon/daemon-test.c @@ -567,7 +567,7 @@ START_TEST (test_daemon_user) fail_unless (uid == gid); hdir = g_build_filename (gum_config_get_string (config, GUM_CONFIG_GENERAL_HOME_DIR_PREF), "guest_daemon_user1", NULL); - fail_unless (stat (hdir, &sb) != 0); + fail_unless (stat (hdir, &sb) == 0); g_free (hdir); /* case 14: user does not exist and delete */ -- 2.7.4