xref: /original-bsd/include/pwd.h (revision 333da485)
1 /*-
2  * Copyright (c) 1989, 1993
3  *	The Regents of the University of California.  All rights reserved.
4  * (c) UNIX System Laboratories, Inc.
5  * All or some portions of this file are derived from material licensed
6  * to the University of California by American Telephone and Telegraph
7  * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8  * the permission of UNIX System Laboratories, Inc.
9  *
10  * %sccs.include.redist.c%
11  *
12  *	@(#)pwd.h	8.2 (Berkeley) 01/21/94
13  */
14 
15 #ifndef _PWD_H_
16 #define	_PWD_H_
17 
18 #include <sys/types.h>
19 
20 #ifndef _POSIX_SOURCE
21 #define	_PATH_PASSWD		"/etc/passwd"
22 #define	_PATH_MASTERPASSWD	"/etc/master.passwd"
23 
24 #define	_PATH_MP_DB		"/etc/pwd.db"
25 #define	_PATH_SMP_DB		"/etc/spwd.db"
26 
27 #define	_PATH_PWD_MKDB		"/usr/sbin/pwd_mkdb"
28 
29 #define	_PW_KEYBYNAME		'1'	/* stored by name */
30 #define	_PW_KEYBYNUM		'2'	/* stored by entry in the "file" */
31 #define	_PW_KEYBYUID		'3'	/* stored by uid */
32 
33 #define	_PASSWORD_EFMT1		'_'	/* extended encryption format */
34 
35 #define	_PASSWORD_LEN		128	/* max length, not counting NULL */
36 #endif
37 
38 struct passwd {
39 	char	*pw_name;		/* user name */
40 	char	*pw_passwd;		/* encrypted password */
41 	int	pw_uid;			/* user uid */
42 	int	pw_gid;			/* user gid */
43 	time_t	pw_change;		/* password change time */
44 	char	*pw_class;		/* user access class */
45 	char	*pw_gecos;		/* Honeywell login info */
46 	char	*pw_dir;		/* home directory */
47 	char	*pw_shell;		/* default shell */
48 	time_t	pw_expire;		/* account expiration */
49 };
50 
51 #include <sys/cdefs.h>
52 
53 __BEGIN_DECLS
54 struct passwd	*getpwuid __P((uid_t));
55 struct passwd	*getpwnam __P((const char *));
56 #ifndef _POSIX_SOURCE
57 struct passwd	*getpwent __P((void));
58 int		 setpassent __P((int));
59 int		 setpwent __P((void));
60 void		 endpwent __P((void));
61 #endif
62 __END_DECLS
63 
64 #endif /* !_PWD_H_ */
65