summaryrefslogtreecommitdiff
path: root/src/pardes.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/pardes.zig')
-rw-r--r--src/pardes.zig7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pardes.zig b/src/pardes.zig
index 2b0ed8f0..dbb37084 100644
--- a/src/pardes.zig
+++ b/src/pardes.zig
@@ -5563,7 +5563,12 @@ pub const Pardes = struct {
const parent = std.fs.path.dirname(path) orelse "/";
const kind: ?std.Io.File.Kind = if (comptime hosted) (if (filesystem.localPath(parent)) |local| exec.kindOf(local) else .directory) else .directory;
const no_dir = err == error.FileNotFound or err == error.NotDir or kind != .directory;
- if (kind != null and kind != .directory) {
+ // Not there because one above refuses: that is why, EACCES.
+ const denied = no_dir and kind == null and (if (comptime hosted) (if (filesystem.localPath(parent)) |local| filesystem.deniedAbove(local) else false) else false);
+ if (denied) {
+ var said: [limits.host_path_cap + 48]u8 = undefined;
+ p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: permission denied", .{operation}) catch "Dump: permission denied");
+ } else if (kind != null and kind != .directory) {
var said: [limits.host_path_cap + 48]u8 = undefined;
p.reportFailure(p.active, std.fmt.bufPrint(&said, "{s}: {s} is not a directory", .{ operation, parent }) catch "Dump: not a directory");
} else if (no_dir) {