d9898ee8 |
1 | /* |
2 | ** Copyright 1998 - 2000 Double Precision, Inc. See COPYING for |
3 | ** distribution information. |
4 | */ |
5 | |
6 | #if HAVE_CONFIG_H |
7 | #include "courier_auth_config.h" |
8 | #endif |
9 | #include <stdio.h> |
10 | #include <stdlib.h> |
11 | #include <string.h> |
12 | #include <errno.h> |
13 | #include <pwd.h> |
14 | #if HAVE_UNISTD_H |
15 | #include <unistd.h> |
16 | #endif |
17 | |
18 | #include "auth.h" |
b0322a85 |
19 | #include "courierauthstaticlist.h" |
d9898ee8 |
20 | |
d9898ee8 |
21 | |
22 | |
23 | void auth_pwd_enumerate( void(*cb_func)(const char *name, |
24 | uid_t uid, |
25 | gid_t gid, |
26 | const char *homedir, |
27 | const char *maildir, |
28 | const char *options, |
29 | void *void_arg), |
30 | void *void_arg) |
31 | { |
32 | struct passwd *pw; |
33 | |
34 | setpwent(); |
35 | |
36 | while ( (pw=getpwent()) != NULL) |
37 | { |
38 | if (pw->pw_uid < 100) |
39 | continue; |
40 | |
41 | (*cb_func)(pw->pw_name, pw->pw_uid, |
42 | pw->pw_gid, |
43 | pw->pw_dir, |
44 | NULL, |
45 | NULL, |
46 | void_arg); |
47 | } |
48 | endpwent(); |
49 | (*cb_func)(NULL, 0, 0, NULL, NULL, NULL, void_arg); |
50 | } |