auth: chroot

This commit is contained in:
Matheus
2024-08-24 21:52:44 -03:00
parent 806fa3a333
commit cd51d4eaf0
3 changed files with 28 additions and 3 deletions
+5
View File
@@ -3,12 +3,17 @@
#include <kernel/vfs.h>
#include <kernel/alloc.h>
#include <errno.h>
#include <kernel/auth.h>
syscallret_t syscall_chroot(context_t *, char *upath) {
syscallret_t ret = {
.ret = -1
};
ret.errno = auth_system_check(&_cpu()->thread->proc->cred, AUTH_ACTIONS_SYSTEM_CHROOT);
if (ret.errno)
return ret;
size_t pathlen;
ret.errno = usercopy_strlen(upath, &pathlen);
if (ret.errno)