190792Sgshapiro/*
2261363Sgshapiro * Copyright (c) 2001-2002 Proofpoint, Inc. and its suppliers.
390792Sgshapiro *      All rights reserved.
490792Sgshapiro *
590792Sgshapiro * By using this file, you agree to the terms and conditions set
690792Sgshapiro * forth in the LICENSE file which can be found at the top level of
790792Sgshapiro * the sendmail distribution.
890792Sgshapiro *
9266692Sgshapiro *	$Id: mbdb.h,v 1.7 2013-11-22 20:51:31 ca Exp $
1090792Sgshapiro */
1190792Sgshapiro
1290792Sgshapiro#ifndef SM_MBDB_H
1390792Sgshapiro# define SM_MBDB_H
1490792Sgshapiro
1590792Sgshapiro#include <pwd.h>
1690792Sgshapiro#include <sm/types.h>
1790792Sgshapiro#include <sm/limits.h>
1890792Sgshapiro
1990792Sgshapiro/*
2090792Sgshapiro**  This is an abstract interface for looking up local mail recipients.
2190792Sgshapiro*/
2290792Sgshapiro
2390792Sgshapiro#define	MBDB_MAXNAME	256
2490792Sgshapiro#define SM_NO_UID	((uid_t)(-1))
2590792Sgshapiro#define SM_NO_GID	((gid_t)(-1))
2690792Sgshapiro
2790792Sgshapirotypedef struct
2890792Sgshapiro{
2990792Sgshapiro	uid_t	mbdb_uid;
3090792Sgshapiro	gid_t	mbdb_gid;
3190792Sgshapiro	char	mbdb_name[MBDB_MAXNAME];
3290792Sgshapiro	char	mbdb_fullname[MBDB_MAXNAME];
3398121Sgshapiro	char	mbdb_homedir[PATH_MAX];
3498121Sgshapiro	char	mbdb_shell[PATH_MAX];
3590792Sgshapiro} SM_MBDB_T;
3690792Sgshapiro
3790792Sgshapiroextern int	sm_mbdb_initialize __P((char *));
3890792Sgshapiroextern void	sm_mbdb_terminate __P((void));
3990792Sgshapiroextern int	sm_mbdb_lookup __P((char *, SM_MBDB_T *));
4090792Sgshapiroextern void	sm_mbdb_frompw __P((SM_MBDB_T *, struct passwd *));
4190792Sgshapiroextern void	sm_pwfullname __P((char *, char *, char *, size_t));
4290792Sgshapiro
4390792Sgshapiro#endif /* ! SM_MBDB_H */
44