xref: /illumos-gate/usr/src/cmd/sendmail/include/sm/mbdb.h (revision 2a8bcb4e)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright (c) 2001-2002 Sendmail, Inc. and its suppliers.
3*7c478bd9Sstevel@tonic-gate  *      All rights reserved.
4*7c478bd9Sstevel@tonic-gate  *
5*7c478bd9Sstevel@tonic-gate  * By using this file, you agree to the terms and conditions set
6*7c478bd9Sstevel@tonic-gate  * forth in the LICENSE file which can be found at the top level of
7*7c478bd9Sstevel@tonic-gate  * the sendmail distribution.
8*7c478bd9Sstevel@tonic-gate  *
9*7c478bd9Sstevel@tonic-gate  *	$Id: mbdb.h,v 1.6 2002/05/24 20:50:14 gshapiro Exp $
10*7c478bd9Sstevel@tonic-gate  */
11*7c478bd9Sstevel@tonic-gate 
12*7c478bd9Sstevel@tonic-gate #ifndef SM_MBDB_H
13*7c478bd9Sstevel@tonic-gate # define SM_MBDB_H
14*7c478bd9Sstevel@tonic-gate 
15*7c478bd9Sstevel@tonic-gate #include <pwd.h>
16*7c478bd9Sstevel@tonic-gate #include <sm/types.h>
17*7c478bd9Sstevel@tonic-gate #include <sm/limits.h>
18*7c478bd9Sstevel@tonic-gate 
19*7c478bd9Sstevel@tonic-gate /*
20*7c478bd9Sstevel@tonic-gate **  This is an abstract interface for looking up local mail recipients.
21*7c478bd9Sstevel@tonic-gate */
22*7c478bd9Sstevel@tonic-gate 
23*7c478bd9Sstevel@tonic-gate #define	MBDB_MAXNAME	256
24*7c478bd9Sstevel@tonic-gate #define SM_NO_UID	((uid_t)(-1))
25*7c478bd9Sstevel@tonic-gate #define SM_NO_GID	((gid_t)(-1))
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate typedef struct
28*7c478bd9Sstevel@tonic-gate {
29*7c478bd9Sstevel@tonic-gate 	uid_t	mbdb_uid;
30*7c478bd9Sstevel@tonic-gate 	gid_t	mbdb_gid;
31*7c478bd9Sstevel@tonic-gate 	char	mbdb_name[MBDB_MAXNAME];
32*7c478bd9Sstevel@tonic-gate 	char	mbdb_fullname[MBDB_MAXNAME];
33*7c478bd9Sstevel@tonic-gate 	char	mbdb_homedir[PATH_MAX];
34*7c478bd9Sstevel@tonic-gate 	char	mbdb_shell[PATH_MAX];
35*7c478bd9Sstevel@tonic-gate } SM_MBDB_T;
36*7c478bd9Sstevel@tonic-gate 
37*7c478bd9Sstevel@tonic-gate extern int	sm_mbdb_initialize __P((char *));
38*7c478bd9Sstevel@tonic-gate extern void	sm_mbdb_terminate __P((void));
39*7c478bd9Sstevel@tonic-gate extern int	sm_mbdb_lookup __P((char *, SM_MBDB_T *));
40*7c478bd9Sstevel@tonic-gate extern void	sm_mbdb_frompw __P((SM_MBDB_T *, struct passwd *));
41*7c478bd9Sstevel@tonic-gate extern void	sm_pwfullname __P((char *, char *, char *, size_t));
42*7c478bd9Sstevel@tonic-gate 
43*7c478bd9Sstevel@tonic-gate #endif /* ! SM_MBDB_H */
44