#ifndef LIBRARIES_MULTIUSER_H #define LIBRARIES_MULTIUSER_H /* ** $VER: multiuser.h 39.14 (29.6.94) ** MultiUser Release 1.8 ** ** multiuser.library definitions ** ** (C) Copyright 1993-1994 Geert Uytterhoeven ** All Rights Reserved */ /* Geert gave me permission to distribute this header with the ixemul distribution. Hans Verkuil, 22 Apr 1996. */ #ifndef EXEC_TYPES_H #include #endif /* EXEC_TYPES_H */ #ifndef EXEC_LISTS_H #include #endif /* EXEC_LISTS_H */ #ifndef EXEC_LIBRARIES_H #include #endif /* EXEC_LIBRARIES_H */ #ifndef EXEC_EXECBASE_H #include #endif /* EXEC_EXECBASE_H */ #ifndef EXEC_PORTS_H #include #endif /* EXEC_PORTS_H */ #ifndef LIBRARIES_DOS_H #include #endif /* LIBRARIES_DOS_H */ #ifndef UTILITY_TAGITEM_H #include #endif /* UTILITY_TAGITEM_H */ #ifndef LIBRARIES_LOCALE_H #include #endif /* LIBRARIES_LOCALE_H */ #define MULTIUSERNAME "multiuser.library" #define MULTIUSERVERSION (39) #define MULTIUSERCATALOGNAME "multiuser.catalog" #define MULTIUSERCATALOGVERSION (1) /* * Reserved users/groups * * WARNING: a uid may NOT be zero, a gid may be zero */ #define muOWNER_NOBODY (0x00000000) /* no rights */ #define muOWNER_SYSTEM (0xffffffff) /* always owner */ #define muMASK_UID (0xffff0000) /* Mask for uid bits */ #define muMASK_GID (0x0000ffff) /* Mask for gid bits */ #define muROOT_UID (0xffff) /* super user uid */ #define muROOT_GID (0xffff) /* super user gid */ #define muNOBODY_UID (0x0000) /* nobody uid */ #define muUSERIDSIZE (32) /* Maximum size for a User ID */ #define muGROUPIDSIZE (32) /* Maximum size for a Group ID */ #define muPASSWORDSIZE (32) /* Maximum size for a Password */ #define muUSERNAMESIZE (220) /* Maximum size for a User Name */ #define muGROUPNAMESIZE (220) /* Maximum size for a Group Name */ #define muHOMEDIRSIZE (256) /* Maximum size for a Home Directory */ #define muSHELLSIZE (256) /* Maximum size for a Shell */ /* * Password File * * * For each user, the Password File must contain a line like this: * * |||||| * * with: * * User Login ID (max. muUSERIDSIZE-1 characters) * Encrypted Password * User Number (1 - 65535) * Primary Group Number (0 - 65535) * Full User Name (max. muUSERNAMESIZE-1 characters) * Home directory (max. muHOMEDIRSIZE-1 characters) * Default Shell (max. muSHELLSIZE-1 characters) * (not used yet, AS225 compatibility) */ #define muPasswd_FileName "passwd" /* for AS225 compatibility */ /* * Group File * * * This file gives more information about the groups and defines * the secondary groups (other than the primary group) a user * belongs to. It exists out of two parts, separated by a blank line. * * The first part contains lines with the format: * * ||| * * with: * * Group short ID (max. muGROUPIDSIZE-1 characters) * Group Number (0 - 65535) * User Number of this group's manager, 0 for no * manager. A group's manager must not belong to the * group. * Full Group Name (max. muGROUPNAMESIZE-1 characters) * * NOTE: Not every group must have a line in this file, but at least * one group must have one. * * * The seconds part contains lines with the format: * * :[,...] * * with: * * User Number (1-65535) * Group Number (0 - 65535) * * If you think you'll exceed the maximum line length (circa 1K), * you may use more than one line per user. */ #define muGroup_FileName "MultiUser.group" /* * Configuration File * * * This file contains lines with options in the form =. * 0 is used for OFF, 1 for ON. * Defaults to the values between square brackets. * * LIMITDOSSETPROTECTION dos.library/SetProtection() cannot change * protection bits for GROUP and OTHER [1] * PROFILE execute the Profile if it exists [1] * LASTLOGINREQ display the Lastlogin requester [1] * LOGSTARTUP log startup [0] * LOGLOGIN log successful logins [0] * LOGLOGINFAIL log failed logins [0] * LOGPASSWD log successful password changes [0] * LOGPASSWDFAIL log failed password changes [0] * LOGCHECKPASSWD log successful password checks [0] * LOGCHECKPASSWDFAIL log failed password checks [0] * PASSWDUIDLEVEL users with a uid greather than or equal to * can change their passwords [0] * PASSWDGIDLEVEL users with a gid greather than or equal to * can change their passwords [0] * * NOTE: if a user has a uid less than the PASSWDUIDLEVEL AND a gid * less than PASSWDGIDLEVEL he/she is NOT allowed to change * his/her password! */ #define muConfig_FileName "MultiUser.config" /* * Log File */ #define muLog_FileName "MultiUser.log" /* * Lastlogin File */ #define muLastLogin_FileName ".lastlogin" /* * Profile */ #define muProfile_FileName ".profile" /* * Plan file */ #define muPlan_FileName ".plan" /* * Key File * * * This file must be present in the root directory of every volume * that uses the MultiUserFileSystem. It must contain 3 lines: * * - a pseudo random ASCII key (max. 1023 characters). * - the directory of the password file, if located on this volume, * otherwise an empty line (no spaces!). * e.g. ":MultiUser" * e.g. ":inet/db" for AS225 compatibility * - the directory of the configuration file, if located on this * volume, otherwise an empty line (no spaces!). * e.g. ":MultiUser" * * If there is ANY inconsistency the system will refuse to work!! */ #define muKey_FileName ":.MultiUser.keyfile" /* * Tags for muLogoutA() * muLoginA() * muSetDefProtectionA() */ #define muT_Input (TAG_USER+1) /* filehandle - default is Input() */ #define muT_Output (TAG_USER+2) /* filehandle - default is Output() */ #define muT_Graphical (TAG_USER+3) /* boolean - default is FALSE */ #define muT_PubScrName (TAG_USER+4) /* name of public screen */ #define muT_Task (TAG_USER+5) /* task (NOT the name!!) */ #define muT_Own (TAG_USER+6) /* make a task owned by this user */ #define muT_Global (TAG_USER+7) /* change it for all tasks on the */ /* same level as this one */ #define muT_Quiet (TAG_USER+8) /* for muLogoutA(), don't give a */ /* login prompt, simply logout */ #define muT_UserID (TAG_USER+9) /* UserID for muLoginA() */ #define muT_Password (TAG_USER+10) /* Password for muLoginA(), must */ /* be combined with muT_UserID!! */ #define muT_DefProtection (TAG_USER+11) /* Default protection bits */ /* default is RWED GROUP R OTHER R */ #define muT_All (TAG_USER+12) /* for muLogoutA(), logout until */ /* user stack is empty */ #define muT_NoLog (TAG_USER+13) /* for muLoginA(), only root */ /* * Public User Information Structure * * * For future compatibility, you should ALWAYS use muAllocUserInfo() * to allocate this structure. NEVER do it by yourself!! */ struct muUserInfo { char UserID[muUSERIDSIZE]; UWORD uid; UWORD gid; char UserName[muUSERNAMESIZE]; char HomeDir[muHOMEDIRSIZE]; UWORD NumSecGroups; /* Number of Secondary Groups this */ /* user belongs to */ UWORD *SecGroups; /* Points to an array of NumSecGroups */ /* Secondary Group Numbers */ char Shell[muSHELLSIZE]; }; /* * Public Group Information Structure * * * For future compatibility, you should ALWAYS use muAllocGroupInfo() * to allocate this structure. NEVER do it by yourself!! */ struct muGroupInfo { char GroupID[muGROUPIDSIZE]; UWORD gid; UWORD MgrUid; /* Manager of this group */ char GroupName[muGROUPNAMESIZE]; }; /* * KeyTypes for muGetUserInfo() * muGetGroupInfo() */ #define muKeyType_First (0) #define muKeyType_Next (1) #define muKeyType_gid (4) /* * KeyTypes for muGetUserInfo() only */ #define muKeyType_UserID (2) /* Case-sensitive */ #define muKeyType_uid (3) #define muKeyType_gidNext (5) #define muKeyType_UserName (6) /* Case-insensitive */ #define muKeyType_WUserID (7) /* Case-insensitive, wild cards allowed */ #define muKeyType_WUserName (8) /* Case-insensitive, wild cards allowed */ #define muKeyType_WUserIDNext (9) #define muKeyType_WUserNameNext (10) /* * KeyTypes for muGetGroupInfo() only */ #define muKeyType_GroupID (11) /* Case-sensitive */ #define muKeyType_WGroupID (12) /* Case-insensitive, wild cards allowed */ #define muKeyType_WGroupIDNext (13) #define muKeyType_GroupName (14) /* Case-insensitive */ #define muKeyType_WGroupName (15) /* Case-insensitive, wild cards allowed */ #define muKeyType_WGroupNameNext (16) #define muKeyType_MgrUid (17) #define muKeyType_MgrUidNext (18) /* * Extended Owner Information Structure * * * A pointer to this structure is returned by muGetTaskExtOwner(). * You MUST use muFreeExtOwner() to deallocate it!! */ struct muExtOwner { UWORD uid; UWORD gid; UWORD NumSecGroups; /* Number of Secondary Groups this */ /* user belongs too. */ }; /* NOTE: This structure is followed by a UWORD array containing * the Secondary Group Numbers * Use the following macro to access these group numbers, * e.g. sgid = muSecGroups(extowner)[i]; * * Do not use this macro on a NULL pointer!! */ #define muSecGroups(x) ((UWORD *)((UBYTE *)x+sizeof(struct muExtOwner))) /* * Macro to convert an Extended Owner Information Structure to a ULONG * (cfr. muGetTaskOwner()) */ #define muExtOwner2ULONG(x) ((ULONG)(x ? (x)->uid<<16|(x)->gid : muOWNER_NOBODY)) /* * Packet types (see also :-) */ /* #define ACTION_SET_OWNER 1036 */ /* * Protection bits (see also :-) */ #define muFIBB_SET_UID (31) /* Change owner during execution */ #define muFIBB_SET_GID (30) /* Change group during execution - not yet implemented */ /* FIBB are bit definitions, FIBF are field definitions */ /* Regular RWED bits are 0 == allowed. */ /* NOTE: GRP and OTR RWED permissions are 0 == not allowed! */ /* #define FIBB_OTR_READ 15 Other: file is readable */ /* #define FIBB_OTR_WRITE 14 Other: file is writable */ /* #define FIBB_OTR_EXECUTE 13 Other: file is executable */ /* #define FIBB_OTR_DELETE 12 Other: prevent file from being deleted */ /* #define FIBB_GRP_READ 11 Group: file is readable */ /* #define FIBB_GRP_WRITE 10 Group: file is writable */ /* #define FIBB_GRP_EXECUTE 9 Group: file is executable */ /* #define FIBB_GRP_DELETE 8 Group: prevent file from being deleted */ #define FIBB_HOLD 7 /* #define FIBB_SCRIPT 6 program is a script (execute) file */ /* #define FIBB_PURE 5 program is reentrant and rexecutable */ /* #define FIBB_ARCHIVE 4 cleared whenever file is changed */ /* #define FIBB_READ 3 ignored by old filesystem */ /* #define FIBB_WRITE 2 ignored by old filesystem */ /* #define FIBB_EXECUTE 1 ignored by system, used by Shell */ /* #define FIBB_DELETE 0 prevent file from being deleted */ #define muFIBF_SET_UID (1<