]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: Close the opened file in smbd_smb2_create_after_exec() error case
authorVolker Lendecke <vl@samba.org>
Sat, 3 Dec 2022 20:43:06 +0000 (21:43 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 6 Dec 2022 23:37:52 +0000 (23:37 +0000)
smbd_smb2_create_after_exec() is only called when the file has
successfully been opened. When this fails in the middle, we can't
leave the fsp around. Hard to test with current code, but with reparse
point handling we'll have a reproducable case soon.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec  6 23:37:52 UTC 2022 on sn-devel-184

source3/smbd/smb2_create.c

index 80cdd3b534e096b7814db276118703939ef22f69..aba339014bb564c2660686cb97ca589d47556bbe 100644 (file)
@@ -1615,6 +1615,7 @@ static void smbd_smb2_create_after_exec(struct tevent_req *req)
        return;
 
 fail:
+       close_file_free(state->smb1req, &state->result, ERROR_CLOSE);
        tevent_req_nterror(req, status);
        tevent_req_post(req, state->ev);
 }