diff options
author | Allison Lortie <desrt@desrt.ca> | 2016-11-22 16:24:01 +0100 |
---|---|---|
committer | Allison Lortie <desrt@desrt.ca> | 2016-11-22 16:24:01 +0100 |
commit | dd0b0d22d812b6a081ada59c7f636b8130ab2f11 (patch) | |
tree | 3cd6b99b8f9455babd2784a56685a7994cd0f913 /proxy/confinement.c | |
parent | 8f9edbc58f3195c79aed06b12dcbe941bfeb2801 (diff) | |
download | dconf-dd0b0d22d812b6a081ada59c7f636b8130ab2f11.tar.gz |
Initial check-in of dconf-proxy code
Diffstat (limited to 'proxy/confinement.c')
-rw-r--r-- | proxy/confinement.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/proxy/confinement.c b/proxy/confinement.c new file mode 100644 index 0000000..33c3059 --- /dev/null +++ b/proxy/confinement.c @@ -0,0 +1,42 @@ +/* + * Copyright © 2016 Canonical Limited + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the licence, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see <http://www.gnu.org/licenses/>. + * + * Author: Allison Lortie <desrt@desrt.ca> + */ + +#include "confinement.h" + +gboolean +confinement_check (GVariant *credentials, + gboolean *out_is_confined, + Permissions *out_confined_permissions) +{ + Permissions permissions; + gboolean is_confined; + + if (!confinement_check_flatpak (credentials, &is_confined, &permissions)) + return FALSE; + + if (!is_confined) + /* snap goes here */; + + *out_is_confined = is_confined; + + if (is_confined) + *out_confined_permissions = permissions; + + return TRUE; +} |