17c478bdstevel@tonic-gate/*
27c478bdstevel@tonic-gate * CDDL HEADER START
37c478bdstevel@tonic-gate *
47c478bdstevel@tonic-gate * The contents of this file are subject to the terms of the
57c478bdstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only
67c478bdstevel@tonic-gate * (the "License").  You may not use this file except in compliance
77c478bdstevel@tonic-gate * with the License.
87c478bdstevel@tonic-gate *
97c478bdstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bdstevel@tonic-gate * or http://www.opensolaris.org/os/licensing.
117c478bdstevel@tonic-gate * See the License for the specific language governing permissions
127c478bdstevel@tonic-gate * and limitations under the License.
137c478bdstevel@tonic-gate *
147c478bdstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each
157c478bdstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bdstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the
177c478bdstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying
187c478bdstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bdstevel@tonic-gate *
207c478bdstevel@tonic-gate * CDDL HEADER END
217c478bdstevel@tonic-gate */
227c478bdstevel@tonic-gate/*
237c478bdstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
247c478bdstevel@tonic-gate * Use is subject to license terms.
257c478bdstevel@tonic-gate */
267c478bdstevel@tonic-gate
277c478bdstevel@tonic-gate/*	Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T	*/
28b4203d7Marcel Telka/*	  All Rights Reserved	*/
297c478bdstevel@tonic-gate
307c478bdstevel@tonic-gate
317c478bdstevel@tonic-gate#ifndef	_USERDEFS_H
327c478bdstevel@tonic-gate#define	_USERDEFS_H
337c478bdstevel@tonic-gate
347c478bdstevel@tonic-gate#include <project.h>
357c478bdstevel@tonic-gate
367c478bdstevel@tonic-gate#ifdef	__cplusplus
377c478bdstevel@tonic-gateextern "C" {
387c478bdstevel@tonic-gate#endif
397c478bdstevel@tonic-gate
407c478bdstevel@tonic-gate/*
417c478bdstevel@tonic-gate * The definitions in this file are local to the OA&M subsystem.  General
427c478bdstevel@tonic-gate * use is not encouraged.
437c478bdstevel@tonic-gate */
447c478bdstevel@tonic-gate
457c478bdstevel@tonic-gate/* User/group default values */
467c478bdstevel@tonic-gate#define	DEFGID		99	/* max reserved group id */
477c478bdstevel@tonic-gate#define	DEFRID		99
487c478bdstevel@tonic-gate#define	DEFPROJ		3
497c478bdstevel@tonic-gate#define	DEFPROJNAME	"default"
507c478bdstevel@tonic-gate#define	DEFGROUP	1
517c478bdstevel@tonic-gate#define	DEFGNAME	"other"
527c478bdstevel@tonic-gate#define	DEFPARENT	"/home"
537c478bdstevel@tonic-gate#define	DEFSKL		"/etc/skel"
547c478bdstevel@tonic-gate#define	DEFSHL		"/bin/sh"
557c478bdstevel@tonic-gate#define	DEFROLESHL	"/bin/pfsh"
567c478bdstevel@tonic-gate#define	DEFINACT	0
577c478bdstevel@tonic-gate#define	DEFEXPIRE	""
587c478bdstevel@tonic-gate#define	DEFAUTH		""
597c478bdstevel@tonic-gate#define	DEFPROF		""
607c478bdstevel@tonic-gate#define	DEFROLEPROF	"All"
617c478bdstevel@tonic-gate#define	DEFROLE		""
627c478bdstevel@tonic-gate#define	DEFLIMPRIV	""
637c478bdstevel@tonic-gate#define	DEFDFLTPRIV	""
647c478bdstevel@tonic-gate#define	DEFLOCK_AFTER_RETRIES	""
657c478bdstevel@tonic-gate
667c478bdstevel@tonic-gate/* Defaults file keywords */
677c478bdstevel@tonic-gate#define	RIDSTR		"defrid="
687c478bdstevel@tonic-gate#define	GIDSTR		"defgroup="
697c478bdstevel@tonic-gate#define	GNAMSTR		"defgname="
707c478bdstevel@tonic-gate#define	PARSTR		"defparent="
717c478bdstevel@tonic-gate#define	SKLSTR		"defskel="
727c478bdstevel@tonic-gate#define	SHELLSTR	"defshell="
737c478bdstevel@tonic-gate#define	INACTSTR	"definact="
747c478bdstevel@tonic-gate#define	EXPIRESTR	"defexpire="
757c478bdstevel@tonic-gate#define	AUTHSTR		"defauthorization="
767c478bdstevel@tonic-gate#define	PROFSTR		"defprofile="
777c478bdstevel@tonic-gate#define	ROLESTR		"defrole="
787c478bdstevel@tonic-gate#define	PROJSTR		"defproj="
797c478bdstevel@tonic-gate#define	PROJNMSTR	"defprojname="
807c478bdstevel@tonic-gate#define	LIMPRSTR	"deflimitpriv="
817c478bdstevel@tonic-gate#define	DFLTPRSTR	"defdefaultpriv="
827c478bdstevel@tonic-gate#define	FHEADER		"#	Default values for useradd.  Changed "
837c478bdstevel@tonic-gate#define	FHEADER_ROLE	"#	Default values for roleadd.  Changed "
847c478bdstevel@tonic-gate#define	LOCK_AFTER_RETRIESSTR	"deflock_after_retries="
857c478bdstevel@tonic-gate
867c478bdstevel@tonic-gate/* Defaults file */
877c478bdstevel@tonic-gate#define	DEFFILE		"/usr/sadm/defadduser"
887c478bdstevel@tonic-gate#define	DEFROLEFILE	"/usr/sadm/defaddrole"
897c478bdstevel@tonic-gate#define	GROUP		"/etc/group"
907c478bdstevel@tonic-gate
917c478bdstevel@tonic-gate/* various limits */
927c478bdstevel@tonic-gate#define	MAXGLEN		9	/* max length of group name */
937c478bdstevel@tonic-gate#define	MAXDLEN		80	/* max length of a date string */
947c478bdstevel@tonic-gate
957c478bdstevel@tonic-gate/* defaults structure */
967c478bdstevel@tonic-gatestruct userdefs {
977c478bdstevel@tonic-gate	int defrid;		/* highest reserved uid */
987c478bdstevel@tonic-gate	int defgroup;		/* default group id */
997c478bdstevel@tonic-gate	char *defgname;		/* default group name */
1007c478bdstevel@tonic-gate	char *defparent;	/* default base directory for new logins */
1017c478bdstevel@tonic-gate	char *defskel;		/* default skel directory */
1027c478bdstevel@tonic-gate	char *defshell;		/* default shell */
1037c478bdstevel@tonic-gate	int definact;		/* default inactive */
1047c478bdstevel@tonic-gate	char *defexpire;		/* default expire date */
1057c478bdstevel@tonic-gate	char *defauth;		/* default authorization */
1067c478bdstevel@tonic-gate	char *defprof;		/* default profile */
1077c478bdstevel@tonic-gate	char *defrole;		/* default role */
1087c478bdstevel@tonic-gate	projid_t defproj;	/* default project id */
1097c478bdstevel@tonic-gate	char *defprojname;	/* default project name */
1107c478bdstevel@tonic-gate	char *deflimpriv;	/* default limitpriv */
1117c478bdstevel@tonic-gate	char *defdfltpriv;	/* default defaultpriv */
1127c478bdstevel@tonic-gate	char *deflock_after_retries;	/* default lock_after_retries */
1137c478bdstevel@tonic-gate
1147c478bdstevel@tonic-gate};
1157c478bdstevel@tonic-gate
1167c478bdstevel@tonic-gate/* exit() values for user/group commands */
1177c478bdstevel@tonic-gate
1187c478bdstevel@tonic-gate/* Everything succeeded */
1197c478bdstevel@tonic-gate#define	EX_SUCCESS	0
1207c478bdstevel@tonic-gate
1217c478bdstevel@tonic-gate/* No permission */
1227c478bdstevel@tonic-gate#define	EX_NO_PERM	1
1237c478bdstevel@tonic-gate
1247c478bdstevel@tonic-gate/* Command syntax error */
1257c478bdstevel@tonic-gate#define	EX_SYNTAX	2
1267c478bdstevel@tonic-gate
1277c478bdstevel@tonic-gate/* Invalid argument given */
1287c478bdstevel@tonic-gate#define	EX_BADARG	3
1297c478bdstevel@tonic-gate
1307c478bdstevel@tonic-gate/* A gid or uid already exists */
1317c478bdstevel@tonic-gate#define	EX_ID_EXISTS	4
1327c478bdstevel@tonic-gate
1337c478bdstevel@tonic-gate/* PASSWD and SHADOW are inconsistent with each other */
1347c478bdstevel@tonic-gate#define	EX_INCONSISTENT	5
1357c478bdstevel@tonic-gate
1367c478bdstevel@tonic-gate/* A group or user name  doesn't exist */
1377c478bdstevel@tonic-gate#define	EX_NAME_NOT_EXIST	6
1387c478bdstevel@tonic-gate
1397c478bdstevel@tonic-gate/* GROUP, PASSWD, or SHADOW file missing */
1407c478bdstevel@tonic-gate#define	EX_MISSING	7
1417c478bdstevel@tonic-gate
1427c478bdstevel@tonic-gate/* GROUP, PASSWD, or SHAWOW file is busy */
1437c478bdstevel@tonic-gate#define	EX_BUSY	8
1447c478bdstevel@tonic-gate
1457c478bdstevel@tonic-gate/* A group or user name already exists */
1467c478bdstevel@tonic-gate#define	EX_NAME_EXISTS	9
1477c478bdstevel@tonic-gate
1487c478bdstevel@tonic-gate/* Unable to update GROUP, PASSWD, or SHADOW file */
1497c478bdstevel@tonic-gate#define	EX_UPDATE	10
1507c478bdstevel@tonic-gate
1517c478bdstevel@tonic-gate/* Not enough space */
1527c478bdstevel@tonic-gate#define	EX_NOSPACE	11
1537c478bdstevel@tonic-gate
1547c478bdstevel@tonic-gate/* Unable to create/remove/move home directory */
1557c478bdstevel@tonic-gate#define	EX_HOMEDIR	12
1567c478bdstevel@tonic-gate
1577c478bdstevel@tonic-gate/* new login already in use */
1587c478bdstevel@tonic-gate#define	EX_NL_USED	13
1597c478bdstevel@tonic-gate
1607c478bdstevel@tonic-gate/* Unexpected failure */
1617c478bdstevel@tonic-gate#define	EX_FAILURE	14
1627c478bdstevel@tonic-gate
1637c478bdstevel@tonic-gate/* A user name is in a non-local name service */
1647c478bdstevel@tonic-gate#define	EX_NOT_LOCAL	15
1657c478bdstevel@tonic-gate
1667c478bdstevel@tonic-gate#ifdef	__cplusplus
1677c478bdstevel@tonic-gate}
1687c478bdstevel@tonic-gate#endif
1697c478bdstevel@tonic-gate
1707c478bdstevel@tonic-gate#endif	/* _USERDEFS_H */
171