|
ginnOS
The reference: libc, the libraries and the kernel
|
user and group ids, file modes and owners. More...
#include "syscall_internal.h"#include "fd_table.h"#include "kernel/process/process.h"#include "kernel/vfs/permission.h"#include "kernel/vfs/vfs.h"Functions | |
| syscall_ret_t | sys_getuid (struct registers *regs) |
| syscall_ret_t | sys_geteuid (struct registers *regs) |
| syscall_ret_t | sys_getgid (struct registers *regs) |
| syscall_ret_t | sys_getegid (struct registers *regs) |
| syscall_ret_t | sys_setuid (struct registers *regs) |
| SYS_setuid: args: EBX = uid. | |
| syscall_ret_t | sys_setgid (struct registers *regs) |
| SYS_setgid: args: EBX = gid. | |
| syscall_ret_t | sys_seteuid (struct registers *regs) |
| syscall_ret_t | sys_setegid (struct registers *regs) |
| syscall_ret_t | sys_chmod (struct registers *regs) |
| SYS_chmod: args: path, mode (07777 bits). | |
| syscall_ret_t | sys_fchmodat (struct registers *regs) |
| SYS_fchmodat: args: dirfd, path, mode, flags (AT_SYMLINK_NOFOLLOW is refused: a link has no mode of its own, as on Linux). | |
| syscall_ret_t | sys_fchmod (struct registers *regs) |
| SYS_fchmod: args: EBX = fd, ECX = mode. | |
| syscall_ret_t | sys_chown (struct registers *regs) |
| SYS_chown: args: path, uid, gid (-1 keeps one). | |
| syscall_ret_t | sys_fchownat (struct registers *regs) |
| SYS_fchownat: args: dirfd, path, uid, gid, flags (AT_SYMLINK_NOFOLLOW). | |
| syscall_ret_t | sys_fchown (struct registers *regs) |
| SYS_fchown: args: fd, uid, gid. | |
| syscall_ret_t | sys_umask (struct registers *regs) |
| SYS_umask: args: EBX = mask. | |
user and group ids, file modes and owners.
a process has a real, an effective and a saved user id (and the same for groups). the effective ids decide what it may do; root (effective uid 0) may do everything. a set-uid program starts with the effective and saved ids of the file's owner (exec.c).
| syscall_ret_t sys_getuid | ( | struct registers * | regs | ) |
| syscall_ret_t sys_geteuid | ( | struct registers * | regs | ) |
| syscall_ret_t sys_getgid | ( | struct registers * | regs | ) |
| syscall_ret_t sys_getegid | ( | struct registers * | regs | ) |
| syscall_ret_t sys_setuid | ( | struct registers * | regs | ) |
SYS_setuid: args: EBX = uid.
returns 0 or -EPERM.
| syscall_ret_t sys_setgid | ( | struct registers * | regs | ) |
SYS_setgid: args: EBX = gid.
returns 0 or -EPERM. root's check is on the effective user id, so set the group before giving up root.
| syscall_ret_t sys_seteuid | ( | struct registers * | regs | ) |
| syscall_ret_t sys_setegid | ( | struct registers * | regs | ) |
| syscall_ret_t sys_chmod | ( | struct registers * | regs | ) |
SYS_chmod: args: path, mode (07777 bits).
only the owner or root. returns 0 or a negative errno.
| syscall_ret_t sys_fchmodat | ( | struct registers * | regs | ) |
SYS_fchmodat: args: dirfd, path, mode, flags (AT_SYMLINK_NOFOLLOW is refused: a link has no mode of its own, as on Linux).
| syscall_ret_t sys_fchmod | ( | struct registers * | regs | ) |
SYS_fchmod: args: EBX = fd, ECX = mode.
like chmod, on an open file.
| syscall_ret_t sys_chown | ( | struct registers * | regs | ) |
SYS_chown: args: path, uid, gid (-1 keeps one).
returns 0 or a negative errno (see owner_change).
| syscall_ret_t sys_fchownat | ( | struct registers * | regs | ) |
SYS_fchownat: args: dirfd, path, uid, gid, flags (AT_SYMLINK_NOFOLLOW).
| syscall_ret_t sys_fchown | ( | struct registers * | regs | ) |
SYS_fchown: args: fd, uid, gid.
like chown, on an open file.
| syscall_ret_t sys_umask | ( | struct registers * | regs | ) |
SYS_umask: args: EBX = mask.
returns the old mask.