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

s3: Don't open the dir for stat/attr/acl related mask

Signed-off-by: Abhidnya Joshi <achirmul@in.ibm.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Jan 23 03:56:35 CET 2014 on sn-devel-104
This commit is contained in:
Abhidnya Joshi 2014-01-22 17:02:15 -08:00 committed by Jeremy Allison
parent b04e8b7557
commit 7638f52145

View File

@ -3211,19 +3211,30 @@ static NTSTATUS open_directory(connection_struct *conn,
*/
ZERO_STRUCT(mtimespec);
if (access_mask & (FILE_LIST_DIRECTORY|
FILE_ADD_FILE|
FILE_ADD_SUBDIRECTORY|
FILE_TRAVERSE|
DELETE_ACCESS|
FILE_DELETE_CHILD)) {
#ifdef O_DIRECTORY
status = fd_open(conn, fsp, O_RDONLY|O_DIRECTORY, 0);
status = fd_open(conn, fsp, O_RDONLY|O_DIRECTORY, 0);
#else
/* POSIX allows us to open a directory with O_RDONLY. */
status = fd_open(conn, fsp, O_RDONLY, 0);
/* POSIX allows us to open a directory with O_RDONLY. */
status = fd_open(conn, fsp, O_RDONLY, 0);
#endif
if (!NT_STATUS_IS_OK(status)) {
DEBUG(5, ("open_directory: Could not open fd for "
"%s (%s)\n",
smb_fname_str_dbg(smb_dname),
nt_errstr(status)));
file_free(req, fsp);
return status;
if (!NT_STATUS_IS_OK(status)) {
DEBUG(5, ("open_directory: Could not open fd for "
"%s (%s)\n",
smb_fname_str_dbg(smb_dname),
nt_errstr(status)));
file_free(req, fsp);
return status;
}
} else {
fsp->fh->fd = -1;
DEBUG(10, ("Not opening Directory %s\n",
smb_fname_str_dbg(smb_dname)));
}
status = vfs_stat_fsp(fsp);