1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

Kernel: Make access() take path+length

Also, let's return EFAULT for nullptr at the LibC layer. We can't do
all bad addresses this way, but we can at least do null. :^)
This commit is contained in:
Andreas Kling 2020-01-06 10:43:53 +01:00
parent ad4284428a
commit 642137f014
3 changed files with 10 additions and 6 deletions

View file

@ -389,7 +389,11 @@ int setgid(uid_t gid)
int access(const char* pathname, int mode)
{
int rc = syscall(SC_access, pathname, mode);
if (!pathname) {
errno = EFAULT;
return -1;
}
int rc = syscall(SC_access, pathname, strlen(pathname), mode);
__RETURN_WITH_ERRNO(rc, rc, -1);
}