|
ginnOS
The reference: libc, the libraries and the kernel
|
Go to the source code of this file.
Macros | |
| #define | MAY_EXEC 1 |
| #define | MAY_WRITE 2 |
| #define | MAY_READ 4 |
| #define | S_ISUID 04000 |
| #define | S_ISGID 02000 |
| #define | S_ISVTX 01000 |
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). | |
| 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. | |
| void | permission_parent_path (const char *path, char *out, uint32_t size) |
| the parent directory of an absolute path ("/a/b" -> "/a", "/a" -> "/"). | |
| #define MAY_EXEC 1 |
| #define MAY_WRITE 2 |
| #define MAY_READ 4 |
| #define S_ISUID 04000 |
| #define S_ISGID 02000 |
| #define S_ISVTX 01000 |
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).
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.
| 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. |