/*-1* SPDX-License-Identifier: BSD-4-Clause2*3* Copyright (c) 1988, 1993, 19944* The Regents of the University of California. All rights reserved.5* Copyright (c) 2002 Networks Associates Technology, Inc.6* All rights reserved.7*8* Portions of this software were developed for the FreeBSD Project by9* ThinkSec AS and NAI Labs, the Security Research Division of Network10* Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-803511* ("CBOSS"), as part of the DARPA CHATS research program.12*13* Redistribution and use in source and binary forms, with or without14* modification, are permitted provided that the following conditions15* are met:16* 1. Redistributions of source code must retain the above copyright17* notice, this list of conditions and the following disclaimer.18* 2. Redistributions in binary form must reproduce the above copyright19* notice, this list of conditions and the following disclaimer in the20* documentation and/or other materials provided with the distribution.21* 3. All advertising materials mentioning features or use of this software22* must display the following acknowledgement:23* This product includes software developed by the University of24* California, Berkeley and its contributors.25* 4. Neither the name of the University nor the names of its contributors26* may be used to endorse or promote products derived from this software27* without specific prior written permission.28*29* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND30* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE31* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE32* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE33* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL34* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS35* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)36* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT37* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY38* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF39* SUCH DAMAGE.40*/4142struct passwd;4344typedef struct _entry {45const char *prompt;46int (*func)(char *, struct passwd *, struct _entry *);47int restricted;48size_t len;49const char *except, *save;50} ENTRY;5152/* Field numbers. */53#define E_BPHONE 854#define E_HPHONE 955#define E_LOCATE 1056#define E_NAME 757#define E_OTHER 1158#define E_SHELL 135960extern ENTRY list[];61extern int master_mode;6263int atot(char *, time_t *);64struct passwd *edit(const char *, struct passwd *);65int ok_shell(char *);66char *dup_shell(char *);67int p_change(char *, struct passwd *, ENTRY *);68int p_class(char *, struct passwd *, ENTRY *);69int p_expire(char *, struct passwd *, ENTRY *);70int p_gecos(char *, struct passwd *, ENTRY *);71int p_gid(char *, struct passwd *, ENTRY *);72int p_hdir(char *, struct passwd *, ENTRY *);73int p_login(char *, struct passwd *, ENTRY *);74int p_passwd(char *, struct passwd *, ENTRY *);75int p_shell(char *, struct passwd *, ENTRY *);76int p_uid(char *, struct passwd *, ENTRY *);77char *ttoa(time_t);787980