1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2015 */
6 /* See the file NOTICE for conditions of use and distribution. */
12 /*************************************************
14 *************************************************/
16 /* See local README for interface description */
19 passwd_open(const uschar * filename, uschar ** errmsg)
21 filename = filename; /* Keep picky compilers happy */
23 return (void *)(-1); /* Just return something non-null */
29 /*************************************************
30 * Find entry point for passwd *
31 *************************************************/
33 /* See local README for interface description */
36 passwd_find(void * handle, const uschar * filename, const uschar * keystring,
37 int length, uschar ** result, uschar ** errmsg, uint * do_cache,
42 handle = handle; /* Keep picky compilers happy */
48 if (!route_finduser(keystring, &pw, NULL)) return FAIL;
49 *result = string_sprintf("*:%d:%d:%s:%s:%s", (int)pw->pw_uid, (int)pw->pw_gid,
50 pw->pw_gecos, pw->pw_dir, pw->pw_shell);
56 /*************************************************
57 * Version reporting entry point *
58 *************************************************/
60 /* See local README for interface description. */
62 #include "../version.h"
65 passwd_version_report(FILE *f)
68 fprintf(f, "Library version: passwd: Exim version %s\n", EXIM_VERSION_STR);
72 static lookup_info _lookup_info = {
73 US"passwd", /* lookup name */
74 lookup_querystyle, /* query-style lookup */
75 passwd_open, /* open function */
76 NULL, /* no check function */
77 passwd_find, /* find function */
78 NULL, /* no close function */
79 NULL, /* no tidy function */
80 NULL, /* no quoting function */
81 passwd_version_report /* version reporting */
85 #define passwd_lookup_module_info _lookup_module_info
88 static lookup_info *_lookup_list[] = { &_lookup_info };
89 lookup_module_info passwd_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
91 /* End of lookups/passwd.c */