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