From: Timo Sirainen Date: Tue, 26 May 2020 21:36:44 +0000 (+0300) Subject: auth: db-oauth2 - db_oauth2_template_export() - Make var_expand() error handling... X-Git-Tag: 2.3.14.rc1~267 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72e4a833ed1084fb8c423aafab28ced1048cccee;p=thirdparty%2Fdovecot%2Fcore.git auth: db-oauth2 - db_oauth2_template_export() - Make var_expand() error handling consistent Other var_expand() errors include the original string in the error message, so this one should also. --- diff --git a/src/auth/db-oauth2.c b/src/auth/db-oauth2.c index 113249310a..511be05a87 100644 --- a/src/auth/db-oauth2.c +++ b/src/auth/db-oauth2.c @@ -433,7 +433,7 @@ db_oauth2_template_export(struct db_oauth2_request *req, { NULL, NULL } }; string_t *dest; - const char *const *args, *value; + const char *const *args, *value, *error; struct passdb_template *tmpl = req->db->tmpl; unsigned int i, count; @@ -452,7 +452,10 @@ db_oauth2_template_export(struct db_oauth2_request *req, table = db_oauth2_value_get_var_expand_table(req->auth_request, auth_fields_find(req->fields, args[i])); if (var_expand_with_funcs(dest, args[i+1], table, funcs_table, - req, error_r) < 0) { + req, &error) < 0) { + *error_r = t_strdup_printf( + "var_expand(%s) failed: %s", + args[i+1], error); *result_r = PASSDB_RESULT_INTERNAL_FAILURE; return FALSE; }