Mercurial > dovecot > original-hg > dovecot-1.2
annotate src/auth/userdb.h @ 9008:fc4f65a4ca60 HEAD
virtual: Don't show mailboxes as \Noselect.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Fri, 01 May 2009 14:56:52 -0400 |
parents | e4eb71ae8e96 |
children |
rev | line source |
---|---|
6410
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
6187
diff
changeset
|
1 #ifndef USERDB_H |
e4eb71ae8e96
Changed .h ifdef/defines to use <NAME>_H format.
Timo Sirainen <tss@iki.fi>
parents:
6187
diff
changeset
|
2 #define USERDB_H |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
3 |
3520 | 4 #include "auth-stream.h" |
5 | |
3068 | 6 struct auth_request; |
2057
5e0167577399
Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents:
1995
diff
changeset
|
7 |
4880
4ec6a4def05b
We treated internal userdb lookup errors as "user unknown" errors. In such
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
8 enum userdb_result { |
4ec6a4def05b
We treated internal userdb lookup errors as "user unknown" errors. In such
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
9 USERDB_RESULT_INTERNAL_FAILURE = -1, |
4ec6a4def05b
We treated internal userdb lookup errors as "user unknown" errors. In such
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
10 USERDB_RESULT_USER_UNKNOWN = -2, |
4ec6a4def05b
We treated internal userdb lookup errors as "user unknown" errors. In such
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
11 |
4ec6a4def05b
We treated internal userdb lookup errors as "user unknown" errors. In such
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
12 USERDB_RESULT_OK = 1 |
4ec6a4def05b
We treated internal userdb lookup errors as "user unknown" errors. In such
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
13 }; |
4ec6a4def05b
We treated internal userdb lookup errors as "user unknown" errors. In such
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
14 |
4ec6a4def05b
We treated internal userdb lookup errors as "user unknown" errors. In such
Timo Sirainen <tss@iki.fi>
parents:
3863
diff
changeset
|
15 typedef void userdb_callback_t(enum userdb_result result, |
3166
e6a487d80288
Restructuring of auth code. Balancer auth processes were a bad idea. Usually
Timo Sirainen <tss@iki.fi>
parents:
3158
diff
changeset
|
16 struct auth_request *request); |
1046
561da07883b6
Async userdb and passdb interface.
Timo Sirainen <tss@iki.fi>
parents:
1035
diff
changeset
|
17 |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
18 struct userdb_module { |
4955
f0cc5486696e
Authentication cache caches now also userdb data. Code by Tommi Saviranta.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4880
diff
changeset
|
19 /* The caching key for this module, or NULL if caching isn't wanted. */ |
f0cc5486696e
Authentication cache caches now also userdb data. Code by Tommi Saviranta.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4880
diff
changeset
|
20 const char *cache_key; |
f0cc5486696e
Authentication cache caches now also userdb data. Code by Tommi Saviranta.
Timo Sirainen <timo.sirainen@movial.fi>
parents:
4880
diff
changeset
|
21 |
3658
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
22 /* If blocking is set to TRUE, use child processes to access |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
23 this userdb. */ |
3863
55df57c028d4
Added "bool" type and changed all ints that were used as booleans to bool.
Timo Sirainen <tss@iki.fi>
parents:
3658
diff
changeset
|
24 bool blocking; |
3658
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
25 |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
26 const struct userdb_module_interface *iface; |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
27 }; |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
28 |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
29 struct userdb_module_interface { |
2942
c7d426f8cb58
Added name variable for userdb_module and passdb_module and changed their
Timo Sirainen <tss@iki.fi>
parents:
2754
diff
changeset
|
30 const char *name; |
c7d426f8cb58
Added name variable for userdb_module and passdb_module and changed their
Timo Sirainen <tss@iki.fi>
parents:
2754
diff
changeset
|
31 |
3658
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
32 struct userdb_module * |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
33 (*preinit)(struct auth_userdb *auth_userdb, const char *args); |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
34 void (*init)(struct userdb_module *module, const char *args); |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
35 void (*deinit)(struct userdb_module *module); |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
36 |
2057
5e0167577399
Fixed var_expand() to take a table of variables rather than a few predefined
Timo Sirainen <tss@iki.fi>
parents:
1995
diff
changeset
|
37 void (*lookup)(struct auth_request *auth_request, |
3166
e6a487d80288
Restructuring of auth code. Balancer auth processes were a bad idea. Usually
Timo Sirainen <tss@iki.fi>
parents:
3158
diff
changeset
|
38 userdb_callback_t *callback); |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
39 }; |
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
40 |
3043
8b80b69938f0
If UID or GID isn't numeric, look it up from passwd/group.
Timo Sirainen <tss@iki.fi>
parents:
2942
diff
changeset
|
41 uid_t userdb_parse_uid(struct auth_request *request, const char *str); |
8b80b69938f0
If UID or GID isn't numeric, look it up from passwd/group.
Timo Sirainen <tss@iki.fi>
parents:
2942
diff
changeset
|
42 gid_t userdb_parse_gid(struct auth_request *request, const char *str); |
8b80b69938f0
If UID or GID isn't numeric, look it up from passwd/group.
Timo Sirainen <tss@iki.fi>
parents:
2942
diff
changeset
|
43 |
3183
16ea551957ed
Replaced userdb/passdb settings with blocks so it's possible to give
Timo Sirainen <tss@iki.fi>
parents:
3166
diff
changeset
|
44 void userdb_preinit(struct auth *auth, const char *driver, const char *args); |
3658
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
45 void userdb_init(struct auth_userdb *userdb); |
fc4622b1c1ef
Separated userdb_module's interface and the actual data struct.
Timo Sirainen <tss@iki.fi>
parents:
3520
diff
changeset
|
46 void userdb_deinit(struct auth_userdb *userdb); |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
47 |
6187
7c81e6d848f6
Added pass/userdb_register_module() functions and used them to register the
Timo Sirainen <tss@iki.fi>
parents:
5872
diff
changeset
|
48 void userdb_register_module(struct userdb_module_interface *iface); |
7c81e6d848f6
Added pass/userdb_register_module() functions and used them to register the
Timo Sirainen <tss@iki.fi>
parents:
5872
diff
changeset
|
49 void userdb_unregister_module(struct userdb_module_interface *iface); |
7c81e6d848f6
Added pass/userdb_register_module() functions and used them to register the
Timo Sirainen <tss@iki.fi>
parents:
5872
diff
changeset
|
50 |
7c81e6d848f6
Added pass/userdb_register_module() functions and used them to register the
Timo Sirainen <tss@iki.fi>
parents:
5872
diff
changeset
|
51 void userdbs_init(void); |
7c81e6d848f6
Added pass/userdb_register_module() functions and used them to register the
Timo Sirainen <tss@iki.fi>
parents:
5872
diff
changeset
|
52 void userdbs_deinit(void); |
7c81e6d848f6
Added pass/userdb_register_module() functions and used them to register the
Timo Sirainen <tss@iki.fi>
parents:
5872
diff
changeset
|
53 |
3068 | 54 #include "auth-request.h" |
55 | |
1035
fe49ece0f3ea
We have now separate "userdb" and "passdb". They aren't tied to each others
Timo Sirainen <tss@iki.fi>
parents:
diff
changeset
|
56 #endif |