]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udevadm-settle: check validity of specified path 24474/head
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 27 Aug 2022 16:11:47 +0000 (01:11 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 29 Aug 2022 04:40:54 +0000 (13:40 +0900)
src/udev/udevadm-settle.c

index 477e9d735ec5b06fd1f2d028efbbe9aae89f4727..9de25ae678000384053fe5c0bfda25a1c295de2f 100644 (file)
@@ -13,6 +13,7 @@
 #include "sd-messages.h"
 
 #include "bus-util.h"
+#include "path-util.h"
 #include "strv.h"
 #include "time-util.h"
 #include "udev-ctrl.h"
@@ -58,6 +59,9 @@ static int parse_argv(int argc, char *argv[]) {
                                 return log_error_errno(r, "Failed to parse timeout value '%s': %m", optarg);
                         break;
                 case 'E':
+                        if (!path_is_valid(optarg))
+                                return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Invalid path: %s", optarg);
+
                         arg_exists = optarg;
                         break;
                 case 'V':