diff options
| author | Leon Henrik Plickat <leonhenrik.plickat@stud.uni-goettingen.de> | 2022-06-06 21:53:55 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-06 21:53:55 +0200 |
| commit | 37da205be0c49969bc8dce9c784e785247eb4f30 (patch) | |
| tree | c043536ba68bff3c699f6ddfdf70cc904c64cee6 | |
| parent | a4137901584c98141ad8f32c667cfb3cb7736abb (diff) | |
| download | river-37da205be0c49969bc8dce9c784e785247eb4f30.tar.gz river-37da205be0c49969bc8dce9c784e785247eb4f30.tar.xz | |
river: error out if default init is not executable
| -rw-r--r-- | river/main.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/river/main.zig b/river/main.zig index e98ff4c..b0e6579 100644 --- a/river/main.zig +++ b/river/main.zig @@ -140,6 +140,12 @@ fn defaultInitPath() !?[:0]const u8 { }; os.accessZ(path, os.X_OK) catch |err| { + if (err == error.PermissionDenied) { + if (os.accessZ(path, os.R_OK)) { + std.log.err("failed to run init executable {s}: the file is not executable", .{path}); + os.exit(1); + } else |_| {} + } std.log.err("failed to run init executable {s}: {s}", .{ path, @errorName(err) }); util.gpa.free(path); return null; |
