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