|
ginnOS
The reference: libc, the libraries and the kernel
|
#include "permission.h"#include "common/memory.h"#include "common/string.h"#include "kernel/errno.h"#include "kernel/process/process.h"#include "kernel/vfs/stat.h"#include "kernel/vfs/vfs.h"Functions | |
| int32_t | permission_check (const fs_stat_t *st, uint32_t uid, uint32_t gid, uint32_t want) |
| check an access against a file's mode and owner. | |
| int32_t | permission_check_path (const char *path, uint32_t want) |
| check an access to a path for the current process (effective ids). | |
| void | permission_parent_path (const char *path, char *out, uint32_t size) |
| the parent directory of an absolute path ("/a/b" -> "/a", "/a" -> "/"). | |
| int32_t | permission_check_parent (const char *path, bool victim) |
| check that the current process may add or remove an entry of a directory: write and search rights on the parent of path. | |
check an access against a file's mode and owner.
| st | the file's stat. |
| uid | the user id to check as (effective, or real for access()). |
| gid | the group id to check as. |
| want | MAY_* bits. |
check an access to a path for the current process (effective ids).
| void permission_parent_path | ( | const char * | path, |
| char * | out, | ||
| uint32_t | size ) |
the parent directory of an absolute path ("/a/b" -> "/a", "/a" -> "/").
| path | the path. |
| out | receives the parent. |
| size | size of out. |
check that the current process may add or remove an entry of a directory: write and search rights on the parent of path.
for a removal (victim true) in a sticky directory, it must also own the entry or the directory.