diff options
author | Andreas Kling <awesomekling@gmail.com> | 2020-01-11 10:17:08 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2020-01-11 10:17:44 +0100 |
commit | 6536a80aa9f679e3f0c87e828dcf68c784f4660b (patch) | |
tree | 4b6d6c2314ad476ade3c4719852590b3112109f3 /Libraries/LibC | |
parent | 29b3d95004471578e915f1feee892288b18606f3 (diff) | |
download | serenity-6536a80aa9f679e3f0c87e828dcf68c784f4660b.zip |
Kernel: Pass a parameter struct to chown()
Diffstat (limited to 'Libraries/LibC')
-rw-r--r-- | Libraries/LibC/unistd.cpp | 7 |
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, ¶ms); __RETURN_WITH_ERRNO(rc, rc, -1); } |