autobuild[sn-devel-144]: intermittent test failure detected

2017-02-10 Thread autobuild
The autobuild test system (on sn-devel-144) 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.sn-devel-144/2017-02-11-0005/flakey.log

The samba build logs are available here:

   
http://git.samba.org/autobuild.flakey.sn-devel-144/2017-02-11-0005/samba.stderr
   
http://git.samba.org/autobuild.flakey.sn-devel-144/2017-02-11-0005/samba.stdout
  
The top commit at the time of the failure was:

commit 32116e015b14cfa697569fce01daf8cde3285970
Author: Ralph Boehme 
Date:   Fri Feb 3 14:57:45 2017 +0100

s3/util: mvxattr, a tool to rename extended attributes

Usage: mvxattr -s STRING -d STRING PATH [PATH ...]
  -s, --from=STRING xattr source name
  -d, --to=STRING   xattr destination name
  -l, --follow-symlinks follow symlinks, the default is to ignore them
  -p, --print   print files where the xattr got renamed
  -v, --verbose print files as they are checked
  -f, --force   force overwriting of destination xattr

Help options:
  -?, --helpShow this help message
  --usage   Display brief usage message

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Fri Feb 10 22:24:59 CET 2017 on sn-devel-144



[SCM] Samba Shared Repository - branch master updated

2017-02-10 Thread Jeremy Allison
The branch, master has been updated
   via  32116e0 s3/util: mvxattr, a tool to rename extended attributes
   via  738797d lib/replace: validate xattr namespace prefix on FreeBSD
   via  e4d1f83 vfs_fruit: cleanup metadata and resource xattr name defines
   via  7355760 vfs_fruit: correct Netatalk metadata xattr on FreeBSD
  from  34b0ee8 messaging_dgm: avoid GCC snprintf warnings in 
messaging_dgm_out_create

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


- Log -
commit 32116e015b14cfa697569fce01daf8cde3285970
Author: Ralph Boehme 
Date:   Fri Feb 3 14:57:45 2017 +0100

s3/util: mvxattr, a tool to rename extended attributes

Usage: mvxattr -s STRING -d STRING PATH [PATH ...]
  -s, --from=STRING xattr source name
  -d, --to=STRING   xattr destination name
  -l, --follow-symlinks follow symlinks, the default is to ignore them
  -p, --print   print files where the xattr got renamed
  -v, --verbose print files as they are checked
  -f, --force   force overwriting of destination xattr

Help options:
  -?, --helpShow this help message
  --usage   Display brief usage message

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Fri Feb 10 22:24:59 CET 2017 on sn-devel-144

commit 738797d8ad6908de457786cc948dcde151e2b9e1
Author: Ralph Boehme 
Date:   Fri Feb 3 18:08:12 2017 +0100

lib/replace: validate xattr namespace prefix on FreeBSD

We should validate the xattr name string ensuring it either begins with
"sytem." or "user.". If it doesn't, we should fail the request with
EINVAL.

The FreeBSD xattr API uses namespaces but doesn't put the namespace name
as a string prefix at the beginning of the xattr name. It gets passed as
an additional int arg instead.

On the other hand, our libreplace xattr API expects the caller to put a
namespace prefix into the xattr name.

Unfortunately the conversion and stripping of the namespace string prefix
from the xattr name gives the following unexpected result on FreeBSD:

rep_setxattr("foo.bar", ...) => xattr with name "bar"

The code checks if the name begins with "system.", if it doesn't find
it, it defaults to the user namespace and then does a strchr(name, '.')
which skips *any* leading string before the first dot.

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Jeremy Allison 

commit e4d1f8354f97ab9007e4c5f7d164937bdc5cd6f1
Author: Ralph Boehme 
Date:   Fri Feb 3 16:43:26 2017 +0100

vfs_fruit: cleanup metadata and resource xattr name defines

Just some cleanup, no change in behaviour. This also removes the hokey
tag. :)

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Jeremy Allison 

commit 73557605fdf72221e3cbc218fc9782d163029a08
Author: Ralph Boehme 
Date:   Fri Feb 3 16:33:00 2017 +0100

vfs_fruit: correct Netatalk metadata xattr on FreeBSD

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Jeremy Allison 

---

Summary of changes:
 docs-xml/manpages/mvxattr.1.xml | 100 ++
 docs-xml/wscript_build  |   1 +
 lib/replace/xattr.c | 105 ++--
 source3/modules/vfs_fruit.c |  12 ++-
 source3/utils/mvxattr.c | 178 
 source3/utils/wscript_build |   8 ++
 source3/wscript |   3 +
 7 files changed, 376 insertions(+), 31 deletions(-)
 create mode 100644 docs-xml/manpages/mvxattr.1.xml
 create mode 100644 source3/utils/mvxattr.c


Changeset truncated at 500 lines:

diff --git a/docs-xml/manpages/mvxattr.1.xml b/docs-xml/manpages/mvxattr.1.xml
new file mode 100644
index 000..034dc3a
--- /dev/null
+++ b/docs-xml/manpages/mvxattr.1.xml
@@ -0,0 +1,100 @@
+
+http://www.samba.org/samba/DTD/samba-doc;>
+
+
+
+   mvxattr
+   1
+   Samba
+   User Commands
+   4.7
+
+
+
+
+   mvxattr
+   Recursively rename extended attributes
+
+
+
+   
+   mvxattr
+   -s STRING, --from=STRING
+   -d STRING, --to=STRING
+   -l, --follow-symlinks
+   -p, --print
+   -v, --verbose
+   -f, --force
+  

[SCM] Socket Wrapper Repository - branch master updated

2017-02-10 Thread Michael Adam
The branch, master has been updated
   via  5af1553 Avoid mutex lock wait in socket close failure
  from  888a62e swrap: Add sanity check in socket_wrapper_max_sockets()

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


- Log -
commit 5af15532cefecb5665736f30e00960c17700d1b0
Author: Anoop C S 
Date:   Fri Feb 10 21:38:11 2017 +0530

Avoid mutex lock wait in socket close failure

In case of absence to close a socket fd during an exit from
application we try to close the same by traversing the
socket_fds in swrap_destructor. But the early lock taken on
libc_symbol_binding_mutex inside the destructor blocks the
subsequent request for locking the same while loading
libc_close within swrap_close.

Also added a test case to verify this flaw in destructor.

Signed-off-by: Anoop C S 
Reviewed-by: Andreas Schneider 
Reviewed-by: Michael Adam 

---

Summary of changes:
 src/socket_wrapper.c   |  4 
 tests/CMakeLists.txt   |  3 ++-
 tests/test_close_failure.c | 50 ++
 3 files changed, 52 insertions(+), 5 deletions(-)
 create mode 100644 tests/test_close_failure.c


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 186b696..3d468c3 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -5656,8 +5656,6 @@ void swrap_destructor(void)
 {
struct socket_info_fd *s = socket_fds;
 
-   SWRAP_LOCK_ALL;
-
while (s != NULL) {
swrap_close(s->fd);
s = socket_fds;
@@ -5671,6 +5669,4 @@ void swrap_destructor(void)
if (swrap.libc.socket_handle) {
dlclose(swrap.libc.socket_handle);
}
-
-   SWRAP_UNLOCK_ALL;
 }
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 9292b40..c2bd799 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -35,7 +35,8 @@ set(SWRAP_TESTS
 test_echo_udp_send_recv
 test_echo_udp_sendmsg_recvmsg
 test_swrap_unit
-test_max_sockets)
+test_max_sockets
+test_close_failure)
 
 if (HAVE_STRUCT_MSGHDR_MSG_CONTROL)
 set(SWRAP_TESTS ${SWRAP_TESTS} test_sendmsg_recvmsg_fd)
diff --git a/tests/test_close_failure.c b/tests/test_close_failure.c
new file mode 100644
index 000..0c9d6a7
--- /dev/null
+++ b/tests/test_close_failure.c
@@ -0,0 +1,50 @@
+#include "torture.h"
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+static int setup(void **state)
+{
+   torture_setup_socket_dir(state);
+
+   return 0;
+}
+
+static int teardown(void **state)
+{
+   torture_teardown_socket_dir(state);
+
+   return 0;
+}
+
+static void test_close_failure(void **state)
+{
+   int s;
+   int rc;
+
+   (void) state; /* unused */
+   (void) s; /*set but not used */
+
+   s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
+
+   assert_int_not_equal(rc, -1);
+
+   /* Do not close the socket here so that destructor
+* handles it and no hang should be observed.*/
+}
+
+int main(void) {
+   int rc;
+
+   const struct CMUnitTest close_failure_tests[] = {
+   cmocka_unit_test_setup_teardown(test_close_failure,
+   setup, teardown),
+   };
+
+   rc = cmocka_run_group_tests(close_failure_tests, NULL, NULL);
+
+   return rc;
+}


-- 
Socket Wrapper Repository



autobuild[sn-devel-144]: intermittent test failure detected

2017-02-10 Thread autobuild
The autobuild test system (on sn-devel-144) 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.sn-devel-144/2017-02-10-1013/flakey.log

The samba build logs are available here:

   
http://git.samba.org/autobuild.flakey.sn-devel-144/2017-02-10-1013/samba.stderr
   
http://git.samba.org/autobuild.flakey.sn-devel-144/2017-02-10-1013/samba.stdout
  
The top commit at the time of the failure was:

commit a592bdc51c47db7274f92031fe192b82d552ca05
Author: Karolin Seeger 
Date:   Thu Feb 9 11:27:45 2017 +0100

docs: Add missing spaces in man smb.conf.

Signed-off-by: Karolin Seeger 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Thu Feb  9 23:58:02 CET 2017 on sn-devel-144



[SCM] Samba Shared Repository - branch master updated

2017-02-10 Thread Andrew Bartlett
The branch, master has been updated
   via  34b0ee8 messaging_dgm: avoid GCC snprintf warnings in 
messaging_dgm_out_create
   via  a091a30 shadow_copy_get_shadow_copy_data: fix GCC snprintf warning
   via  1864322 python provision: fix indenting of doc string
   via  3ee5660 ntlmssp: fix compilation with -O2 -fno-inline
   via  2ad69f4 getncchanges script: use library code, not copied functions.
   via  b02d636 lib/replace tests: prevent GCC fretting over snprintf sizes
   via  1a33044 fix blackbox_supported_features: mkdir -p its directory
   via  c4299da docs/smbconf: update log level list in man page
   via  3c63f47 selftest: show multiple arguments for --help
   via  6f88ff8 waf --test-list takes a filename argument
  from  a592bdc docs: Add missing spaces in man smb.conf.

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


- Log -
commit 34b0ee832850e5a01b337caf70677bdae6eea551
Author: Andrew Bartlett 
Date:   Thu Feb 9 14:03:33 2017 +1300

messaging_dgm: avoid GCC snprintf warnings in messaging_dgm_out_create

We are trying to put something that (in theory) could be 109 bytes
long, into the sockaddr_un.sun_path field which has a fixed size of
108 bytes. The "in theory" part is that one of the components is a
pid, which although stored as 32 bits is in practice 16 bits, so the
maximum size is not actually hit.

This is all very annoying, because the length is checked anyway and
all this achieves is silencing a warning.

Reviewed-by: Douglas Bagnall 
Reviewed-by: Andrew Bartlett 

Autobuild-User(master): Andrew Bartlett 
Autobuild-Date(master): Fri Feb 10 09:05:31 CET 2017 on sn-devel-144

commit a091a30a5bd50bc02df3e9c01b11f70c94dbd053
Author: Douglas Bagnall 
Date:   Thu Feb 9 13:02:52 2017 +1300

shadow_copy_get_shadow_copy_data: fix GCC snprintf warning

GCC 7 warns about snprintf truncating a dirent d_name (potentially 255 
bytes) to 25 bytes,
even though we have checked that it is 25 long in shadow_copy_match_name().

Using strlcpy instead of snprintf lets us check it again, JUST TO BE SURE.

Signed-off-by: Douglas Bagnall 
Reviewed-by: Andrew Bartlett 

commit 18643226a69c3db62db1736d958298a07dd5ab51
Author: Douglas Bagnall 
Date:   Thu Dec 15 09:34:28 2016 +1300

python provision: fix indenting of doc string

Signed-off-by: Douglas Bagnall 
Reviewed-by: Andrew Bartlett 

commit 3ee56607db8b4fedd5d04f74de548ae7324686cd
Author: Douglas Bagnall 
Date:   Wed Dec 21 13:24:46 2016 +1300

ntlmssp: fix compilation with -O2 -fno-inline

Without inlining the function, GCC doesn't know that
gensec_ntlmssp->ntlmssp_state->role always has a valid value.

With inlining, this is obviously redundant but GCC clearly knows
enough to detect this and elide the default case.

Signed-off-by: Douglas Bagnall 
Reviewed-by: Andrew Bartlett 

commit 2ad69f4bd0f724296a40347a140a031f6ab341e9
Author: Douglas Bagnall 
Date:   Fri Oct 28 15:05:28 2016 +1300

getncchanges script: use library code, not copied functions.

These functions were duplicates. To be exact, the diff -ub between what
getncchanges had, and what drs_uitls now has is this:

|@@ -1,4 +1,5 @@
|-def do_DsBind(drs):
|+def drs_DsBind(drs):
| '''make a DsBind call, returning the binding handle'''
| bind_info = drsuapi.DsBindInfoCtr()
| bind_info.length = 28
|@@ -32,7 +33,8 @@
| bind_info.info.supported_extensions   |= 
drsuapi.DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7
| bind_info.info.supported_extensions   |= 
drsuapi.DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT
| (info, handle) = drs.DsBind(misc.GUID(drsuapi.DRSUAPI_DS_BIND_GUID), 
bind_info)
|-return handle
|+
|+return (handle, info.info.supported_extensions)
|
|
| def drs_get_rodc_partial_attribute_set(samdb):
|@@ -43,7 +45,7 @@
| attids = []
|
| # the exact list of attids we send is quite critical. Note that
|-# we do ask for the secret attributes, but set set 
SPECIAL_SECRET_PROCESSING
|+# we do ask for the secret attributes, but set 
SPECIAL_SECRET_PROCESSING
| # to zero them out
| schema_dn = samdb.get_schema_basedn()
| res = samdb.search(base=schema_dn, scope=ldb.SCOPE_SUBTREE,
|@@ -71,3 +73,4 @@
| partial_attribute_set.attids = attids
|