udevadm-settle: check validity of specified path

This commit is contained in:
Yu Watanabe
2022-08-29 13:40:54 +09:00
parent 9668c1a5d3
commit 5b61c9b2bb
+4
View 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':