pwd.h revision 1540
180609Sdd/*-
280609Sdd * Copyright (c) 1989, 1993
380609Sdd *	The Regents of the University of California.  All rights reserved.
480609Sdd * (c) UNIX System Laboratories, Inc.
580609Sdd * All or some portions of this file are derived from material licensed
680609Sdd * to the University of California by American Telephone and Telegraph
780609Sdd * Co. or Unix System Laboratories, Inc. and are reproduced herein with
880609Sdd * the permission of UNIX System Laboratories, Inc.
980609Sdd *
1080609Sdd * Redistribution and use in source and binary forms, with or without
1180609Sdd * modification, are permitted provided that the following conditions
1280609Sdd * are met:
1380609Sdd * 1. Redistributions of source code must retain the above copyright
1480609Sdd *    notice, this list of conditions and the following disclaimer.
1580609Sdd * 2. Redistributions in binary form must reproduce the above copyright
1680609Sdd *    notice, this list of conditions and the following disclaimer in the
1780609Sdd *    documentation and/or other materials provided with the distribution.
1880609Sdd * 3. All advertising materials mentioning features or use of this software
1980609Sdd *    must display the following acknowledgement:
2080609Sdd *	This product includes software developed by the University of
2180609Sdd *	California, Berkeley and its contributors.
2280609Sdd * 4. Neither the name of the University nor the names of its contributors
2380609Sdd *    may be used to endorse or promote products derived from this software
2480609Sdd *    without specific prior written permission.
2580609Sdd *
2680609Sdd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2780609Sdd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2880609Sdd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2980609Sdd * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
3080609Sdd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
3180609Sdd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
3280609Sdd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
3380609Sdd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3480609Sdd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3582094Sdd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3680609Sdd * SUCH DAMAGE.
3780609Sdd *
3880609Sdd *	@(#)pwd.h	8.2 (Berkeley) 1/21/94
3980609Sdd */
4080609Sdd
4180609Sdd#ifndef _PWD_H_
4280609Sdd#define	_PWD_H_
4380609Sdd
4480609Sdd#include <sys/types.h>
4580609Sdd
4681343Sdd#ifndef _POSIX_SOURCE
4780609Sdd#define	_PATH_PASSWD		"/etc/passwd"
4880609Sdd#define	_PATH_MASTERPASSWD	"/etc/master.passwd"
4981343Sdd
5081343Sdd#define	_PATH_MP_DB		"/etc/pwd.db"
5180609Sdd#define	_PATH_SMP_DB		"/etc/spwd.db"
5280609Sdd
5380609Sdd#define	_PATH_PWD_MKDB		"/usr/sbin/pwd_mkdb"
5480609Sdd
5580609Sdd#define	_PW_KEYBYNAME		'1'	/* stored by name */
5680609Sdd#define	_PW_KEYBYNUM		'2'	/* stored by entry in the "file" */
5780609Sdd#define	_PW_KEYBYUID		'3'	/* stored by uid */
5880609Sdd
5980609Sdd#define	_PASSWORD_EFMT1		'_'	/* extended encryption format */
6080609Sdd
6180609Sdd#define	_PASSWORD_LEN		128	/* max length, not counting NULL */
6280609Sdd#endif
6380609Sdd
6480609Sddstruct passwd {
6580609Sdd	char	*pw_name;		/* user name */
6680609Sdd	char	*pw_passwd;		/* encrypted password */
6780609Sdd	int	pw_uid;			/* user uid */
6880609Sdd	int	pw_gid;			/* user gid */
6980609Sdd	time_t	pw_change;		/* password change time */
7080609Sdd	char	*pw_class;		/* user access class */
7180609Sdd	char	*pw_gecos;		/* Honeywell login info */
7280609Sdd	char	*pw_dir;		/* home directory */
73189092Sed	char	*pw_shell;		/* default shell */
7480609Sdd	time_t	pw_expire;		/* account expiration */
75189092Sed};
7680609Sdd
77189092Sed#include <sys/cdefs.h>
7880609Sdd
7980609Sdd__BEGIN_DECLS
8080609Sddstruct passwd	*getpwuid __P((uid_t));
8180609Sddstruct passwd	*getpwnam __P((const char *));
8280609Sdd#ifndef _POSIX_SOURCE
8381343Sddstruct passwd	*getpwent __P((void));
84189092Sedint		 setpassent __P((int));
8580609Sddint		 setpwent __P((void));
8681343Sddvoid		 endpwent __P((void));
87189092Sed#endif
8880609Sdd__END_DECLS
8981343Sdd
90189092Sed#endif /* !_PWD_H_ */
9180609Sdd