1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s3-torture: Allow vfstest to set ACLs on a directory

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Aug 17 02:35:49 CEST 2012 on sn-devel-104
This commit is contained in:
Andrew Bartlett 2012-08-16 16:50:47 +10:00
parent 5251d07e62
commit 6b7a99107d
2 changed files with 20 additions and 6 deletions

View File

@ -1,6 +1,15 @@
connect
open x RC 0700
sys_acl_get_file . 0
sys_acl_get_file . 1
get_nt_acl .
set_nt_acl . G:DAD:P(A;OICI;0x001f01ff;;;BA)(A;OICI;0x001200a9;;;SO)(A;OICI;0x001f01ff;;;SY)(A;OICI;0x001200a9;;;AU)
get_nt_acl .
sys_acl_get_file . 0
sys_acl_get_file . 1
get_nt_acl x
sys_acl_get_file x 0
set_nt_acl x G:DAD:P(A;OICI;0x001f01ff;;;BA)(A;OICI;0x001200a9;;;SO)(A;OICI;0x001f01ff;;;SY)(A;OICI;0x001200a9;;;AU)
get_nt_acl x
sys_acl_get_file x 0

View File

@ -1459,8 +1459,6 @@ static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
mode = 00400;
flags = O_RDWR;
fsp = talloc_zero(vfs, struct files_struct);
if (fsp == NULL) {
return NT_STATUS_NO_MEMORY;
@ -1481,7 +1479,17 @@ static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
fsp->fsp_name = smb_fname;
fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, smb_fname, fsp, flags, mode);
#ifdef O_DIRECTORY
flags = O_RDONLY|O_DIRECTORY;
#else
/* POSIX allows us to open a directory with O_RDONLY. */
flags = O_RDONLY;
#endif
fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, smb_fname, fsp, O_RDWR, mode);
if (fsp->fh->fd == -1 && errno == EISDIR) {
fsp->fh->fd = SMB_VFS_OPEN(vfs->conn, smb_fname, fsp, flags, mode);
}
if (fsp->fh->fd == -1) {
printf("open: error=%d (%s)\n", errno, strerror(errno));
TALLOC_FREE(fsp);
@ -1497,9 +1505,6 @@ static NTSTATUS cmd_set_nt_acl(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int a
smb_fname_str_dbg(smb_fname),
strerror(errno) ));
status = map_nt_error_from_unix(errno);
} else if (S_ISDIR(smb_fname->st.st_ex_mode)) {
errno = EISDIR;
status = NT_STATUS_FILE_IS_A_DIRECTORY;
}
if (!NT_STATUS_IS_OK(status)) {