diff options
author | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | 2014-06-19 17:30:15 +0100 |
---|---|---|
committer | Zeeshan Ali (Khattak) <zeeshanak@gnome.org> | 2014-06-19 17:35:15 +0100 |
commit | 3f910e422f73211339f212b45fa21f95be90151a (patch) | |
tree | f10434bdc0c1453b1f8802fac723fbeda16e41fd /src/gclue-config.c | |
parent | 78f43372caa5863718c8826db867f8ebf072dbe3 (diff) |
service-client: Disallow app if disabled by config
We were treating both of these as same:
* app explicitly disallowed by configuration
* app not present in configuration
As a result we were asking agent about both and since currently the only
agents we have (demo and gnome-shell) allow all apps, we ended-up allowing
apps that were explicitly disallowed by configuration.
Diffstat (limited to 'src/gclue-config.c')
-rw-r--r-- | src/gclue-config.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/gclue-config.c b/src/gclue-config.c index 98b1e4c..2ef5f83 100644 --- a/src/gclue-config.c +++ b/src/gclue-config.c @@ -284,10 +284,10 @@ gclue_config_is_agent_allowed (GClueConfig *config, return FALSE; } -gboolean -gclue_config_is_app_allowed (GClueConfig *config, - const char *desktop_id, - GClueClientInfo *app_info) +GClueAppPerm +gclue_config_get_app_perm (GClueConfig *config, + const char *desktop_id, + GClueClientInfo *app_info) { GClueConfigPrivate *priv = config->priv; GList *node; @@ -305,23 +305,29 @@ gclue_config_is_app_allowed (GClueConfig *config, } } - if (app_config == NULL || !app_config->allowed) { - g_debug ("'%s' not in configuration or not allowed", desktop_id); + if (app_config == NULL) { + g_debug ("'%s' not in configuration", desktop_id); + + return GCLUE_APP_PERM_ASK_AGENT; + } + + if (!app_config->allowed) { + g_debug ("'%s' disallowed by configuration", desktop_id); - return FALSE; + return GCLUE_APP_PERM_DISALLOWED; } if (app_config->num_users == 0) - return TRUE; + return GCLUE_APP_PERM_ALLOWED; uid = gclue_client_info_get_user_id (app_info); for (i = 0; i < app_config->num_users; i++) { if (app_config->users[i] == uid) - return TRUE; + return GCLUE_APP_PERM_ALLOWED; } - return FALSE; + return GCLUE_APP_PERM_DISALLOWED; } gboolean |