]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: follow-up fix for "if close fails just log it, don't crash"
authorRalph Boehme <slow@samba.org>
Fri, 8 Jul 2022 15:08:05 +0000 (17:08 +0200)
committerRalph Boehme <slow@samba.org>
Sat, 9 Jul 2022 09:04:46 +0000 (09:04 +0000)
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Björn Baumbach <bb@sernet.de>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Jul  9 09:04:46 UTC 2022 on sn-devel-184

source3/smbd/files.c

index 45cc7ffd79fb1779322ce6c0d0aac8e3c2949311..b56130f4f04f3258b144f0f1457cb28b979f45dd 100644 (file)
@@ -424,7 +424,7 @@ static int smb_fname_fsp_destructor(struct smb_filename *smb_fname)
                fsp_set_base_fsp(fsp, NULL);
 
                status = fd_close(tmp_base_fsp);
-               if (NT_STATUS_IS_OK(status)) {
+               if (!NT_STATUS_IS_OK(status)) {
                        DBG_ERR("Closing fd for fsp [%s] failed: %s. "
                                "Please check your filesystem!!!\n",
                                fsp_str_dbg(fsp), nt_errstr(status));
@@ -433,7 +433,7 @@ static int smb_fname_fsp_destructor(struct smb_filename *smb_fname)
        }
 
        status = fd_close(fsp);
-       if (NT_STATUS_IS_OK(status)) {
+       if (!NT_STATUS_IS_OK(status)) {
                DBG_ERR("Closing fd for fsp [%s] failed: %s. "
                        "Please check your filesystem!!!\n",
                        fsp_str_dbg(fsp), nt_errstr(status));