--- Cannot embed stylesheet: [Errno 2] No such file or directory: '../../../aros.css' --->
LONG secAccess_Control(
ULONG contextflags,
APTR context,
struct secExtOwner * task,
ULONG objectowner,
LONG objectprot,
LONG access_type );
Filesystem API: decide whether a task may access an object.
contextflags - secAC_IGNORE_CONTEXT or secAC_FILESYSTEM_CONTEXT.
context - the filesystem's MsgPort for secAC_FILESYSTEM_CONTEXT.
task - the requesting task's owner (see secGetPktOwner()),
NULL for nobody.
objectowner - owner of the object (uid<<16 | gid).
objectprot - protection bits of the object.
access_type - secAt_#? flags.
secAC_PERMISSION_GRANTED, or secAC_PERMISSION_DENIED with secAC_#? detail flags.
BOOL secAddMonitor(
struct secMonitor * monitor );
Add a monitor: a task interested in login/passwd/owner-change events. Root only. The structure must stay valid until secRemMonitor().
success
struct secGroupInfo * secAllocGroupInfo();
Allocate a Group Information Structure. Free it with secFreeGroupInfo().
struct secUserInfo * secAllocUserInfo();
Allocate a User Information Structure. Free it with secFreeUserInfo().
info - the structure, or NULL.
BOOL secCheckPasswdA(
struct TagItem * taglist );
BOOL secCheckPasswd(
TAG tag, ... );
Check the password of the owner of the calling task; asks for it unless secT_Password is given.
secT_Input, secT_Output, secT_Graphical, secT_PubScrName - as for secLoginA(). secT_Password - (STRPTR) the password to check.
valid - TRUE if the password is correct.
APTR secContextLocate(
secPluginModule * module,
ULONG id,
struct Task * caller,
ULONG size );
Plugin API: locate (or allocate) the context memory of size 'size' that a module keeps for a caller under the given id. The memory is freed automatically when the caller closes the library or exits.
The context memory, or NULL.
LONG secEnumChildren(
struct Task * parent,
struct Task ** children,
LONG size );
Enumerate the children of a task.
parent - the task, NULL for the current one. children - array to fill (may be NULL to query the count). size - number of entries in the array.
The number of children, negative if the array was too small (the absolute value is the required size).
void secFreeExtOwner(
struct secExtOwner * owner );
Free an extended owner structure returned by secGetTaskExtOwner(), secGetPktOwner() or secUserInfo2ExtOwner(). NULL is allowed.
void secFreeGroupInfo(
struct secGroupInfo * info );
Free a structure allocated with secAllocGroupInfo().
void secFreeUserInfo(
struct secUserInfo * info );
Free a structure allocated with secAllocUserInfo().
BOOL secFreeze(
struct Task * task );
Freeze (suspend) a task. Root only.
success. Fails on SMP systems (not supported yet).
BOOL secFSRendezVous();
Called by a multi-user aware filesystem when it comes up, so that the library rescans the volumes and key files.
TRUE if the server is running.
BPTR secGetConfigDirLock();
Get a shared lock on the configuration directory.
lock, or BNULL. UnLock() it when done.
ULONG secGetDefProtection(
struct Task * task );
Get the default protection bits of a task.
task - the task, NULL for the current one.
UWORD secgetgid();
POSIX: the real group id of the calling task.
struct secGroupInfo * secGetGroupInfo(
struct secGroupInfo * info,
ULONG keytype );
Fill in a Group Information Structure according to the key.
info, or NULL if no (more) group matches.
BPTR secGetPasswdDirLock();
Get a shared lock on the directory holding the password file.
lock, or BNULL. UnLock() it when done.
int secgetpgid(
int pid );
POSIX: the session id of a process (0 = the calling one).
The session id, 0 if not in a session, -1 for an unknown pid.
LONG secGetPktDefProtection(
struct DosPacket * pkt );
Filesystem API: get the default protection bits of the task that sent a packet, to be used for newly created objects.
struct secExtOwner * secGetPktOwner(
struct DosPacket * pkt );
Filesystem API: get the owner of the task that sent a packet. Must be called before the packet is replied.
owner - free with secFreeExtOwner(). NULL for nobody.
ULONG secGetRelationshipA(
struct secExtOwner * user,
ULONG owner,
struct TagItem * taglist );
ULONG secGetRelationship(
struct secExtOwner * user,
ULONG owner,
TAG tag, ... );
Determine the relationship between a user and the owner of an object.
user - the user (NULL = nobody). owner - the object's owner (uid<<16 | gid). taglist - reserved, pass NULL.
secRelF_#? flags.
struct secExtOwner * secGetTaskExtOwner(
struct Task * task );
Get the extended owner (uid, gid and secondary groups) of a task.
task - the task, NULL for the current one.
owner - free with secFreeExtOwner(). NULL if owned by nobody.
ULONG secGetTaskOwner(
struct Task * task );
Get the owner of a task.
task - the task, NULL for the current one.
owner - uid<<16 | gid, secOWNER_NOBODY if the task is owned by nobody.
UWORD secgetuid();
POSIX: the real user id of the calling task.
struct secUserInfo * secGetUserInfo(
struct secUserInfo * info,
ULONG keytype );
Fill in a User Information Structure according to the key. Repeated calls with secKeyType_Next (and the #?Next keys) iterate.
info - structure allocated with secAllocUserInfo(), the key field
filled in.
keytype - secKeyType_#?, see <libraries/security.h>.
info, or NULL if no (more) user matches.
BOOL secIsConfigured();
Is the system configured for multi-user operation, i.e. has a password file been found and parsed? On an unconfigured system every task is treated as privileged and no access checks are made.
TRUE if configured and no security violation was detected.
BOOL secIsVolumeSecured(
CONST_STRPTR volname,
ULONG dostype );
Filesystem API: should the handler of this volume enforce ownership? TRUE for multi-user dostypes (muF#?, muAF, muPF) and for volumes that carry a valid key file (secKey_FileName) in their root directory, which is how a filesystem without a multi-user dostype (e.g. SFS) is marked as multi-user. The server (re)scans volumes at startup and whenever secFSRendezVous() is called, so a handler should call secFSRendezVous() when a volume comes online and ask again.
volname - the volume or device name, with or without ':' (may be NULL) dostype - the volume's dostype
TRUE if the handler should enforce. Note that enforcement only makes sense while secIsConfigured() is TRUE as well.
BOOL secKill(
struct Task * task );
Kill a task. Root only. Processes are asked to quit with SIGBREAKF_CTRL_C; plain tasks are removed with RemTask().
success
BOOL secLimitDOSSetProtection(
BOOL flag );
Limit dos.library/SetProtection() to changing only the protection bits for the owner of a file; the GROUP and OTHER bits can then only be changed via secSetProtection(). Root only.
flag - TRUE to turn limiting on.
success
LONG secLimitProtection(
CONST_STRPTR name,
LONG protect );
Used by dos.library/SetProtection(): apply the LIMITDOSSETPROTECTION policy. If limiting is on and the caller is neither root nor inside secSetProtection(), the GROUP and OTHER bits of the existing object are preserved.
name - the object SetProtection() is about to change. protect - the requested protection bits.
The protection bits to apply.
BOOL secLoadPlugin(
CONST_STRPTR name );
Load and initialise a plugin from the configuration directory. Root only.
name - the plugin name without the .secplugin suffix.
struct secPointers * secLocksecBase();
Lock the library's internal lists for inspection by privileged tools. Root only. Release with secUnlocksecBase() as soon as possible.
pointers to the lists, or NULL.
ULONG secLoginA(
struct TagItem * taglist );
ULONG secLogin(
TAG tag, ... );
Login to the system and remember the previous user of the task.
secT_Graphical - (BOOL) use a graphical login instead of a console
one. Default FALSE.
secT_Input - (BPTR) filehandle to read from. Default Input().
secT_Output - (BPTR) filehandle to write to. Default Output().
secT_PubScrName - (STRPTR) public screen for the requester.
secT_Task - (struct Task *) the task to login. Only your own
tasks or tasks owned by nobody, unless you are root.
Default: the current task.
secT_Own - (BOOL) make the task owned by the caller's owner.
secT_Global - (BOOL) also login all descendants of the task.
secT_UserID - (STRPTR) do not ask for a UserID.
secT_Password - (STRPTR) do not ask for a password (needs secT_UserID).
secT_NoLog - (BOOL) do not log this action (root only).
The user that logged in (uid<<16 | gid), or secOWNER_NOBODY for a failure.
On an unconfigured system (no password file) any login succeeds as root, so that Security-Startup scripts work before the system is set up.
ULONG secLogoutA(
struct TagItem * taglist );
ULONG secLogout(
TAG tag, ... );
Logout and restore the previous user. If there was no previous user or the previous user was nobody, a login request will appear (unless secT_Quiet). A login from this request also sets the local variable "Home", the current directory, shows the last login information and executes the .profile from the configuration directory.
taglist - see secLoginA(); additionally
secT_Quiet - (BOOL) never request a login, simply logout.
secT_All - (BOOL) logout all previous users.
The user you are now (uid<<16 | gid), secOWNER_NOBODY for nobody.
BOOL secPasswd(
STRPTR oldpwd,
STRPTR newpwd );
Change the password of the owner of the calling task.
oldpwd - the old password. newpwd - the new password.
success - TRUE if the password was changed.
void secPluginOperationComplete(
APTR context,
ULONG result );
Plugin API: complete an operation that returned secpiASYNC.
context - the server packet handed to the plugin. result - the secpi#? result.
ULONG secRegisterHandler(
struct plugin_ops * ops );
Plugin API: register an operation table with the subsystem named by its HandlerType.
secpiTRUE on success.
BOOL secRegisterSegment(
BPTR seglist,
BPTR fh );
Called by dos.library after loading an executable. If the file has the secFIBF_SET_UID bit set and a real owner, the seglist is remembered as a setuid executable.
seglist - the loaded segment list fh - the file it was loaded from (still open)
TRUE if the segment was registered as setuid.
void secRemMonitor(
struct secMonitor * monitor );
Remove a monitor added with secAddMonitor().
BOOL secSetDefProtectionA(
struct TagItem * taglist );
BOOL secSetDefProtection(
TAG tag, ... );
Set the default protection bits ('umask') used for new files.
secT_Task - (struct Task *) the task, default the current one.
secT_DefProtection - (ULONG) the protection bits, default
FIBF_OTR_READ|FIBF_GRP_READ.
secT_Global - (BOOL) also change all descendants of the task.
success
int secsetegid(
UWORD gid );
POSIX: set the effective group id.
int secseteuid(
UWORD uid );
POSIX: set the effective user id.
int secsetgid(
UWORD gid );
POSIX: set the group id (see secsetuid()).
BOOL secSetProtection(
CONST_STRPTR name,
LONG mask );
Change the protection bits of a file or directory, including the GROUP and OTHER bits, regardless of secLimitDOSSetProtection().
name - the file or directory. mask - the new protection bits.
success
int secsetreuid(
int ruid,
int euid );
POSIX: set the real and effective user ids. -1 leaves an id unchanged.
BOOL secSetTaskOwnerFromSegment(
struct Task * task,
BPTR seglist );
Called by dos.library's CreateNewProc() (under Forbid(), before the new process runs) when the process is created from a seglist. If the seglist is a setuid executable the new process gets the owner of the executable.
TRUE if the owner was changed.
int secsetuid(
UWORD uid );
POSIX: set the user id. Root may set any id (real, effective and saved); others may only switch between their real and saved ids.
0 on success, -1 on failure.
APTR secSetUIDBegin(
BPTR seglist );
Called by dos.library's RunCommand() before running a seglist. If the seglist is a setuid executable the calling task's effective owner is switched to the owner of the executable.
A cookie to pass to secSetUIDEnd() when the command returns, or NULL if nothing was changed.
void secSetUIDEnd(
APTR cookie );
Restore the credentials saved by secSetUIDBegin().
BOOL secUnfreeze(
struct Task * task );
Unfreeze a task frozen with secFreeze(). Root only.
success
BOOL secUnloadPlugin(
CONST_STRPTR name );
Unload a plugin loaded with secLoadPlugin(). Root only.
void secUnlocksecBase(
struct secPointers * secP );
Release the lists locked with secLocksecBase().
void secUnRegisterHandler(
struct plugin_ops * ops );
Plugin API: unregister an operation table.
void secUnregisterSegment(
BPTR seglist );
Called by dos.library before a seglist is unloaded.
struct secExtOwner * secUserInfo2ExtOwner(
struct secUserInfo * info );
Convert a User Information Structure to an extended owner.
owner - free with secFreeExtOwner().