diff options
author | Simon McVittie <smcv@collabora.com> | 2020-08-26 19:05:21 +0100 |
---|---|---|
committer | Alexander Larsson <alexander.larsson@gmail.com> | 2020-08-27 17:48:50 +0200 |
commit | aafe1d36e0225f54db8ca2ba03d8b1981c2d09e0 (patch) | |
tree | 8e59a47035473e138427eb06e1bf8395e756b200 /tests | |
parent | c0faab35fabb469e3945ad99c32f041d2d7a0dab (diff) | |
download | flatpak-aafe1d36e0225f54db8ca2ba03d8b1981c2d09e0.tar.gz |
context: Do some syntactic normalization on filesystems
Paths containing ".." are rejected: they're almost certainly a
terrible idea.
Paths containing "." or multiple slashes are syntactically normalized.
This assumes that nobody is going to use "--filesystem=/foo/bar/" to
mean "make /foo/bar available, unless it's a non-directory, in which
case fail".
Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-exports.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/test-exports.c b/tests/test-exports.c index 21d8329e..aaccfaf4 100644 --- a/tests/test-exports.c +++ b/tests/test-exports.c @@ -272,6 +272,9 @@ typedef struct static const NotFilesystem not_filesystems[] = { { "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 }, }; @@ -319,6 +322,8 @@ static const Filesystem filesystems[] = { "xdg-cache/Stuff", FLATPAK_FILESYSTEM_MODE_READ_WRITE }, { "xdg-config", FLATPAK_FILESYSTEM_MODE_READ_WRITE }, { "xdg-config/Stuff", FLATPAK_FILESYSTEM_MODE_READ_WRITE }, + { "xdg-config/././///.///././.", FLATPAK_FILESYSTEM_MODE_READ_WRITE, "xdg-config" }, + { "xdg-config/////", FLATPAK_FILESYSTEM_MODE_READ_WRITE, "xdg-config" }, { "xdg-run/dbus", FLATPAK_FILESYSTEM_MODE_READ_WRITE }, }; |