Skip to content

Ensure all returns from OpenDir() correctly set errno.

Fix BUG:https://bugzilla.samba.org/show_bug.cgi?id=14805

Complex code paths inside open_internal_dirfsp() which is called directly from OpenDir() can return an NTSTATUS, but trample on the matching errno. We need to make sure if open_internal_dirfsp() fails when called from OpenDir(), errno matches the NTSTATUS return as OpenDir() will return NULL. All callers can only look at errno when OpenDir() returns NULL.

To be honest, this should have gone in before !2121 (closed), but it was the inconsistencies around the return code from that new test that exposed this issue.

I'll make BUG:https://bugzilla.samba.org/show_bug.cgi?id=14760 dependent on BUG:https://bugzilla.samba.org/show_bug.cgi?id=14805 so the back-ports for 4.15.0 are applied in the correct order.

Passes ci.

Edited by Jeremy Allison

Merge request reports

Loading