Set the login associated with the current session to the user specified in the passwd structure using setlogin(2). The pwd parameter must not be NULL if this option is used.
LOGIN_SETUSER
Set ownship of the current process to the uid specified in the uid parameter using setuid(2).
LOGIN_SETGROUP
Set group ownership of the current process to the group id specified in the passwd structure using setgid(2), and calls initgroups(3) to set up the group access list for the current process. The pwd parameter must not be NULL if this option is used.
LOGIN_SETRESOURCES
Set resource limits for the current process based on values specified in the system login class database. Class capability tags used, with and without -cur (soft limit) or -max (hard limit) suffixes and the corresponding resource setting:
cputime RLIMIT_CPU
filesize RLIMIT_FSIZE
datasize RLIMIT_DATA
stacksizeRLIMIT_STACK
coredumpsize RLIMIT_CORE
memoryuseRLIMIT_RSS
memorylocked RLIMIT_MEMLOCK
maxproc RLIMIT_NPROC
openfilesRLIMIT_NOFILE
sbsize RLIMIT_SBSIZE
vmemoryuse RLIMIT_VMEM
LOGIN_SETPRIORITY
Set the scheduling priority for the current process based on the value specified in the system login class database. Class capability tags used:
priority
LOGIN_SETUMASK
Set the umask for the current process to a value in the user or system login class database. Class capability tags used:
umask
LOGIN_SETPATH
Set the "path" and "manpath" environment variables based on values in the user or system login class database. Class capability tags used with the corresponding environment variables set:
pathPATH
manpath MANPATH
LOGIN_SETENV
Set various environment variables based on values in the user or system login class database. Class capability tags used with the corresponding environment variables set:
langLANG
charset MM_CHARSET
timezone TZ
termTERM
Additional environment variables may be set using the list type capability "setenv=var1 val1,var2 val2..,varN valN".
LOGIN_SETALL
Enables all of the above settings.
Note that when setting environment variables and a valid passwd pointer is provided in the pwd parameter, the characters ~ and $ are substituted for the users home directory and login name respectively.
The setclassresources and setclassenvironment functions are subsets of the setcontext functions above, but may be useful in isolation.