11590Srgrimes/* 21590Srgrimes * Copyright (c) 1988, 1993, 1994 31590Srgrimes * The Regents of the University of California. All rights reserved. 496201Sdes * Copyright (c) 2002 Networks Associates Technology, Inc. 596201Sdes * All rights reserved. 61590Srgrimes * 796201Sdes * Portions of this software were developed for the FreeBSD Project by 896201Sdes * ThinkSec AS and NAI Labs, the Security Research Division of Network 996201Sdes * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 1096201Sdes * ("CBOSS"), as part of the DARPA CHATS research program. 1196201Sdes * 121590Srgrimes * Redistribution and use in source and binary forms, with or without 131590Srgrimes * modification, are permitted provided that the following conditions 141590Srgrimes * are met: 151590Srgrimes * 1. Redistributions of source code must retain the above copyright 161590Srgrimes * notice, this list of conditions and the following disclaimer. 171590Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 181590Srgrimes * notice, this list of conditions and the following disclaimer in the 191590Srgrimes * documentation and/or other materials provided with the distribution. 201590Srgrimes * 3. All advertising materials mentioning features or use of this software 211590Srgrimes * must display the following acknowledgement: 221590Srgrimes * This product includes software developed by the University of 231590Srgrimes * California, Berkeley and its contributors. 241590Srgrimes * 4. Neither the name of the University nor the names of its contributors 251590Srgrimes * may be used to endorse or promote products derived from this software 261590Srgrimes * without specific prior written permission. 271590Srgrimes * 281590Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 291590Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 301590Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 311590Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 321590Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 331590Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 341590Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 351590Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 361590Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 371590Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 381590Srgrimes * SUCH DAMAGE. 391590Srgrimes * 401590Srgrimes * @(#)chpass.h 8.4 (Berkeley) 4/2/94 4192920Simp * $FreeBSD: releng/10.3/usr.bin/chpass/chpass.h 227228 2011-11-06 17:20:44Z ed $ 421590Srgrimes */ 431590Srgrimes 441590Srgrimesstruct passwd; 451590Srgrimes 461590Srgrimestypedef struct _entry { 4793086Smarkm const char *prompt; 4893086Smarkm int (*func)(char *, struct passwd *, struct _entry *); 4996201Sdes int restricted; 5096201Sdes size_t len; 51227228Sed const char *except, *save; 521590Srgrimes} ENTRY; 531590Srgrimes 541590Srgrimes/* Field numbers. */ 551590Srgrimes#define E_BPHONE 8 561590Srgrimes#define E_HPHONE 9 571590Srgrimes#define E_LOCATE 10 581590Srgrimes#define E_NAME 7 5938307Sthepish#define E_OTHER 11 6038773Smarkm#define E_SHELL 13 611590Srgrimes 621590Srgrimesextern ENTRY list[]; 6396201Sdesextern int master_mode; 641590Srgrimes 6592920Simpint atot(char *, time_t *); 6696201Sdesstruct passwd *edit(const char *, struct passwd *); 67124692Scharnierint ok_shell(char *); 68124692Scharnierchar *dup_shell(char *); 6992920Simpint p_change(char *, struct passwd *, ENTRY *); 7092920Simpint p_class(char *, struct passwd *, ENTRY *); 7192920Simpint p_expire(char *, struct passwd *, ENTRY *); 7292920Simpint p_gecos(char *, struct passwd *, ENTRY *); 7392920Simpint p_gid(char *, struct passwd *, ENTRY *); 7492920Simpint p_hdir(char *, struct passwd *, ENTRY *); 7592920Simpint p_login(char *, struct passwd *, ENTRY *); 7692920Simpint p_passwd(char *, struct passwd *, ENTRY *); 7792920Simpint p_shell(char *, struct passwd *, ENTRY *); 7892920Simpint p_uid(char *, struct passwd *, ENTRY *); 7992920Simpchar *ttoa(time_t); 80