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