12.07.2015 Views

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

INTRO (9) NetBSD Kernel Developer's Manual INTRO (9) NAME ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

DO_SETRESUID (9) <strong>NetBSD</strong> <strong>Kernel</strong> Developer’s <strong>Manual</strong> DO_SETRESUID (9)<strong>NAME</strong>do_setresuid, do_setresgid —set process uid and gidSYNOPSIS#include intdo_setresuid(struct lwp ∗lwp , uid_t ruid , uid_t euid , uid_t svuid ,u_int flags);intdo_setresgid(struct lwp ∗lwp , uid_t ruid , uid_t euid , uid_t svuid ,u_int flags);DESCRIPTIONThe do_setresuid and do_setresgid functions are used to implement the various system calls thatallow aprocess to change its real, effective, and saved uid and gid values.The do_setresuid function sets the specified processes real user ID to ruid, its effective user ID toeuid, and its saved user ID to svuid. Ifany of the uid arguments are −1 then that assignment is skipped.If suser() is true, then any values may be assigned, otherwise the new uid values must match one of theexisting values and the caller must have set the relevant bit in flags.The flags argument specifies which of the existing uid values the new value must match. It should be setto a logical OR of ID_{R,E,S}_EQ_{R,E,S}, where ID_E_EQ_R means that it is valid to set the effective IDto the current value of the real ID.The do_setresgid function sets the group IDs but otherwise behaves in the same manner asdo_setresuid. The processes group list is neither examined nor effected.SEE ALSOsetregid(2), setreuid(2), setuid(2), suser(9)CODE REFERENCESThese functions are implemented in: sys/kern/kern_prot.c.HISTORYImplemented for <strong>NetBSD</strong> 2.0 to replace ad-hoc code in each system call routine and in the various compatmodules.<strong>NetBSD</strong> 3.0 September 28, 2003 1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!