dovecot-2.1: checkpassword: Export all auth %variables to AUTH_*...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Nov 16 22:13:47 EET 2011
details: http://hg.dovecot.org/dovecot-2.1/rev/0a94dfe6ac92
changeset: 13716:0a94dfe6ac92
user: Timo Sirainen <tss at iki.fi>
date: Wed Nov 16 22:13:35 2011 +0200
description:
checkpassword: Export all auth %variables to AUTH_* environment.
diffstat:
src/auth/db-checkpassword.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
diffs (33 lines):
diff -r 9ead5aea2ce4 -r 0a94dfe6ac92 src/auth/db-checkpassword.c
--- a/src/auth/db-checkpassword.c Wed Nov 16 20:24:07 2011 +0200
+++ b/src/auth/db-checkpassword.c Wed Nov 16 22:13:35 2011 +0200
@@ -86,6 +86,21 @@
}
}
+static void env_put_auth_vars(struct auth_request *request)
+{
+ const struct var_expand_table *tab;
+ unsigned int i;
+
+ tab = auth_request_get_var_expand_table(request, NULL);
+ for (i = 0; tab[i].key != '\0' || tab[i].long_key != NULL; i++) {
+ if (tab[i].long_key != NULL && tab[i].value != NULL) {
+ env_put(t_strdup_printf("AUTH_%s=%s",
+ t_str_ucase(tab[i].long_key),
+ tab[i].value));
+ }
+ }
+}
+
void checkpassword_setup_env(struct auth_request *request)
{
/* Besides passing the standard username and password in a
@@ -128,6 +143,7 @@
/* extra fields could come from master db */
env_put_extra_fields(fields);
}
+ env_put_auth_vars(request);
}
const char *
More information about the dovecot-cvs
mailing list