mirror of
https://github.com/flatpak/flatpak.git
synced 2026-04-07 08:34:25 -04:00
context: Forbid --filesystem=/
Making it an equivalent of --filesystem=host would be misleading,
because it wouldn't do what you'd think it does: host mounts some host
system directories in their usual places, but others below /run/host.
Signed-off-by: Simon McVittie <smcv@collabora.com>
(cherry picked from commit 02094b4f39)
This commit is contained in:
committed by
Alexander Larsson
parent
7eeefa43b1
commit
ceea3cefad
@@ -802,6 +802,17 @@ flatpak_context_parse_filesystem (const char *filesystem_and_mode,
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
if (filesystem[0] == '/' && filesystem[1] == '\0')
|
||||
{
|
||||
/* We don't allow --filesystem=/ as equivalent to host, because
|
||||
* it doesn't do what you'd think: --filesystem=host mounts some
|
||||
* host directories in /run/host, not in the root. */
|
||||
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
|
||||
_("--filesystem=/ is not available, "
|
||||
"use --filesystem=host for a similar result"));
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
if (g_strv_contains (flatpak_context_special_filesystems, filesystem) ||
|
||||
|
||||
@@ -241,11 +241,14 @@ typedef struct
|
||||
|
||||
static const NotFilesystem not_filesystems[] =
|
||||
{
|
||||
{ "", G_OPTION_ERROR_FAILED },
|
||||
{ "homework", G_OPTION_ERROR_FAILED },
|
||||
{ "xdg-download/foo/bar/..", G_OPTION_ERROR_BAD_VALUE },
|
||||
{ "xdg-download/../foo/bar", G_OPTION_ERROR_BAD_VALUE },
|
||||
{ "xdg-download/foo/../bar", G_OPTION_ERROR_BAD_VALUE },
|
||||
{ "xdg-run", G_OPTION_ERROR_FAILED },
|
||||
{ "/", G_OPTION_ERROR_BAD_VALUE },
|
||||
{ "/////././././././//////", G_OPTION_ERROR_BAD_VALUE },
|
||||
};
|
||||
|
||||
typedef struct
|
||||
|
||||
Reference in New Issue
Block a user