From: Ralph Boehme Date: Thu, 15 Mar 2018 17:57:50 +0000 (+0100) Subject: smbd: rework error exit in smbd_dirptr_lanman2_entry() X-Git-Tag: ldb-1.5.0~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcfc830c284e4eaa76e1a562bf60d8ecdf8d11ab;p=thirdparty%2Fsamba.git smbd: rework error exit in smbd_dirptr_lanman2_entry() The next commit will add code that must be run if status is NT_STATUS_OK or STATUS_MORE_ENTRIES. Signed-off-by: Ralph Boehme Reviewed-by: Stefan Metzmacher --- diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 238cd9f1cef..005f55f77b7 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -2550,11 +2550,15 @@ NTSTATUS smbd_dirptr_lanman2_entry(TALLOC_CTX *ctx, TALLOC_FREE(fname); TALLOC_FREE(smb_fname); - if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) { - dptr_SeekDir(dirptr, prev_dirpos); + + if (!NT_STATUS_IS_OK(status) && + !NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) + { return status; } - if (!NT_STATUS_IS_OK(status)) { + + if (NT_STATUS_EQUAL(status, STATUS_MORE_ENTRIES)) { + dptr_SeekDir(dirptr, prev_dirpos); return status; }