1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) University of Cambridge 1995 - 2015 */
6 /* Copyright (c) The Exim Maintainers 2020 */
7 /* See the file NOTICE for conditions of use and distribution. */
13 /*************************************************
15 *************************************************/
17 /* See local README for interface description */
20 passwd_open(const uschar * filename, uschar ** errmsg)
22 return (void *)(-1); /* Just return something non-null */
28 /*************************************************
29 * Find entry point for passwd *
30 *************************************************/
32 /* See local README for interface description */
35 passwd_find(void * handle, const uschar * filename, const uschar * keystring,
36 int length, uschar ** result, uschar ** errmsg, uint * do_cache,
41 if (!route_finduser(keystring, &pw, NULL)) return FAIL;
42 *result = string_sprintf("*:%d:%d:%s:%s:%s", (int)pw->pw_uid, (int)pw->pw_gid,
43 pw->pw_gecos, pw->pw_dir, pw->pw_shell);
49 /*************************************************
50 * Version reporting entry point *
51 *************************************************/
53 /* See local README for interface description. */
55 #include "../version.h"
58 passwd_version_report(FILE *f)
61 fprintf(f, "Library version: passwd: Exim version %s\n", EXIM_VERSION_STR);
65 static lookup_info _lookup_info = {
66 .name = US"passwd", /* lookup name */
67 .type = lookup_querystyle, /* query-style lookup */
68 .open = passwd_open, /* open function */
69 .check = NULL, /* no check function */
70 .find = passwd_find, /* find function */
71 .close = NULL, /* no close function */
72 .tidy = NULL, /* no tidy function */
73 .quote = NULL, /* no quoting function */
74 .version_report = passwd_version_report /* version reporting */
78 #define passwd_lookup_module_info _lookup_module_info
81 static lookup_info *_lookup_list[] = { &_lookup_info };
82 lookup_module_info passwd_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
84 /* End of lookups/passwd.c */