Commit | Line | Data |
---|---|---|
184e8823 | 1 | /* $Cambridge: exim/src/src/lookups/passwd.c,v 1.4 2007/01/08 10:50:19 ph10 Exp $ */ |
0756eb3c PH |
2 | |
3 | /************************************************* | |
4 | * Exim - an Internet mail transport agent * | |
5 | *************************************************/ | |
6 | ||
184e8823 | 7 | /* Copyright (c) University of Cambridge 1995 - 2007 */ |
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 | ||
21 | void * | |
22 | passwd_open(uschar *filename, uschar **errmsg) | |
23 | { | |
24 | filename = filename; /* Keep picky compilers happy */ | |
25 | errmsg = errmsg; | |
26 | return (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 | ||
38 | int | |
39 | passwd_find(void *handle, uschar *filename, uschar *keystring, int length, | |
40 | uschar **result, uschar **errmsg, BOOL *do_cache) | |
41 | { | |
42 | struct passwd *pw; | |
43 | ||
44 | handle = handle; /* Keep picky compilers happy */ | |
45 | filename = filename; | |
46 | length = length; | |
47 | errmsg = errmsg; | |
48 | do_cache = do_cache; | |
49 | ||
50 | if (!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); | |
53 | return OK; | |
54 | } | |
55 | ||
56 | /* End of lookups/passwd.c */ |