summaryrefslogtreecommitdiff
path: root/Libraries/LibC
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2020-01-11 10:17:08 +0100
committerAndreas Kling <awesomekling@gmail.com>2020-01-11 10:17:44 +0100
commit6536a80aa9f679e3f0c87e828dcf68c784f4660b (patch)
tree4b6d6c2314ad476ade3c4719852590b3112109f3 /Libraries/LibC
parent29b3d95004471578e915f1feee892288b18606f3 (diff)
downloadserenity-6536a80aa9f679e3f0c87e828dcf68c784f4660b.zip
Kernel: Pass a parameter struct to chown()
Diffstat (limited to 'Libraries/LibC')
-rw-r--r--Libraries/LibC/unistd.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/Libraries/LibC/unistd.cpp b/Libraries/LibC/unistd.cpp
index 2feb69c16f..9ad0eb7462 100644
--- a/Libraries/LibC/unistd.cpp
+++ b/Libraries/LibC/unistd.cpp
@@ -27,7 +27,12 @@ int systrace(pid_t pid)
int chown(const char* pathname, uid_t uid, gid_t gid)
{
- int rc = syscall(SC_chown, pathname, uid, gid);
+ if (!pathname) {
+ errno = EFAULT;
+ return -1;
+ }
+ Syscall::SC_chown_params params { { pathname, strlen(pathname) }, uid, gid };
+ int rc = syscall(SC_chown, &params);
__RETURN_WITH_ERRNO(rc, rc, -1);
}