1 /* $Cambridge: exim/src/src/lookups/passwd.c,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
3 /*************************************************
4 * Exim - an Internet mail transport agent *
5 *************************************************/
7 /* Copyright (c) University of Cambridge 1995 - 2009 */
8 /* See the file NOTICE for conditions of use and distribution. */
14 /*************************************************
16 *************************************************/
18 /* See local README for interface description */
21 passwd_open(uschar
*filename
, uschar
**errmsg
)
23 filename
= filename
; /* Keep picky compilers happy */
25 return (void *)(-1); /* Just return something non-null */
31 /*************************************************
32 * Find entry point for passwd *
33 *************************************************/
35 /* See local README for interface description */
38 passwd_find(void *handle
, uschar
*filename
, uschar
*keystring
, int length
,
39 uschar
**result
, uschar
**errmsg
, BOOL
*do_cache
)
43 handle
= handle
; /* Keep picky compilers happy */
49 if (!route_finduser(keystring
, &pw
, NULL
)) return FAIL
;
50 *result
= string_sprintf("*:%d:%d:%s:%s:%s", (int)pw
->pw_uid
, (int)pw
->pw_gid
,
51 pw
->pw_gecos
, pw
->pw_dir
, pw
->pw_shell
);
55 static lookup_info _lookup_info
= {
56 US
"passwd", /* lookup name */
57 lookup_querystyle
, /* query-style lookup */
58 passwd_open
, /* open function */
59 NULL
, /* no check function */
60 passwd_find
, /* find function */
61 NULL
, /* no close function */
62 NULL
, /* no tidy function */
63 NULL
/* no quoting function */
67 #define passwd_lookup_module_info _lookup_module_info
70 static lookup_info
*_lookup_list
[] = { &_lookup_info
};
71 lookup_module_info passwd_lookup_module_info
= { LOOKUP_MODULE_INFO_MAGIC
, _lookup_list
, 1 };
73 /* End of lookups/passwd.c */