DKIM ACL Documentation
[exim.git] / src / src / lookups / passwd.c
CommitLineData
0a49a7a4 1/* $Cambridge: exim/src/src/lookups/passwd.c,v 1.5 2009/11/16 19:50:38 nm4 Exp $ */
0756eb3c
PH
2
3/*************************************************
4* Exim - an Internet mail transport agent *
5*************************************************/
6
0a49a7a4 7/* Copyright (c) University of Cambridge 1995 - 2009 */
0756eb3c
PH
8/* See the file NOTICE for conditions of use and distribution. */
9
10#include "../exim.h"
11#include "passwd.h"
12
13
14
15/*************************************************
16* Open entry point *
17*************************************************/
18
19/* See local README for interface description */
20
21void *
22passwd_open(uschar *filename, uschar **errmsg)
23{
24filename = filename; /* Keep picky compilers happy */
25errmsg = errmsg;
26return (void *)(-1); /* Just return something non-null */
27}
28
29
30
31
32/*************************************************
33* Find entry point for passwd *
34*************************************************/
35
36/* See local README for interface description */
37
38int
39passwd_find(void *handle, uschar *filename, uschar *keystring, int length,
40 uschar **result, uschar **errmsg, BOOL *do_cache)
41{
42struct passwd *pw;
43
44handle = handle; /* Keep picky compilers happy */
45filename = filename;
46length = length;
47errmsg = errmsg;
48do_cache = do_cache;
49
50if (!route_finduser(keystring, &pw, NULL)) return FAIL;
51*result = string_sprintf("*:%d:%d:%s:%s:%s", (int)pw->pw_uid, (int)pw->pw_gid,
52 pw->pw_gecos, pw->pw_dir, pw->pw_shell);
53return OK;
54}
55
56/* End of lookups/passwd.c */