helper: Make ~/.local/share/xdg-app writable again (if you have homedir access)

This makes the gnome-software app work, and if you have homedir access
you have all sort of ways to mess up apps anyway, so this is fake security.
This commit is contained in:
Alexander Larsson committed 2016-02-01 21:39:20 +01:00
1 parent 913eccd30f
commit 8144a70bd7
1 file changed
-14
-14
View File
@@ -2496,22 +2496,8 @@ main (int argc,
if (mount_host_fs || mount_home)
{
const char *home = getenv("HOME");
char *dconf_run_path = strdup_printf ("/run/user/%d/dconf", uid);
/* There really is no need for an app to install or modify other
apps, so lets forbid it directly */
if (home)
{
char *xdg_app_dir;
xdg_app_dir = strconcat (home, "/.local/share/xdg-app");
if (bind_mount (xdg_app_dir, get_relative_path (xdg_app_dir), BIND_READONLY) && errno != ENOENT)
die_with_error ("Unable to remount xdg-app dir readonly\n");
free (xdg_app_dir);
}
/* If the user has homedir access, also allow dconf run dir access */
bind_mount (dconf_run_path, get_relative_path (dconf_run_path), 0);
free (dconf_run_path);