1 /*************************************************
2 * Exim - an Internet mail transport agent *
3 *************************************************/
5 /* Copyright (c) The Exim Maintainers 2020 - 2022 */
6 /* Copyright (c) University of Cambridge 1995 - 2015 */
7 /* See the file NOTICE for conditions of use and distribution. */
8 /* SPDX-License-Identifier: GPL-2.0-or-later */
14 /*************************************************
16 *************************************************/
18 /* See local README for interface description */
21 passwd_open(const uschar * filename, uschar ** errmsg)
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 if (!route_finduser(keystring, &pw, NULL)) return FAIL;
43 *result = string_sprintf("*:%d:%d:%s:%s:%s", (int)pw->pw_uid, (int)pw->pw_gid,
44 pw->pw_gecos, pw->pw_dir, pw->pw_shell);
50 /*************************************************
51 * Version reporting entry point *
52 *************************************************/
54 /* See local README for interface description. */
56 #include "../version.h"
59 passwd_version_report(gstring * g)
62 g = string_fmt_append(g, "Library version: passwd: Exim version %s\n", EXIM_VERSION_STR);
67 static lookup_info _lookup_info = {
68 .name = US"passwd", /* lookup name */
69 .type = lookup_querystyle, /* query-style lookup */
70 .open = passwd_open, /* open function */
71 .check = NULL, /* no check function */
72 .find = passwd_find, /* find function */
73 .close = NULL, /* no close function */
74 .tidy = NULL, /* no tidy function */
75 .quote = NULL, /* no quoting function */
76 .version_report = passwd_version_report /* version reporting */
80 #define passwd_lookup_module_info _lookup_module_info
83 static lookup_info *_lookup_list[] = { &_lookup_info };
84 lookup_module_info passwd_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 };
86 /* End of lookups/passwd.c */