From 85e8d33a33c244c3c01833e4bf7397bd0c64c274 Mon Sep 17 00:00:00 2001 From: Noel Power Date: Sat, 21 Oct 2023 12:13:19 +0100 Subject: [PATCH] s3/winbindd: in winbindd_pam_logoff_send use canonicalize_username replace use of canonicalize_username_fstr with canonicalize_username Signed-off-by: Noel Power Reviewed-by: Andrew Bartlett Reviewed-by: Andreas Schneider --- source3/winbindd/winbindd_pam_logoff.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/source3/winbindd/winbindd_pam_logoff.c b/source3/winbindd/winbindd_pam_logoff.c index b4c1e62b5b7..c799eb5e38d 100644 --- a/source3/winbindd/winbindd_pam_logoff.c +++ b/source3/winbindd/winbindd_pam_logoff.c @@ -22,6 +22,7 @@ #include "winbindd.h" #include "lib/global_contexts.h" #include "librpc/gen_ndr/ndr_winbind_c.h" +#include "lib/util/string_wrappers.h" struct winbindd_pam_logoff_state { struct wbint_PamLogOff r; @@ -37,7 +38,11 @@ struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx, struct tevent_req *req, *subreq; struct winbindd_pam_logoff_state *state; struct winbindd_domain *domain; - fstring name_namespace, name_domain, user; + char *name_namespace = NULL; + char *name_domain = NULL; + char *user = NULL; + char *logoff_user = NULL; + uid_t caller_uid; gid_t caller_gid; int res; @@ -63,14 +68,19 @@ struct tevent_req *winbindd_pam_logoff_send(TALLOC_CTX *mem_ctx, goto failed; } - ok = canonicalize_username_fstr(request->data.logoff.user, - name_namespace, - name_domain, - user); + logoff_user = request->data.logoff.user; + + ok = canonicalize_username(req, + &logoff_user, + &name_namespace, + &name_domain, + &user); if (!ok) { goto failed; } + fstrcpy(request->data.logoff.user, logoff_user); + domain = find_auth_domain(request->flags, name_namespace); if (domain == NULL) { goto failed; -- 2.47.3