mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
executable(): return false if user is not owner #9703
S_IXUSR does not check ownership. Test case: touch test.txt chmod 744 test.txt sudo chown root:root test.txt nvim -u NORC :echo executable('./test.txt')
This commit is contained in:
parent
6eca56c6c5
commit
7757ce1cb8
@ -288,7 +288,11 @@ static bool is_executable(const char *name)
|
||||
// a directory.
|
||||
return (S_ISREG(mode));
|
||||
#else
|
||||
return (S_ISREG(mode) && (S_IXUSR & mode));
|
||||
int r = -1;
|
||||
if (S_ISREG(mode)) {
|
||||
RUN_UV_FS_FUNC(r, uv_fs_access, name, X_OK, NULL);
|
||||
}
|
||||
return (r == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user