mirror of
https://github.com/ziglang/zig.git
synced 2026-01-02 11:33:21 +00:00
Disallow absolute paths passed as system libraries
Added OBJECT_NAME_INVALID handling in faccessatW
This commit is contained in:
parent
8c9919ec7b
commit
beb9d33d6d
@ -3809,6 +3809,7 @@ pub fn faccessatW(dirfd: fd_t, sub_path_w: [*:0]const u16, mode: u32, flags: u32
|
||||
.SUCCESS => return,
|
||||
.OBJECT_NAME_NOT_FOUND => return error.FileNotFound,
|
||||
.OBJECT_PATH_NOT_FOUND => return error.FileNotFound,
|
||||
.OBJECT_NAME_INVALID => return error.BadPathName,
|
||||
.INVALID_PARAMETER => unreachable,
|
||||
.ACCESS_DENIED => return error.PermissionDenied,
|
||||
.OBJECT_PATH_SYNTAX_BAD => unreachable,
|
||||
|
||||
@ -1401,6 +1401,9 @@ fn buildOutputType(
|
||||
_ = system_libs.orderedRemove(i);
|
||||
continue;
|
||||
}
|
||||
if (std.fs.path.isAbsolute(lib_name)) {
|
||||
fatal("cannot use absolute path as a system library: {}", .{lib_name});
|
||||
}
|
||||
i += 1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user