chiark / gitweb /
ipif: service-wrap: fix access handling if no config at all
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 19 Apr 2017 22:31:12 +0000 (23:31 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 19 Apr 2017 22:31:12 +0000 (23:31 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
ipif/service-wrap

index 3a4e80658756d524c4c9fcc6cafcd5089b9c2316..678a86789baf282bb72d51db146309bc973e2c9d 100755 (executable)
@@ -272,12 +272,12 @@ sub readconfig ($) {
     }
     $cfgfh->error and die $!;
     close $cfgfh;
-
-    if ($v0config && $v0config =~ m{^[^#]} && $v0config ne '/dev/null') {
-       print "trying v0 config $v0config...\n" if $protocol eq 'debug';
-       execreal $v0config;
-    }
-    die "permission denied\n";
 }
 
 readconfig $v1config;
+
+if ($v0config && $v0config =~ m{^[^#]} && $v0config ne '/dev/null') {
+    print "trying v0 config $v0config...\n" if $protocol eq 'debug';
+    execreal $v0config;
+}
+die "permission denied\n";