]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
smbd: rework error exit in smbd_dirptr_lanman2_entry()
authorRalph Boehme <slow@samba.org>
Thu, 15 Mar 2018 17:57:50 +0000 (18:57 +0100)
committerRalph Boehme <slow@samba.org>
Fri, 27 Jul 2018 11:07:15 +0000 (13:07 +0200)
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 <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/smbd/trans2.c

index 238cd9f1cef8750ebac0c6713f101d077cac5036..005f55f77b7868e9328608e933b53505efa232ab 100644 (file)
@@ -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;
        }