]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
mount-tool: honor arg_canonicalize for ACTION_UMOUNT path_is_absolute() check too 37398/head
authorMike Yuan <me@yhndnzj.com>
Mon, 24 Feb 2025 17:32:58 +0000 (18:32 +0100)
committerMike Yuan <me@yhndnzj.com>
Fri, 9 May 2025 16:39:51 +0000 (18:39 +0200)
Follow-up for 4e24796b5a64064f8b21c07356eba19e9db4bb33

src/mount/mount-tool.c

index de90f9d9837c9ee9b93af6adcc47c71bb7d7b9f9..2c64ccdf3070f96dda900f2b523972e60cfa8f4c 100644 (file)
@@ -418,11 +418,11 @@ static int parse_argv(int argc, char *argv[]) {
                         return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
                                                "At least one argument required.");
 
-                if (arg_transport != BUS_TRANSPORT_LOCAL)
+                if (arg_transport != BUS_TRANSPORT_LOCAL || !arg_canonicalize)
                         for (int i = optind; i < argc; i++)
                                 if (!path_is_absolute(argv[i]))
                                         return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
-                                                               "Path must be absolute when operating remotely: %s",
+                                                               "Path must be absolute when operating remotely or when canonicalization is turned off: %s",
                                                                argv[i]);
         } else {
                 if (optind >= argc)