smbd does posix_mkdir if the wire flags are exactly
if (wire_open_mode == (SMB_O_CREAT|SMB_O_DIRECTORY))
open_flags_to_wire however adds a SMB_O_RDONLY, so that we enter the
normal open routine which happens to create a directory as well. The
main difference is that posix_mkdir does *NOT* return an open
handle. As we did not enter this code path due to the SMB_O_RDONLY we
leak a SMB1 fd per cli_posix_mkdir call.
Pretty hard to test automatically, this would be an interaction with
smbstatus.
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
state->ev = ev;
state->cli = cli;
- wire_flags = open_flags_to_wire(O_CREAT) | SMB_O_DIRECTORY;
+ wire_flags = SMB_O_CREAT | SMB_O_DIRECTORY;
subreq = cli_posix_open_internal_send(
mem_ctx, ev, cli, fname, wire_flags, mode);