]> git.pld-linux.org Git - packages/dovecot.git/blob - dovecot-auth-settings.patch
cdd8361359750e2e7041d925f01e491bb11bb9c9
[packages/dovecot.git] / dovecot-auth-settings.patch
1
2 # HG changeset patch
3 # User Timo Sirainen <tss@iki.fi>
4 # Date 1408538127 -7200
5 # Node ID c3da5ffaa0f259711fcaf8334b1998a3af77dc62
6 # Parent  febedba15c7ebc87a90de5bc935783eb42438126
7 auth: protocol-specific username settings weren't used for userdb lookups.
8 The username was set before the service-specific settings were looked up, so
9 global settings were always used. This affected auth_default_realm,
10 auth_username_translation and auth_username_format settings.
11
12 diff -r febedba15c7e -r c3da5ffaa0f2 src/auth/auth-master-connection.c
13 --- a/src/auth/auth-master-connection.c Wed Aug 20 14:22:28 2014 +0300
14 +++ b/src/auth/auth-master-connection.c Wed Aug 20 14:35:27 2014 +0200
15 @@ -167,7 +167,7 @@
16                           const char **error_r)
17  {
18         struct auth_request *auth_request;
19 -       const char *const *list, *name, *arg;
20 +       const char *const *list, *name, *arg, *username;
21         unsigned int id;
22  
23         /* <id> <userid> [<parameters>] */
24 @@ -182,11 +182,7 @@
25         auth_request->id = id;
26         auth_request->master = conn;
27         auth_master_connection_ref(conn);
28 -
29 -       if (!auth_request_set_username(auth_request, list[1], error_r)) {
30 -               *request_r = auth_request;
31 -               return 0;
32 -       }
33 +       username = list[1];
34  
35         for (list += 2; *list != NULL; list++) {
36                 arg = strchr(*list, '=');
37 @@ -209,6 +205,11 @@
38         }
39  
40         auth_request_init(auth_request);
41 +
42 +       if (!auth_request_set_username(auth_request, username, error_r)) {
43 +               *request_r = auth_request;
44 +               return 0;
45 +       }
46         *request_r = auth_request;
47         return 1;
48  }
49 diff -r febedba15c7e -r c3da5ffaa0f2 src/auth/auth-postfix-connection.c
50 --- a/src/auth/auth-postfix-connection.c        Wed Aug 20 14:22:28 2014 +0300
51 +++ b/src/auth/auth-postfix-connection.c        Wed Aug 20 14:35:27 2014 +0200
52 @@ -51,13 +51,13 @@
53         auth_request->context = conn;
54         auth_postfix_connection_ref(conn);
55  
56 +       (void)auth_request_import_info(auth_request, "service", "postfix");
57 +       auth_request_init(auth_request);
58 +
59         if (!auth_request_set_username(auth_request, username, error_r)) {
60                 *request_r = auth_request;
61                 return FALSE;
62         }
63 -       (void)auth_request_import_info(auth_request, "service", "postfix");
64 -
65 -       auth_request_init(auth_request);
66         *request_r = auth_request;
67         return TRUE;
68  }
69
This page took 0.072362 seconds and 2 git commands to generate.