]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
portablectl: no need to validate profile name before checking whether it is 'help'
authorLennart Poettering <lennart@poettering.net>
Thu, 31 May 2018 10:06:37 +0000 (12:06 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 31 May 2018 10:06:37 +0000 (12:06 +0200)
src/portable/portablectl.c

index 04a261297ce1c11e4f906e1c79f6d6f8ed8c6aa8..4051875b76dc138a1fff27275144d8af788064fe 100644 (file)
@@ -884,14 +884,14 @@ static int parse_argv(int argc, char *argv[]) {
                         break;
 
                 case 'p':
+                        if (streq(optarg, "help"))
+                                return dump_profiles();
+
                         if (!filename_is_valid(optarg)) {
                                 log_error("Unit profile name not valid: %s", optarg);
                                 return -EINVAL;
                         }
 
-                        if (streq(optarg, "help"))
-                                return dump_profiles();
-
                         arg_profile = optarg;
                         break;