1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-28 01:58:17 +03:00

s3: smbd: Fix mkdir race condition.

Found by Max of LoadDynamix <adx.forum@gmail.com>

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
This commit is contained in:
Jeremy Allison 2015-09-22 18:02:53 -07:00 committed by Volker Lendecke
parent ce62124c61
commit b1c823dc8c

View File

@ -3488,6 +3488,25 @@ static NTSTATUS open_directory(connection_struct *conn,
nt_errstr(status)));
return status;
}
/*
* If mkdir_internal() returned
* NT_STATUS_OBJECT_NAME_COLLISION
* we still must lstat the path.
*/
if (SMB_VFS_LSTAT(conn, smb_dname)
== -1) {
DEBUG(2, ("Could not stat "
"directory '%s' just "
"opened: %s\n",
smb_fname_str_dbg(
smb_dname),
strerror(errno)));
return map_nt_error_from_unix(
errno);
}
info = FILE_WAS_OPENED;
}
}