xref: /illumos-gate/usr/src/head/userdefs.h (revision b4203d757c7c247e39c94c09a94021a3a8121062)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28 /*	  All Rights Reserved	*/
29 
30 
31 #ifndef	_USERDEFS_H
32 #define	_USERDEFS_H
33 
34 #include <project.h>
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * The definitions in this file are local to the OA&M subsystem.  General
42  * use is not encouraged.
43  */
44 
45 /* User/group default values */
46 #define	DEFGID		99	/* max reserved group id */
47 #define	DEFRID		99
48 #define	DEFPROJ		3
49 #define	DEFPROJNAME	"default"
50 #define	DEFGROUP	1
51 #define	DEFGNAME	"other"
52 #define	DEFPARENT	"/home"
53 #define	DEFSKL		"/etc/skel"
54 #define	DEFSHL		"/bin/sh"
55 #define	DEFROLESHL	"/bin/pfsh"
56 #define	DEFINACT	0
57 #define	DEFEXPIRE	""
58 #define	DEFAUTH		""
59 #define	DEFPROF		""
60 #define	DEFROLEPROF	"All"
61 #define	DEFROLE		""
62 #define	DEFLIMPRIV	""
63 #define	DEFDFLTPRIV	""
64 #define	DEFLOCK_AFTER_RETRIES	""
65 
66 /* Defaults file keywords */
67 #define	RIDSTR		"defrid="
68 #define	GIDSTR		"defgroup="
69 #define	GNAMSTR		"defgname="
70 #define	PARSTR		"defparent="
71 #define	SKLSTR		"defskel="
72 #define	SHELLSTR	"defshell="
73 #define	INACTSTR	"definact="
74 #define	EXPIRESTR	"defexpire="
75 #define	AUTHSTR		"defauthorization="
76 #define	PROFSTR		"defprofile="
77 #define	ROLESTR		"defrole="
78 #define	PROJSTR		"defproj="
79 #define	PROJNMSTR	"defprojname="
80 #define	LIMPRSTR	"deflimitpriv="
81 #define	DFLTPRSTR	"defdefaultpriv="
82 #define	FHEADER		"#	Default values for useradd.  Changed "
83 #define	FHEADER_ROLE	"#	Default values for roleadd.  Changed "
84 #define	LOCK_AFTER_RETRIESSTR	"deflock_after_retries="
85 
86 /* Defaults file */
87 #define	DEFFILE		"/usr/sadm/defadduser"
88 #define	DEFROLEFILE	"/usr/sadm/defaddrole"
89 #define	GROUP		"/etc/group"
90 
91 /* various limits */
92 #define	MAXGLEN		9	/* max length of group name */
93 #define	MAXDLEN		80	/* max length of a date string */
94 
95 /* defaults structure */
96 struct userdefs {
97 	int defrid;		/* highest reserved uid */
98 	int defgroup;		/* default group id */
99 	char *defgname;		/* default group name */
100 	char *defparent;	/* default base directory for new logins */
101 	char *defskel;		/* default skel directory */
102 	char *defshell;		/* default shell */
103 	int definact;		/* default inactive */
104 	char *defexpire;		/* default expire date */
105 	char *defauth;		/* default authorization */
106 	char *defprof;		/* default profile */
107 	char *defrole;		/* default role */
108 	projid_t defproj;	/* default project id */
109 	char *defprojname;	/* default project name */
110 	char *deflimpriv;	/* default limitpriv */
111 	char *defdfltpriv;	/* default defaultpriv */
112 	char *deflock_after_retries;	/* default lock_after_retries */
113 
114 };
115 
116 /* exit() values for user/group commands */
117 
118 /* Everything succeeded */
119 #define	EX_SUCCESS	0
120 
121 /* No permission */
122 #define	EX_NO_PERM	1
123 
124 /* Command syntax error */
125 #define	EX_SYNTAX	2
126 
127 /* Invalid argument given */
128 #define	EX_BADARG	3
129 
130 /* A gid or uid already exists */
131 #define	EX_ID_EXISTS	4
132 
133 /* PASSWD and SHADOW are inconsistent with each other */
134 #define	EX_INCONSISTENT	5
135 
136 /* A group or user name  doesn't exist */
137 #define	EX_NAME_NOT_EXIST	6
138 
139 /* GROUP, PASSWD, or SHADOW file missing */
140 #define	EX_MISSING	7
141 
142 /* GROUP, PASSWD, or SHAWOW file is busy */
143 #define	EX_BUSY	8
144 
145 /* A group or user name already exists */
146 #define	EX_NAME_EXISTS	9
147 
148 /* Unable to update GROUP, PASSWD, or SHADOW file */
149 #define	EX_UPDATE	10
150 
151 /* Not enough space */
152 #define	EX_NOSPACE	11
153 
154 /* Unable to create/remove/move home directory */
155 #define	EX_HOMEDIR	12
156 
157 /* new login already in use */
158 #define	EX_NL_USED	13
159 
160 /* Unexpected failure */
161 #define	EX_FAILURE	14
162 
163 /* A user name is in a non-local name service */
164 #define	EX_NOT_LOCAL	15
165 
166 #ifdef	__cplusplus
167 }
168 #endif
169 
170 #endif	/* _USERDEFS_H */
171