home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / ixemul-45.0-inc-bin.lha / include / amitcp / usergroup.h < prev   
C/C++ Source or Header  |  1996-10-12  |  2KB  |  74 lines

  1. #ifndef LIBRARIES_USERGROUP_H
  2. #define LIBRARIES_USERGROUP_H \
  3.        "$Id: usergroup.h,v 4.2 1994/10/05 23:18:49 ppessi Exp $"
  4. /*
  5.  *    Definitions of AmiTCP/IP usergroup.library for 32 bit C compilers
  6.  *
  7.  *    Copyright © 1994 AmiTCP/IP Group,
  8.  *             Network Solutions Development, Inc.
  9.  *             All rights reserved.
  10.  */
  11.  
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif
  15.  
  16. #ifndef PWD_H
  17. #include <pwd.h>
  18. #endif
  19. #ifndef GRP_H
  20. #include <grp.h>
  21. #endif
  22. #ifndef UTMP_H
  23. #include <utmp.h>
  24. #endif
  25.  
  26. #include <sys/param.h>
  27.  
  28. #define USERGROUPNAME "AmiTCP:libs/usergroup.library"
  29.  
  30. /* Extended password encryption begins with underscore */
  31. #define _PASSWORD_EFMT1 '_'
  32.  
  33. /* Maximum length for password */
  34. #define _PASSWORD_LEN    128
  35.  
  36. /* A user can belong to NGROUPS different groups */
  37. /* #define NGROUPS 32 */
  38.  
  39. /* Max length of a login name */
  40. /* #define MAXLOGNAME       32 */
  41.  
  42. /* Credentials of a process */
  43. struct UserGroupCredentials {
  44.   uid_t   cr_ruid;
  45.   gid_t   cr_rgid;
  46.   mode_t  cr_umask;        /* umask */
  47.   uid_t   cr_euid;
  48.   short   cr_ngroups;        /* number of groups */
  49.   gid_t   cr_groups[NGROUPS];
  50.   pid_t   cr_session;
  51.   char      cr_login[MAXLOGNAME]; /* setlogin() name */
  52. };
  53.  
  54. /*
  55.  * ID conversion macros
  56.  */
  57. #define UG2MU(id) ((id) == 0 ? 65535 : (id) == -2 ? 0 : (id))
  58. #define MU2UG(id) ((id) == 65535 ? 0L : (id) == 0L ? -2L : (id))
  59.  
  60. /*
  61.  * Context tags
  62.  */
  63. #define UGT_ERRNOBPTR 0x80000001
  64. #define UGT_ERRNOWPTR 0x80000002
  65. #define UGT_ERRNOLPTR 0x80000004
  66. #define UGT_ERRNOPTR(size)\
  67.   ((size == 4) ? UGT_ERRNOLPTR :\
  68.    (size == 2) ? UGT_ERRNOWPTR :\
  69.    (size == 1) ? UGT_ERRNOBPTR : 1L)
  70. #define UGT_OWNER     0x80000011
  71. #define UGT_INTRMASK  0x80000010
  72.  
  73. #endif /* LIBRARIES_USERGROUP_H */
  74.