[SCM] Samba Shared Repository - branch master updated

2015-10-14 Thread Volker Lendecke
The branch, master has been updated
   via  808f29c s4: torture: Add SMB2 access-based enumeration test. Passes 
against Win2k12R2.
   via  b1bd84e lib: cli: Add accessor function smb2cli_tcon_flags() to get 
tcon flags.
   via  cc05f73 s3: smbd: Fix our access-based enumeration on "hide 
unreadable" to match Windows.
   via  5538e2a ctdb: fix typos in wscript comment.
  from  cf89c7f ctdb-tests: Fix CID 1327218-1327221

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


- Log -
commit 808f29cb2f9de47dcf78b380cc8767e9546e1954
Author: Jeremy Allison 
Date:   Tue Oct 13 15:33:47 2015 -0700

s4: torture: Add SMB2 access-based enumeration test. Passes against 
Win2k12R2.

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

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

Autobuild-User(master): Volker Lendecke 
Autobuild-Date(master): Wed Oct 14 19:00:03 CEST 2015 on sn-devel-104

commit b1bd84e9c9867092055f29fe39279e1c767f570a
Author: Jeremy Allison 
Date:   Fri Oct 9 15:08:05 2015 -0700

lib: cli: Add accessor function smb2cli_tcon_flags() to get tcon flags.

We need this to see if a share supports access-based enumeration.

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

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit cc05f73872c36cd307da3d6fed200beb16d5c2a8
Author: Jeremy Allison 
Date:   Tue Oct 13 16:49:41 2015 -0700

s3: smbd: Fix our access-based enumeration on "hide unreadable" to match 
Windows.

Torture test to follow.

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

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

commit 5538e2a867b67198fb4146ad4a13d14142c9491d
Author: Michael Adam 
Date:   Wed Oct 14 11:21:52 2015 +0200

ctdb: fix typos in wscript comment.

Signed-off-by: Michael Adam 
Reviewed-by: Volker Lendecke 

---

Summary of changes:
 ctdb/wscript|   2 +-
 libcli/smb/smbXcli_base.c   |   5 +
 libcli/smb/smbXcli_base.h   |   1 +
 selftest/knownfail  |   1 +
 source3/smbd/dir.c  |  64 +++-
 source4/torture/smb2/acls.c | 230 
 6 files changed, 299 insertions(+), 4 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/wscript b/ctdb/wscript
index fcc30c1..0dc4adc 100755
--- a/ctdb/wscript
+++ b/ctdb/wscript
@@ -276,7 +276,7 @@ def build(bld):
 bld.RECURSE('lib/socket_wrapper')
 
 if bld.env.standalone_ctdb:
-# In a combined build is implemented, CTDB will wanted to
+# If a combined build is implemented, CTDB will want to
 # build against samba-util rather than samba-util-core.
 # Similarly, other Samba subsystems expect samba-util.  So,
 # for a standalone build, just define a fake samba-util
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index c1e9e58..6fe4816 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -5991,6 +5991,11 @@ uint32_t smb2cli_tcon_capabilities(struct smbXcli_tcon 
*tcon)
return tcon->smb2.capabilities;
 }
 
+uint32_t smb2cli_tcon_flags(struct smbXcli_tcon *tcon)
+{
+   return tcon->smb2.flags;
+}
+
 void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
 struct smbXcli_session *session,
 uint32_t tcon_id,
diff --git a/libcli/smb/smbXcli_base.h b/libcli/smb/smbXcli_base.h
index cf93135..e4cfb10 100644
--- a/libcli/smb/smbXcli_base.h
+++ b/libcli/smb/smbXcli_base.h
@@ -442,6 +442,7 @@ bool smb1cli_tcon_set_values(struct smbXcli_tcon *tcon,
 const char *fs_type);
 uint32_t smb2cli_tcon_current_id(struct smbXcli_tcon *tcon);
 uint32_t smb2cli_tcon_capabilities(struct smbXcli_tcon *tcon);
+uint32_t smb2cli_tcon_flags(struct smbXcli_tcon *tcon);
 void smb2cli_tcon_set_values(struct smbXcli_tcon *tcon,
 struct smbXcli_session *session,
 uint32_t tcon_id,
diff --git a/selftest/knownfail b/selftest/knownfail
index bf73176..0d74933 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -147,6 +147,7 @@
 ^samba4.smb2.acls.*.generic
 ^samba4.smb2.acls.*.inheritflags
 ^samba4.smb2.acls.*.owner
+^samba4.smb2.acls.*.ACCESSBASED
 
^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.ExtendedDirsyncTests.test_dirsync_deleted_items
 #^samba4.ldap.dirsync.python.ad_dc_ntvfs..__main__.ExtendedDirsyncTests.*
 ^samba4.libsmbclient.opendir.opendir # This requires netbios browsing
diff --git a/source3/smbd/dir.c 

[SCM] Samba Shared Repository - branch master updated

2015-10-14 Thread Volker Lendecke
The branch, master has been updated
   via  880b79a s3:lib/messages: fix error check in 
messaging_filtered_read_send()
  from  74013ae ctdb: Fix CID 1327223 Unbounded source buffer

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


- Log -
commit 880b79addc80486e857174b13e63bc98b13f208c
Author: Ralph Boehme 
Date:   Tue Oct 13 19:08:00 2015 +0200

s3:lib/messages: fix error check in messaging_filtered_read_send()

Signed-off-by: Ralph Boehme 
Reviewed-by: Volker Lendecke 

Autobuild-User(master): Volker Lendecke 
Autobuild-Date(master): Wed Oct 14 10:21:09 CEST 2015 on sn-devel-104

---

Summary of changes:
 source3/lib/messages.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/source3/lib/messages.c b/source3/lib/messages.c
index 03e6097..d059f23 100644
--- a/source3/lib/messages.c
+++ b/source3/lib/messages.c
@@ -642,7 +642,7 @@ struct tevent_req *messaging_filtered_read_send(
 
state->tevent_handle = messaging_dgm_register_tevent_context(
state, ev);
-   if (tevent_req_nomem(state, req)) {
+   if (tevent_req_nomem(state->tevent_handle, req)) {
return tevent_req_post(req, ev);
}
 


-- 
Samba Shared Repository



[SCM] Socket Wrapper Repository - branch master updated

2015-10-14 Thread Andreas Schneider
The branch, master has been updated
   via  f3489d5 swrap: Simplify cmspace calculation in 
swrap_sendmsg_copy_cmsg()
   via  c5e809f tests: Add a unit test for wrap_sendmsg_filter_cmsghdr()
  from  84a4e23 tests: Add test for TCP_NODELAY setsockopt()

https://git.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -
commit f3489d5cb77a804891bdaff3d90449fa7f293dd6
Author: Ralph Boehme 
Date:   Thu Oct 8 03:25:53 2015 +0200

swrap: Simplify cmspace calculation in swrap_sendmsg_copy_cmsg()

With cmsg->cmsg_len = CMSG_LEN(len) =>

CMSG_ALIGN(cmsg->cmsg_len) =

CMSG_ALIGN(CMSG_LEN(len)) =

CMSG_ALIGN(CMSG_ALIGN(sizeof(struct cmsghdr)) + len) =

CMSG_ALIGN(sizeof(struct cmsghdr)) + CMSG_ALIGN(len) =

CMSG_SPACE(len) =

CMSG_SPACE(CMSG_ALIGN(sizeof(struct cmsghdr)) + len - 
CMSG_ALIGN(sizeof(struct cmsghdr))) =

CMSG_SPACE(CMSG_LEN(len) - CMSG_ALIGN(sizeof(struct cmsghdr))) =

CMSG_SPACE(cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)))

:)

Signed-off-by: Ralph Boehme 
Reviewed-by: Andreas Schneider 

commit c5e809fed9a9e2cfce40312150322f28d3d338a6
Author: Ralph Boehme 
Date:   Tue Oct 13 16:38:26 2015 +0200

tests: Add a unit test for wrap_sendmsg_filter_cmsghdr()

Signed-off-by: Ralph Boehme 
Reviewed-by: Andreas Schneider 

---

Summary of changes:
 src/socket_wrapper.c|   4 +-
 tests/CMakeLists.txt|   3 +-
 tests/test_swrap_unit.c | 120 
 3 files changed, 123 insertions(+), 4 deletions(-)
 create mode 100644 tests/test_swrap_unit.c


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index aad5f3e..353ad1d 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -3739,9 +3739,7 @@ static int swrap_sendmsg_copy_cmsg(struct cmsghdr *cmsg,
size_t cmspace;
uint8_t *p;
 
-   cmspace =
-   (*cm_data_space) +
-   CMSG_SPACE(cmsg->cmsg_len - CMSG_ALIGN(sizeof(struct cmsghdr)));
+   cmspace = *cm_data_space + CMSG_ALIGN(cmsg->cmsg_len);
 
p = realloc((*cm_data), cmspace);
if (p == NULL) {
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 0cb7f78..9679177 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -30,7 +30,8 @@ set(SWRAP_TESTS
 test_echo_tcp_get_peer_sock_name
 test_echo_udp_sendto_recvfrom
 test_echo_udp_send_recv
-test_echo_udp_sendmsg_recvmsg)
+test_echo_udp_sendmsg_recvmsg
+test_swrap_unit)
 
 if (HAVE_STRUCT_MSGHDR_MSG_CONTROL)
 set(SWRAP_TESTS ${SWRAP_TESTS} test_sendmsg_recvmsg_fd)
diff --git a/tests/test_swrap_unit.c b/tests/test_swrap_unit.c
new file mode 100644
index 000..469aa24
--- /dev/null
+++ b/tests/test_swrap_unit.c
@@ -0,0 +1,120 @@
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include "config.h"
+
+#include "socket_wrapper.c"
+
+#ifdef HAVE_STRUCT_MSGHDR_MSG_CONTROL
+
+/**
+ * test wrap_sendmsg_filter_cmsghdr()
+ *
+ * Prepare a message with two cmsg:
+ * - the first cmsg is a char buf with the string "Hello World"
+ * - the second cmsg is a char buf with the string "!\n"
+ *
+ * Both cmsgs will be copied without modification by
+ * wrap_sendmsg_filter_cmsghdr(), so we can check that the msg
+ * controllen, the cmsg sizes and the payload are the same.
+ *
+ * We use an not existing cmsg_type which triggers cmsg copying.
+ */
+static void test_sendmsg_cmsg(void **state)
+{
+   int rc = 0;
+   char byte = '!';
+   struct iovec iov;
+   struct msghdr msg = { 0 };
+   struct cmsghdr *cmsg;
+   char *cmsgbuf;
+   int cmsgbuf_size;
+   const char *s1 = "Hello World";
+   const int s1_len = strlen(s1);
+   const char *s2 = "!\n";
+   const int s2_len = strlen(s2);
+   uint8_t *cmbuf = NULL;
+   size_t cmlen = 0;
+
+   (void)state; /* unused */
+
+   iov.iov_base = 
+   iov.iov_len = 1;
+
+   /*
+* Prepare cmsgbuf and msg
+*/
+   msg.msg_iov = 
+   msg.msg_iovlen = 1;
+   cmsgbuf_size = CMSG_SPACE(s1_len) + CMSG_SPACE(s2_len);
+   cmsgbuf = calloc(cmsgbuf_size, sizeof(char));
+   assert_non_null(cmsgbuf);
+   msg.msg_control = cmsgbuf;
+   msg.msg_controllen = cmsgbuf_size;
+
+   /*
+* Prepare first cmsg with string "Hello World"
+*/
+   cmsg = CMSG_FIRSTHDR();
+   assert_non_null(cmsg);
+
+   cmsg->cmsg_level = SOL_SOCKET;
+   cmsg->cmsg_type = ~0 - 1;
+   cmsg->cmsg_len = CMSG_LEN(s1_len);
+   memcpy(CMSG_DATA(cmsg), s1, s1_len);
+
+   /*
+* Prepare second cmsg with string "!\n"
+*/
+   cmsg = CMSG_NXTHDR(, cmsg);
+  

[SCM] Socket Wrapper Repository - branch master updated

2015-10-14 Thread Michael Adam
The branch, master has been updated
   via  84a4e23 tests: Add test for TCP_NODELAY setsockopt()
   via  96dbeb7 tests: Add test for TCP_NODELAY getsockopt()
   via  1db6130 swrap: Add support for TCP_NODELAY in getsockopt()
   via  e9e0dac swrap: Add support for TCP_NODELAY in setsockopt()
  from  40b1926 Bump version to 1.1.4

https://git.samba.org/?p=socket_wrapper.git;a=shortlog;h=master


- Log -
commit 84a4e23728a558984f449610b9e84933acfb0515
Author: Andreas Schneider 
Date:   Thu Oct 8 11:02:10 2015 +0200

tests: Add test for TCP_NODELAY setsockopt()

Signed-off-by: Andreas Schneider 
Reviewed-by: Michael Adam 

commit 96dbeb75f78665cf81a4ef8e3842e819043f8d51
Author: Andreas Schneider 
Date:   Mon Sep 14 22:07:09 2015 +0200

tests: Add test for TCP_NODELAY getsockopt()

Signed-off-by: Andreas Schneider 
Reviewed-by: Michael Adam 

commit 1db61302b6036bdfabf0e3a1507e0e5573a57368
Author: Andreas Schneider 
Date:   Mon Sep 14 22:06:52 2015 +0200

swrap: Add support for TCP_NODELAY in getsockopt()

Signed-off-by: Andreas Schneider 
Reviewed-by: Michael Adam 

commit e9e0dac6d719304af8174f4b9119709afe71f508
Author: Andreas Schneider 
Date:   Thu Oct 8 10:51:02 2015 +0200

swrap: Add support for TCP_NODELAY in setsockopt()

Signed-off-by: Andreas Schneider 
Reviewed-by: Michael Adam 

---

Summary of changes:
 src/socket_wrapper.c | 53 
 tests/test_echo_tcp_socket_options.c | 49 +
 2 files changed, 102 insertions(+)


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 45282ed..aad5f3e 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -248,6 +248,7 @@ struct socket_info
int connected;
int defer_connect;
int pktinfo;
+   int tcp_nodelay;
 
/* The unix path so we can unlink it on close() */
struct sockaddr_un un_addr;
@@ -3350,6 +3351,29 @@ static int swrap_getsockopt(int s, int level, int 
optname,
   optval,
   optlen);
}
+   } else if (level == IPPROTO_TCP) {
+   switch (optname) {
+#ifdef TCP_NODELAY
+   case TCP_NODELAY:
+   /*
+* This enables sending packets directly out over TCP.
+* As a unix socket is doing that any way, report it as
+* enabled.
+*/
+   if (optval == NULL || optlen == NULL ||
+   *optlen < (socklen_t)sizeof(int)) {
+   errno = EINVAL;
+   return -1;
+   }
+
+   *optlen = sizeof(int);
+   *(int *)optval = si->tcp_nodelay;
+
+   return 0;
+#endif /* TCP_NODELAY */
+   default:
+   break;
+   }
}
 
errno = ENOPROTOOPT;
@@ -3388,6 +3412,35 @@ static int swrap_setsockopt(int s, int level, int 
optname,
   optname,
   optval,
   optlen);
+   } else if (level == IPPROTO_TCP) {
+   switch (optname) {
+#ifdef TCP_NODELAY
+   case TCP_NODELAY: {
+   int i;
+
+   /*
+* This enables sending packets directly out over TCP.
+* A unix socket is doing that any way.
+*/
+   if (optval == NULL || optlen == 0 ||
+   optlen < (socklen_t)sizeof(int)) {
+   errno = EINVAL;
+   return -1;
+   }
+
+   i = *discard_const_p(int, optval);
+   if (i != 0 && i != 1) {
+   errno = EINVAL;
+   return -1;
+   }
+   si->tcp_nodelay = i;
+
+   return 0;
+   }
+#endif /* TCP_NODELAY */
+   default:
+   break;
+   }
}
 
switch (si->family) {
diff --git a/tests/test_echo_tcp_socket_options.c 
b/tests/test_echo_tcp_socket_options.c
index f068fb8..dfa46fe 100644
--- a/tests/test_echo_tcp_socket_options.c
+++ b/tests/test_echo_tcp_socket_options.c
@@ -10,6 +10,7 @@
 

[SCM] Samba Shared Repository - branch master updated

2015-10-14 Thread Volker Lendecke
The branch, master has been updated
   via  cf89c7f ctdb-tests: Fix CID 1327218-1327221
  from  880b79a s3:lib/messages: fix error check in 
messaging_filtered_read_send()

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


- Log -
commit cf89c7f42ef7f2a8954cb3a9920f80ee4fddfb5f
Author: Amitay Isaacs 
Date:   Wed Oct 14 10:09:08 2015 +1100

ctdb-tests: Fix CID 1327218-1327221

Signed-off-by: Amitay Isaacs 

Autobuild-User(master): Volker Lendecke 
Autobuild-Date(master): Wed Oct 14 13:32:02 CEST 2015 on sn-devel-104

---

Summary of changes:
 ctdb/tests/src/db_hash_test.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)


Changeset truncated at 500 lines:

diff --git a/ctdb/tests/src/db_hash_test.c b/ctdb/tests/src/db_hash_test.c
index e05d116..cc8a689 100644
--- a/ctdb/tests/src/db_hash_test.c
+++ b/ctdb/tests/src/db_hash_test.c
@@ -27,9 +27,8 @@ static void do_test(enum db_hash_type type)
 {
struct db_hash_context *dh;
TALLOC_CTX *mem_ctx = talloc_new(NULL);
-   TALLOC_CTX *tmp_ctx = talloc_new(NULL);
-   uint8_t *key = (uint8_t *)talloc_strdup(tmp_ctx, "This is a long key");
-   uint8_t *value = (uint8_t *)talloc_strdup(tmp_ctx, "This is a long 
value");
+   uint8_t key[] = "This is a long key";
+   uint8_t value[] = "This is a long value";
int ret;
 
ret = db_hash_init(mem_ctx, "foobar", 1024, type, );


-- 
Samba Shared Repository



autobuild: intermittent test failure detected

2015-10-14 Thread autobuild
The autobuild test system has detected an intermittent failing test in 
the current master tree.

The autobuild log of the failure is available here:

   http://git.samba.org/autobuild.flakey/2015-10-15-0608/flakey.log

The samba build logs are available here:

   http://git.samba.org/autobuild.flakey/2015-10-15-0608/samba.stderr
   http://git.samba.org/autobuild.flakey/2015-10-15-0608/samba.stdout
  
The top commit at the time of the failure was:

commit 808f29cb2f9de47dcf78b380cc8767e9546e1954
Author: Jeremy Allison 
Date:   Tue Oct 13 15:33:47 2015 -0700

s4: torture: Add SMB2 access-based enumeration test. Passes against 
Win2k12R2.

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

Signed-off-by: Jeremy Allison 
Reviewed-by: Volker Lendecke 

Autobuild-User(master): Volker Lendecke 
Autobuild-Date(master): Wed Oct 14 19:00:03 CEST 2015 on sn-devel-104