home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / new / util / misc / multiuser / include / libraries / multiuser.h < prev   
C/C++ Source or Header  |  1994-07-02  |  18KB  |  523 lines

  1. #ifndef LIBRARIES_MULTIUSER_H
  2. #define LIBRARIES_MULTIUSER_H
  3. /*
  4. **      $VER: multiuser.h 39.14 (29.6.94)
  5. **      MultiUser Release 1.8
  6. **
  7. **      multiuser.library definitions
  8. **
  9. **      (C) Copyright 1993-1994 Geert Uytterhoeven
  10. **          All Rights Reserved
  11. */
  12.  
  13. #ifndef EXEC_TYPES_H
  14. #include <exec/types.h>
  15. #endif  /* EXEC_TYPES_H */
  16.  
  17. #ifndef EXEC_LISTS_H
  18. #include <exec/lists.h>
  19. #endif  /* EXEC_LISTS_H */
  20.  
  21. #ifndef EXEC_LIBRARIES_H
  22. #include <exec/libraries.h>
  23. #endif  /* EXEC_LIBRARIES_H */
  24.  
  25. #ifndef EXEC_EXECBASE_H
  26. #include <exec/execbase.h>
  27. #endif  /* EXEC_EXECBASE_H */
  28.  
  29. #ifndef EXEC_PORTS_H
  30. #include <exec/ports.h>
  31. #endif  /* EXEC_PORTS_H */
  32.  
  33. #ifndef LIBRARIES_DOS_H
  34. #include <libraries/dos.h>
  35. #endif  /* LIBRARIES_DOS_H */
  36.  
  37. #ifndef UTILITY_TAGITEM_H
  38. #include <utility/tagitem.h>
  39. #endif  /* UTILITY_TAGITEM_H */
  40.  
  41. #ifndef LIBRARIES_LOCALE_H
  42. #include <libraries/locale.h>
  43. #endif /* LIBRARIES_LOCALE_H */
  44.  
  45. #define MULTIUSERNAME         "multiuser.library"
  46. #define MULTIUSERVERSION      (39)
  47.  
  48. #define MULTIUSERCATALOGNAME    "multiuser.catalog"
  49. #define MULTIUSERCATALOGVERSION (1)
  50.  
  51.    /*
  52.     *    Reserved users/groups
  53.     *
  54.     *    WARNING: a uid may NOT be zero, a gid may be zero
  55.     */
  56.  
  57. #define muOWNER_NOBODY  (0x00000000)   /* no rights */
  58. #define muOWNER_SYSTEM  (0xffffffff)   /* always owner */
  59.  
  60. #define muMASK_UID      (0xffff0000)   /* Mask for uid bits */
  61. #define muMASK_GID      (0x0000ffff)   /* Mask for gid bits */
  62.  
  63. #define muROOT_UID      (0xffff)       /* super user uid */
  64. #define muROOT_GID      (0xffff)       /* super user gid */
  65.  
  66. #define muNOBODY_UID    (0x0000)       /* nobody uid */
  67.  
  68. #define muUSERIDSIZE    (32)           /* Maximum size for a User ID */
  69. #define muGROUPIDSIZE   (32)           /* Maximum size for a Group ID */
  70. #define muPASSWORDSIZE  (32)           /* Maximum size for a Password */
  71. #define muUSERNAMESIZE  (220)          /* Maximum size for a User Name */
  72. #define muGROUPNAMESIZE (220)          /* Maximum size for a Group Name */
  73. #define muHOMEDIRSIZE   (256)          /* Maximum size for a Home Directory */
  74. #define muSHELLSIZE     (256)          /* Maximum size for a Shell */
  75.  
  76.  
  77.    /*
  78.     *    Password File
  79.     *
  80.     *
  81.     *    For each user, the Password File must contain a line like this:
  82.     *
  83.     *    <UserID>|<Password>|<uid>|<gid>|<UserName>|<HomeDir>|<Shell>
  84.     *
  85.     *    with:
  86.     *
  87.     *       <UserID>    User Login ID (max. muUSERIDSIZE-1 characters)
  88.     *       <PassKey>   Encrypted Password
  89.     *       <uid>       User Number (1 - 65535)
  90.     *       <gid>       Primary Group Number (0 - 65535)
  91.     *       <UserName>  Full User Name (max. muUSERNAMESIZE-1 characters)
  92.     *       <HomeDir>   Home directory (max. muHOMEDIRSIZE-1 characters)
  93.     *       <Shell>     Default Shell (max. muSHELLSIZE-1 characters)
  94.     *                   (not used yet, AS225 compatibility)
  95.     */
  96.  
  97. #define muPasswd_FileName     "passwd"  /* for AS225 compatibility */
  98.  
  99.  
  100.    /*
  101.     *    Group File
  102.     *
  103.     *
  104.     *    This file gives more information about the groups and defines
  105.     *    the secondary groups (other than the primary group) a user
  106.     *    belongs to. It exists out of two parts, separated by a blank line.
  107.     *
  108.     *    The first part contains lines with the format:
  109.     *
  110.     *    <GroupID>|<gid>|<MgrUid>|<GroupName>
  111.     *
  112.     *    with:
  113.     *
  114.     *       <GroupID>   Group short ID (max. muGROUPIDSIZE-1 characters)
  115.     *       <gid>       Group Number (0 - 65535)
  116.     *       <MgrUid>    User Number of this group's manager, 0 for no
  117.     *                   manager. A group's manager must not belong to the
  118.     *                   group.
  119.     *       <GroupName> Full Group Name (max. muGROUPNAMESIZE-1 characters)
  120.     *
  121.     *    NOTE: Not every group must have a line in this file, but at least
  122.     *          one group must have one.
  123.     *
  124.     *
  125.     *    The seconds part contains lines with the format:
  126.     *
  127.     *    <uid>:<gid>[,<gid>...]
  128.     *
  129.     *    with:
  130.     *
  131.     *       <uid>       User Number (1-65535)
  132.     *       <gid>       Group Number (0 - 65535)
  133.     *
  134.     *    If you think you'll exceed the maximum line length (circa 1K),
  135.     *    you may use more than one line per user.
  136.     */
  137.  
  138. #define muGroup_FileName      "MultiUser.group"
  139.  
  140.  
  141.    /*
  142.     *    Configuration File
  143.     *
  144.     *
  145.     *    This file contains lines with options in the form <OPT>=<val>.
  146.     *    0 is used for OFF, 1 for ON.
  147.     *    Defaults to the values between square brackets.
  148.     *
  149.     *    LIMITDOSSETPROTECTION   dos.library/SetProtection() cannot change
  150.     *                            protection bits for GROUP and OTHER [1]
  151.     *    PROFILE                 execute the Profile if it exists [1]
  152.     *    LASTLOGINREQ            display the Lastlogin requester [1]
  153.     *    LOGSTARTUP              log startup [0]
  154.     *    LOGLOGIN                log successful logins [0]
  155.     *    LOGLOGINFAIL            log failed logins [0]
  156.     *    LOGPASSWD               log successful password changes [0]
  157.     *    LOGPASSWDFAIL           log failed password changes [0]
  158.     *    LOGCHECKPASSWD          log successful password checks [0]
  159.     *    LOGCHECKPASSWDFAIL      log failed password checks [0]
  160.     *    PASSWDUIDLEVEL          users with a uid greather than or equal to
  161.     *                            <val> can change their passwords [0]
  162.     *    PASSWDGIDLEVEL          users with a gid greather than or equal to
  163.     *                            <val> can change their passwords [0]
  164.     *
  165.     *    NOTE: if a user has a uid less than the PASSWDUIDLEVEL AND a gid
  166.     *          less than PASSWDGIDLEVEL he/she is NOT allowed to change
  167.     *          his/her password!
  168.     */
  169.  
  170. #define muConfig_FileName     "MultiUser.config"
  171.  
  172.  
  173.    /*
  174.     *    Log File
  175.     */
  176.  
  177. #define muLog_FileName        "MultiUser.log"
  178.  
  179.  
  180.    /*
  181.     *    Lastlogin File
  182.     */
  183.  
  184. #define muLastLogin_FileName  ".lastlogin"
  185.  
  186.  
  187.    /*
  188.     *    Profile
  189.     */
  190.  
  191. #define muProfile_FileName    ".profile"
  192.  
  193.  
  194.    /*
  195.     *    Plan file
  196.     */
  197.  
  198. #define muPlan_FileName       ".plan"
  199.  
  200.  
  201.    /*
  202.     *    Key File
  203.     *
  204.     *
  205.     *    This file must be present in the root directory of every volume
  206.     *    that uses the MultiUserFileSystem. It must contain 3 lines:
  207.     *
  208.     *       - a pseudo random ASCII key (max. 1023 characters).
  209.     *       - the directory of the password file, if located on this volume,
  210.     *         otherwise an empty line (no spaces!).
  211.     *           e.g. ":MultiUser"
  212.     *           e.g. ":inet/db" for AS225 compatibility
  213.     *       - the directory of the configuration file, if located on this
  214.     *         volume, otherwise an empty line (no spaces!).
  215.     *           e.g. ":MultiUser"
  216.     *
  217.     *    If there is ANY inconsistency the system will refuse to work!!
  218.     */
  219.  
  220. #define muKey_FileName        ":.MultiUser.keyfile"
  221.  
  222.  
  223.    /*
  224.     *    Tags for muLogoutA()
  225.     *             muLoginA()
  226.     *             muSetDefProtectionA()
  227.     */
  228.  
  229. #define muT_Input          (TAG_USER+1)   /* filehandle - default is Input() */
  230. #define muT_Output         (TAG_USER+2)   /* filehandle - default is Output() */
  231. #define muT_Graphical      (TAG_USER+3)   /* boolean - default is FALSE */
  232. #define muT_PubScrName     (TAG_USER+4)   /* name of public screen */
  233. #define muT_Task           (TAG_USER+5)   /* task (NOT the name!!) */
  234. #define muT_Own            (TAG_USER+6)   /* make a task owned by this user */
  235. #define muT_Global         (TAG_USER+7)   /* change it for all tasks on the */
  236.                                           /* same level as this one */
  237. #define muT_Quiet          (TAG_USER+8)   /* for muLogoutA(), don't give a */
  238.                                           /* login prompt, simply logout */
  239. #define muT_UserID         (TAG_USER+9)   /* UserID for muLoginA() */
  240. #define muT_Password       (TAG_USER+10)  /* Password for muLoginA(), must */
  241.                                           /* be combined with muT_UserID!! */
  242. #define muT_DefProtection  (TAG_USER+11)  /* Default protection bits */
  243.                                           /* default is RWED GROUP R OTHER R */
  244. #define muT_All            (TAG_USER+12)  /* for muLogoutA(), logout until */
  245.                                           /* user stack is empty */
  246. #define m