[SCM] Samba Shared Repository - branch master updated

2011-10-01 Thread Richard Sharpe
The branch, master has been updated
   via  595cc42 Add the new test_nttrans_fsctl.c to waf
   via  c875ab8 Move FSCTL handling into the VFS. Initial code changes. 
Passes smbtorture NTTRANS-FSCTL. Test added to selftests.
   via  e8f143a Add a torture test to test existing FSCTL responses
  from  c704d92 Fix bug #8493 - DFS breaks zip file extracting unless 
follow symlinks = no set

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 595cc42a46f5dfbac5c17a403fb1f82769f26ff2
Author: Richard Sharpe realrichardsha...@gmail.com
Date:   Sat Oct 1 09:03:13 2011 -0700

Add the new test_nttrans_fsctl.c to waf

Autobuild-User: Richard Sharpe sha...@samba.org
Autobuild-Date: Sat Oct  1 19:36:53 CEST 2011 on sn-devel-104

commit c875ab8747d65cc6556228616f076b0928013c87
Author: Richard Sharpe realrichardsha...@gmail.com
Date:   Fri Sep 16 11:52:22 2011 -0700

Move FSCTL handling into the VFS. Initial code changes. Passes smbtorture 
NTTRANS-FSCTL. Test added to selftests.

commit e8f143a45cceb8d2c01d45167a0c90d5c7f38289
Author: Richard Sharpe realrichardsha...@gmail.com
Date:   Thu Sep 15 16:13:54 2011 -0700

Add a torture test to test existing FSCTL responses

---

Summary of changes:
 source3/Makefile.in  |1 +
 source3/include/vfs.h|   22 ++
 source3/include/vfs_macros.h |6 +
 source3/modules/vfs_default.c|  335 +++
 source3/selftest/tests.py|2 +-
 source3/smbd/nttrans.c   |  367 +++---
 source3/smbd/vfs.c   |   17 ++
 source3/torture/proto.h  |1 +
 source3/torture/test_nttrans_fsctl.c |  287 ++
 source3/torture/torture.c|1 +
 source3/wscript_build|1 +
 11 files changed, 704 insertions(+), 336 deletions(-)
 create mode 100644 source3/torture/test_nttrans_fsctl.c


Changeset truncated at 500 lines:

diff --git a/source3/Makefile.in b/source3/Makefile.in
index bddde78..c736ae8 100644
--- a/source3/Makefile.in
+++ b/source3/Makefile.in
@@ -1251,6 +1251,7 @@ SMBTORTURE_OBJ1 = torture/torture.o torture/nbio.o 
torture/scanner.o torture/uta
torture/test_async_echo.o \
torture/test_smbsock_any_connect.o \
torture/test_nttrans_create.o \
+   torture/test_nttrans_fsctl.o \
torture/test_notify_online.o \
torture/test_addrchange.o \
torture/test_case_insensitive.o \
diff --git a/source3/include/vfs.h b/source3/include/vfs.h
index b47e80f..3b5e0e7 100644
--- a/source3/include/vfs.h
+++ b/source3/include/vfs.h
@@ -136,6 +136,7 @@
 /* Leave at 28 - not yet released. Rename open function to open_fn. - gd */
 /* Leave at 28 - not yet released. Make getwd function always return malloced 
memory. JRA. */
 /* Bump to version 29 - Samba 3.6.0 will ship with interface version 28. */
+/* Leave at 29 - not yet releases. Add fsctl. Richard Sharpe */
 #define SMB_VFS_INTERFACE_VERSION 29
 
 /*
@@ -329,6 +330,17 @@ struct vfs_fn_pointers {
   TALLOC_CTX *mem_ctx,
   char **mapped_name);
 
+   NTSTATUS (*fsctl)(struct vfs_handle_struct *handle,
+ struct files_struct *fsp,
+ TALLOC_CTX *ctx,
+ uint32_t function,
+ uint16_t req_flags,
+ const uint8_t *_in_data,
+ uint32_t in_len,
+ uint8_t **_out_data,
+ uint32_t max_out_len,
+ uint32_t *out_len); 
+
/* NT ACL operations. */
 
NTSTATUS (*fget_nt_acl)(struct vfs_handle_struct *handle,
@@ -692,6 +704,16 @@ NTSTATUS smb_vfs_call_translate_name(struct 
vfs_handle_struct *handle,
 enum vfs_translate_direction direction,
 TALLOC_CTX *mem_ctx,
 char **mapped_name);
+NTSTATUS smb_vfs_call_fsctl(struct vfs_handle_struct *handle,
+   struct files_struct *fsp,
+   TALLOC_CTX *ctx,
+   uint32_t function,
+   uint16_t req_flags,
+   const uint8_t *_in_data,
+   uint32_t in_len,
+   uint8_t **_out_data,
+   uint32_t max_out_len,
+   uint32_t *out_len); 
 NTSTATUS smb_vfs_call_fget_nt_acl(struct vfs_handle_struct *handle,
  struct files_struct *fsp,
  uint32 security_info,
diff --git 

[SCM] Samba Shared Repository - branch master updated

2011-10-01 Thread Michael Adam
The branch, master has been updated
   via  95bb2c2 s3:registry: fix the test for a REG_SZ blob possibly being 
a zero terminated ucs2 string
   via  b9da423 s3:registry: reg_format: handle unterminated REG_SZ blobs
  from  595cc42 Add the new test_nttrans_fsctl.c to waf

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -
commit 95bb2c23e6e9c52a1e34916dff05b1d306278bc6
Author: Michael Adam ob...@samba.org
Date:   Thu Sep 29 18:06:56 2011 +0200

s3:registry: fix the test for a REG_SZ blob possibly being a zero 
terminated ucs2 string

1. catch data blobs with odd number of bytes (not an ucs2 string at all)
2. test the right ucs2 character to be 0
   (prevent out-of bounds access/potential segfault)

Autobuild-User: Michael Adam ob...@samba.org
Autobuild-Date: Sun Oct  2 01:26:05 CEST 2011 on sn-devel-104

commit b9da4235566ffdd649d7b4a6ca05cecd02cfbd20
Author: Gregor Beck gb...@sernet.de
Date:   Tue Sep 6 09:24:10 2011 +0200

s3:registry: reg_format: handle unterminated REG_SZ blobs

Signed-off-by: Michael Adam ob...@samba.org

---

Summary of changes:
 source3/registry/reg_format.c |   19 ++-
 1 files changed, 18 insertions(+), 1 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/registry/reg_format.c b/source3/registry/reg_format.c
index 658076c..db03961 100644
--- a/source3/registry/reg_format.c
+++ b/source3/registry/reg_format.c
@@ -326,6 +326,21 @@ done:
return ret;
 }
 
+static bool is_zero_terminated_ucs2(const uint8_t* data, size_t len) {
+   const size_t idx = len/sizeof(smb_ucs2_t);
+   const smb_ucs2_t *str = (const smb_ucs2_t*)data;
+
+   if ((len % sizeof(smb_ucs2_t)) != 0) {
+   return false;
+   }
+
+   if (idx == 0) {
+   return false;
+   }
+
+   return (str[idx-1] == 0);
+}
+
 int reg_format_value(struct reg_format* f, const char* name, uint32_t type,
 const uint8_t* data, size_t len)
 {
@@ -334,7 +349,9 @@ int reg_format_value(struct reg_format* f, const char* 
name, uint32_t type,
 
switch (type) {
case REG_SZ:
-   if (!(f-flags  REG_FMT_HEX_SZ)) {
+   if (!(f-flags  REG_FMT_HEX_SZ)
+is_zero_terminated_ucs2(data, len))
+   {
char* str = NULL;
size_t dlen;
if (pull_ucs2_talloc(mem_ctx, str, (const 
smb_ucs2_t*)data, dlen)) {


-- 
Samba Shared Repository