From 72e4a833ed1084fb8c423aafab28ced1048cccee Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Wed, 27 May 2020 00:36:44 +0300 Subject: [PATCH] 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. --- src/auth/db-oauth2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } -- 2.47.3