Paths must always be canonicalized in restricted (non-root) mode to
ensure safe target resolution before fd pinning.
Signed-off-by: Karel Zak <kzak@redhat.com>
assert(cxt);
assert(type);
+ if (mnt_context_is_restricted(cxt))
+ return 0;
+
ol = mnt_context_get_optlist(cxt);
if (!ol)
return 0;
+
The command-line option *--no-canonicalize* overrides this mount option and affects all path and tag conversions in all situations, but for backward compatibility, it does not modify *open_tree*(2) syscall flags and does not allow the bind-mount over a symbolic link use case.
+
-Note that *mount*(8) still sanitizes and canonicalizes the source and target paths specified on the command line by unprivileged users, regardless of the X-mount.nocanonicalize setting.
+Note that *mount*(8) ignores this option for unprivileged (non-root) users. Paths are always canonicalized in restricted mode to ensure safe target resolution.
*X-mount.noloop*::
Do not create and mount a loop device, even if the source of the mount is a regular file.