mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Fix failing New-Item tests
PowerShell expects the behavior of NativeItemExists to not follow symbolic links.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <pwd.h>
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include "isfile.h"
|
||||
|
||||
@@ -36,5 +37,6 @@ bool IsFile(const char* path)
|
||||
return false;
|
||||
}
|
||||
|
||||
return access(path, F_OK) != -1;
|
||||
// Resolve relative paths to cwd of process, and do not follow symlinks
|
||||
return faccessat(AT_FDCWD, path, F_OK, AT_SYMLINK_NOFOLLOW) != -1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user