From 18d3afe383aea7e88930035e7e53660d67afd07c Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 12 Jan 2022 10:42:48 -0800 Subject: [PATCH] s3: smbd: Add missing pop_sec_ctx() in error code path of close_directory() If delete_all_streams() fails. Found by Andrew Walker BUG: https://bugzilla.samba.org/show_bug.cgi?id=14944 Signed-off-by: Jeremy Allison Reviewed-by: Christof Schmitt Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Fri Jan 14 03:34:47 UTC 2022 on sn-devel-184 (cherry picked from commit 5f9dbf3decd17129f360cbe14383cc79e20fb70b) --- source3/smbd/close.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source3/smbd/close.c b/source3/smbd/close.c index 0e5f1958fa1..c917cb5828d 100644 --- a/source3/smbd/close.c +++ b/source3/smbd/close.c @@ -1432,6 +1432,8 @@ static NTSTATUS close_directory(struct smb_request *req, files_struct *fsp, DEBUG(5, ("delete_all_streams failed: %s\n", nt_errstr(status))); file_free(req, fsp); + /* unbecome user. */ + pop_sec_ctx(); return status; } } -- 2.30.2