[SCM] Samba Shared Repository - branch master updated
Andrew Bartlett
abartlet at samba.org
Thu Aug 16 18:36:03 MDT 2012
The branch, master has been updated
via 6b7a9910 s3-torture: Allow vfstest to set ACLs on a directory
via 5251d07 s4: Fix returns in py_check_dcerpc_type
from 16edb6e s3:smb2_server: try to sign an error response if we have a signing key
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 6b7a99107d956651fae43a7e62d1fbf69d97d0c7
Author: Andrew Bartlett <abartlet at samba.org>
Date: Thu Aug 16 16:50:47 2012 +1000
s3-torture: Allow vfstest to set ACLs on a directory
Autobuild-User(master): Andrew Bartlett <abartlet at samba.org>
Autobuild-Date(master): Fri Aug 17 02:35:49 CEST 2012 on sn-devel-104
commit 5251d07e625d945f90b746d4dabcfe6d98cc5d89
Author: Volker Lendecke <vl at samba.org>
Date: Thu Aug 16 11:38:26 2012 +0200
s4: Fix returns in py_check_dcerpc_type
Signed-off-by: Andrew Bartlett <abartlet at samba.org>
-----------------------------------------------------------------------
Summary of changes:
source3/script/tests/vfstest-acl/vfstest.cmd | 9 +++++++++
source3/torture/cmd_vfs.c | 17 +++++++++++------
source4/librpc/rpc/pyrpc_util.c | 4 ++--
3 files changed, 22 insertions(+), 8 deletions(-)
Changeset truncated at 500 lines:
diff --git a/source3/script/tests/vfstest-acl/vfstest.cmd b/source3/script/tests/vfstest-acl/vfstest.cmd
index 19f5fd6..6168671 100644
--- a/source3/script/tests/vfstest-acl/vfstest.cmd
+++ b/source3/script/tests/vfstest-acl/vfstest.cmd
@@ -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
+
diff --git a/source3/torture/cmd_vfs.c b/source3/torture/cmd_vfs.c
index 9c19f2f..236b9c0 100644
--- a/source3/torture/cmd_vfs.c
+++ b/source3/torture/cmd_vfs.c
@@ -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)) {
diff --git a/source4/librpc/rpc/pyrpc_util.c b/source4/librpc/rpc/pyrpc_util.c
index d0fa5d7..a000c76 100644
--- a/source4/librpc/rpc/pyrpc_util.c
+++ b/source4/librpc/rpc/pyrpc_util.c
@@ -42,7 +42,7 @@ bool py_check_dcerpc_type(PyObject *obj, const char *module, const char *type_na
if (mod == NULL) {
PyErr_Format(PyExc_RuntimeError, "Unable to import %s to check type %s",
module, type_name);
- return NULL;
+ return false;
}
type = (PyTypeObject *)PyObject_GetAttrString(mod, type_name);
@@ -50,7 +50,7 @@ bool py_check_dcerpc_type(PyObject *obj, const char *module, const char *type_na
if (type == NULL) {
PyErr_Format(PyExc_RuntimeError, "Unable to find type %s in module %s",
module, type_name);
- return NULL;
+ return false;
}
ret = PyObject_TypeCheck(obj, type);
--
Samba Shared Repository
More information about the samba-cvs
mailing list