xref: /onnv-gate/usr/src/cmd/oamuser/inc/users.h (revision 12884:8ed2c2ace7da)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57729SJohn.Sonnenschein@Sun.COM  * Common Development and Distribution License (the "License").
67729SJohn.Sonnenschein@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
210Sstevel@tonic-gate /*
22*12884Sgary.winiger@oracle.com  * Copyright (c) 1989, 2010, Oracle and/or its affiliates. All rights reserved.
230Sstevel@tonic-gate  */
240Sstevel@tonic-gate 
250Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
260Sstevel@tonic-gate /*	  All Rights Reserved  	*/
270Sstevel@tonic-gate 
280Sstevel@tonic-gate 
290Sstevel@tonic-gate #ifndef _USERS_H
300Sstevel@tonic-gate #define	_USERS_H
310Sstevel@tonic-gate 
320Sstevel@tonic-gate 
330Sstevel@tonic-gate #include <pwd.h>
340Sstevel@tonic-gate #include <grp.h>
350Sstevel@tonic-gate #include <project.h>
360Sstevel@tonic-gate 
370Sstevel@tonic-gate #define	GROUP		"/etc/group"
380Sstevel@tonic-gate 
390Sstevel@tonic-gate /* max number of projects that can be specified when adding a user */
400Sstevel@tonic-gate #define	NPROJECTS_MAX	1024
410Sstevel@tonic-gate 
420Sstevel@tonic-gate /* validation returns */
430Sstevel@tonic-gate #define	NOTUNIQUE	0	/* not unique */
440Sstevel@tonic-gate #define	RESERVED	1	/* reserved */
450Sstevel@tonic-gate #define	UNIQUE		2	/* is unique */
460Sstevel@tonic-gate #define	TOOBIG		3	/* number too big */
470Sstevel@tonic-gate #define	INVALID		4
480Sstevel@tonic-gate 
490Sstevel@tonic-gate /*
500Sstevel@tonic-gate  * Note: constraints checking for warning (release 2.6),
510Sstevel@tonic-gate  * and these may be enforced in the future releases.
520Sstevel@tonic-gate  */
530Sstevel@tonic-gate #define	WARN_NAME_TOO_LONG	0x1
540Sstevel@tonic-gate #define	WARN_BAD_GROUP_NAME	0x2
550Sstevel@tonic-gate #define	WARN_BAD_LOGNAME_CHAR	0x4
560Sstevel@tonic-gate #define	WARN_BAD_LOGNAME_FIRST	0x8
570Sstevel@tonic-gate #define	WARN_NO_LOWERCHAR	0x10
580Sstevel@tonic-gate #define	WARN_BAD_PROJ_NAME	0x20
590Sstevel@tonic-gate #define	WARN_LOGGED_IN		0x40
600Sstevel@tonic-gate 
61*12884Sgary.winiger@oracle.com /* Exit codes from passmgmt */
620Sstevel@tonic-gate #define	PEX_SUCCESS	0
630Sstevel@tonic-gate #define	PEX_NO_PERM	1
640Sstevel@tonic-gate #define	PEX_SYNTAX	2
650Sstevel@tonic-gate #define	PEX_BADARG	3
660Sstevel@tonic-gate #define	PEX_BADUID	4
670Sstevel@tonic-gate #define	PEX_HOSED_FILES	5
680Sstevel@tonic-gate #define	PEX_FAILED	6
690Sstevel@tonic-gate #define	PEX_MISSING	7
700Sstevel@tonic-gate #define	PEX_BUSY	8
710Sstevel@tonic-gate #define	PEX_BADNAME	9
720Sstevel@tonic-gate 
730Sstevel@tonic-gate #define	REL_PATH(x)	(x && *x != '/')
740Sstevel@tonic-gate 
750Sstevel@tonic-gate /*
760Sstevel@tonic-gate  * interfaces available from the library
770Sstevel@tonic-gate  */
780Sstevel@tonic-gate extern int valid_login(char *, struct passwd **, int *);
790Sstevel@tonic-gate extern int valid_gname(char *, struct group **, int *);
800Sstevel@tonic-gate extern int valid_group(char *, struct group **, int *);
810Sstevel@tonic-gate extern int valid_project(char *, struct project *, void *buf, size_t, int *);
820Sstevel@tonic-gate extern int valid_projname(char *, struct project *, void *buf, size_t, int *);
830Sstevel@tonic-gate extern void warningmsg(int, char *);
840Sstevel@tonic-gate extern void putgrent(struct group *, FILE *);
850Sstevel@tonic-gate 
867729SJohn.Sonnenschein@Sun.COM /* passmgmt */
87*12884Sgary.winiger@oracle.com #define	PASSMGMT	"/usr/lib/passmgmt";
880Sstevel@tonic-gate #endif	/* _USERS_H */
89