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

2018-11-13 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:

   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-14-0822/flakey.log

The failure seems to be in the "samba" suite, whose build logs are available 
here:

   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-14-0822/samba.stderr
   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-14-0822/samba.stdout
  
The top commit at the time of the failure was:

commit 3634e20c7603103b0f2e00e5b61cc63f905d780d
Author: Jeremy Allison 
Date:   Mon Nov 12 11:37:31 2018 -0800

s3: lib: nmbname: Ensure we limit the NetBIOS name correctly. CID: 1433607

Firstly, make the exit condition from the loop explicit (we must
never write into byte n, where n >= sizeof(name->name).

Secondly ensure exiting from the loop that n==MAX_NETBIOSNAME_LEN,
as this is the sign of a correct NetBIOS name encoding (RFC1002)
in order to properly read the NetBIOS name type (which is always
encoded in byte 16 == name->name[15]).

Signed-off-by: Jeremy Allison 
Reviewed-by: David Disseldorp 

Autobuild-User(master): David Disseldorp 
Autobuild-Date(master): Tue Nov 13 20:54:56 CET 2018 on sn-devel-144

and the last 50 lines of the stdout log were:

[792(4836)/851 at 1h23m26s] samba4.rpc.echo.testdenied(rodc:local)
[793(4846)/851 at 1h23m29s] samba4.blackbox.smbclient(rodc:local)(rodc:local)
[794(4848)/851 at 1h23m30s] samba.tests.samba_tool.rodc(rodc:local)
[795(4857)/851 at 1h23m59s] samba.blackbox.rpcclient_samlogon(rodc:local)
[796(4861)/851 at 1h24m0s] 
samba.blackbox.rpcclient_samlogon_testallowed(rodc:local)
[797(4865)/851 at 1h24m0s] 
samba.blackbox.rpcclient_samlogon_testdenied(rodc:local)
[798(4869)/851 at 1h24m1s] 
samba4.drs.ridalloc_exop.python(vampire_dc)(vampire_dc)
[799(4880)/851 at 1h29m22s] 
samba4.drs.samba_tool_drs.python(vampire_dc)(vampire_dc:local)
[800(4894)/851 at 1h32m45s] 
samba4.drs.samba_tool_drs_showrepl.python(vampire_dc)(vampire_dc:local)
[801(4898)/851 at 1h32m57s] 
samba4.drs.replica_sync.python(vampire_dc)(vampire_dc:local)
[802(4914)/851 at 1h37m10s] 
samba4.drs.delete_object.python(vampire_dc)(vampire_dc)
[803(4916)/851 at 1h37m30s] samba4.drs.fsmo.python(vampire_dc)(vampire_dc)
[804(4921)/851 at 1h37m47s] samba4.drs.repl_move.python(vampire_dc)(vampire_dc)
[805(4942)/851 at 1h39m37s] samba4.drs.getnc_exop.python(vampire_dc)(vampire_dc)
[806(4954)/851 at 1h39m57s] 
samba4.drs.getnc_unpriv.python(vampire_dc)(vampire_dc)
[807(4958)/851 at 1h40m4s] 
samba4.drs.linked_attributes_drs.python(vampire_dc)(vampire_dc)
[808(4961)/851 at 1h40m6s] 
samba4.drs.link_conflicts.python(vampire_dc)(vampire_dc)
[809(4973)/851 at 1h47m37s] 
samba4.drs.samba_tool_drs.python(promoted_dc)(promoted_dc:local)
[810(4987)/851 at 1h51m1s] 
samba4.drs.samba_tool_drs_showrepl.python(promoted_dc)(promoted_dc:local)
[811(4991)/851 at 1h51m13s] 
samba4.drs.replica_sync.python(promoted_dc)(promoted_dc:local)
[812(5007)/851 at 1h55m1s] 
samba4.drs.delete_object.python(promoted_dc)(promoted_dc)
[813(5009)/851 at 1h55m16s] samba4.drs.fsmo.python(promoted_dc)(promoted_dc)
[814(5014)/851 at 1h55m33s] 
samba4.drs.repl_move.python(promoted_dc)(promoted_dc)
[815(5035)/851 at 1h57m28s] 
samba4.drs.getnc_exop.python(promoted_dc)(promoted_dc)
UNEXPECTED(failure): 
samba4.drs.getnc_exop.python(promoted_dc).getnc_exop.DrsReplicaSyncTestCase.test_link_utdv_hwm(promoted_dc)
REASON: Exception: Exception: Traceback (most recent call last):
  File 
"/memdisk/autobuild/fl/b4124520/samba/source4/torture/drs/python/getnc_exop.py",
 line 267, in test_link_utdv_hwm
drsuapi.DRSUAPI_DRS_WRIT_REP)
  File 
"/memdisk/autobuild/fl/b4124520/samba/source4/torture/drs/python/drs_base.py", 
line 364, in _check_replication
dn_ordered=dn_ordered)
  File 
"/memdisk/autobuild/fl/b4124520/samba/source4/torture/drs/python/drs_base.py", 
line 387, in _check_ctr6
self.assertEqual(ctr6.object_count, len(expected_dns))
AssertionError: 4 != 3

FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)

A summary with detailed information can be found in:
  ./bin/ab/summary
TOP 10 slowest tests
samba4.drs.link_conflicts.python(vampire_dc)(vampire_dc) -> 451
samba4.ldap.rodc_rwdc.python(rodc)(rodc:local) -> 440
samba4.drs.ridalloc_exop.python(vampire_dc)(vampire_dc) -> 321
samba4.ldap.confidential_attr.python(ad_dc_ntvfs)(ad_dc_ntvfs) -> 311
samba4.drs.replica_sync.python(vampire_dc)(vampire_dc:local) -> 253
samba4.drs.replica_sync.python(promoted_dc)(promoted_dc:local) -> 228
samba4.rpc.samr.passwords.lockout on ncacn_np with (ad_dc_ntvfs) -> 227
samba4.ldap.vlv.python(ad_dc_ntvfs)(ad_dc_ntvfs) -> 222
samba4.drs.samba_tool_drs.python(promoted_dc)(promoted_dc:local) -> 204
samba4.drs.samba_tool_drs.python(vampire_dc)(vampire_dc:local) -> 203
ERROR: test failed with exit code 1



[SCM] Samba Shared Repository - branch master updated

2018-11-13 Thread Andrew Bartlett
The branch, master has been updated
   via  483d5ea5c88 CI: Autobuild: Remove build_samba_ad_dc_2_py3 CI job
   via  321002e37e3 CI: Add new CI job for new purepy3-ad-dc-2 autobuild 
task
   via  2ca3b3ebd8a script: Add new (temporary) pure python3 ad-dc-2 test
   via  3495f3fc838 s4/scripting/bin: gensec_client.update needs bytes
   via  a5c8ab277b1 python/samba/tests: Ensure samba_dnsupdate called with 
correct python version
   via  48cc8a4e321 s4/scripting/bin: PY3 convert servicePrincipalName attr 
to string
   via  8bf82d9f858 python/samba/tests: PY3 Fix str/bytes issue for 
json.loads
   via  f176461cf29 python/samba: PY3 fix can't compare string with int
   via  fe859a44772 s4/dsdb/tests: PY3 port of samba4.ldap.acl.python
   via  e6ea052c8cb s4/dsdb/tests/python: PY3 port samba4.ldap.secdesc
   via  17158129158 s4/dsdb/tests/python: PY3 port samba4.ldap_schema.python
   via  32a490d6818 python/samba/netcmd: PY3 port 
samba4.blackbox.ldapcmp_restore
   via  fdb3aa487f0 python/samba/netcmd: PY3 port 
samba.tests.samba_tool.edit
   via  a25367685d8 s3/torture: PY3 port samba.ntlm_auth
   via  b16043f57d5 python/samba/tests: PY3 port 
samba.tests.blackbox.netads_json
   via  108109360a5 python/samba/tests: Port 
samba.tests.blackbox.samba_dnsupdate for PY2/PY3
   via  0ef6e3da4b6 testprogs/blackbox: PY3 bulk change for python scripts 
use correct python
   via  5b4c6648566 python/samba/provision: PY3 port 
samba4.dlz_bind9.version
   via  008b9652cac ctdb: Fix an out of bound array access
   via  050d1e7d53c lib:util Always initialize start and space
   via  159f753732c libgpo: Make sure status is intialized
   via  9c37ed26f0a librpc:ndr: Initialize inblob
   via  56ac8944eb5 s3:rpcclient: Initialize domain_name
  from  3634e20c760 s3: lib: nmbname: Ensure we limit the NetBIOS name 
correctly. CID: 1433607

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


- Log -
commit 483d5ea5c88a0cd9a107957883534b2e5b65f3b0
Author: Noel Power 
Date:   Thu Oct 25 17:54:38 2018 +0100

CI: Autobuild: Remove build_samba_ad_dc_2_py3 CI job

We now run a purepython3 ad-dc-2 test job, later when the whole
build is running under python3 we will resurrect build_samba_ad_dc_2_py3
but as (build_samba_ad_dc_py2) for python2

Signed-off-by: Noel Power 
Reviewed-by: Andrew Bartlett 

Autobuild-User(master): Andrew Bartlett 
Autobuild-Date(master): Wed Nov 14 08:20:55 CET 2018 on sn-devel-144

commit 321002e37e3cb467c44dc927b081f2e6c64cfcce
Author: Noel Power 
Date:   Thu Oct 25 17:53:35 2018 +0100

CI: Add new CI job for new purepy3-ad-dc-2 autobuild task

Signed-off-by: Noel Power 
Reviewed-by: Andrew Bartlett 

commit 2ca3b3ebd8ac31e1b3a33b57d706740ed0edf110
Author: Noel Power 
Date:   Thu Oct 25 17:50:18 2018 +0100

script: Add new (temporary) pure python3 ad-dc-2 test

Ideally we want all the tests to run under python3 by default (no
special task for this) and then convert the existing '-py3' tasks
to run the python tests with python3.
However at the moment the convertion process is not ready to do this,
for a while we need to run separate autobuild tasks for this.

Signed-off-by: Noel Power 
Reviewed-by: Andrew Bartlett 

commit 3495f3fc838376b9a2dd3b43976a8884574842fb
Author: Noel Power 
Date:   Tue Oct 30 13:29:13 2018 +

s4/scripting/bin: gensec_client.update needs bytes

PY3 test was failing as param passed to update was str rather than bytes

Signed-off-by: Noel Power 
Reviewed-by: Andrew Bartlett 

commit a5c8ab277b1fa75289ca6a7ee2c87e079b9a6b7d
Author: Noel Power 
Date:   Tue Oct 30 13:22:11 2018 +

python/samba/tests: Ensure samba_dnsupdate called with correct python 
version

We need to examine the contents of PYTHON env variable which should defined 
the
python version to be used when running tests.

Signed-off-by: Noel Power 
Reviewed-by: Andrew Bartlett 

commit 48cc8a4e3214a571b2917dc3b677b44cccfa7286
Author: Tim Beale 
Date:   Tue Oct 30 12:51:54 2018 +

s4/scripting/bin: PY3 convert servicePrincipalName attr to string

res[0]["servicePrincipalName"] is an instance of ldb.bytes in PY3
If we wish to get the string value we need to call the custom
str function which attempts to decode the bytes to 'utf8'

Signed-off-by: Tim Beale 
Reviewed-by: Andrew Bartlett 
Reviewed by: Noel Power 

commit 8bf82d9f8584673a00529166263b39ff796d1985
Author: Noel Power 
Date:   Thu Oct 25 19:10:30 2018 +0100

python/samba/tests: PY3 Fix str/bytes issue for json.loads

Python 3.4 seems to need a string

parsed = json.loads (out_jsobj)
  File "/usr/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))

[SCM] Samba Shared Repository - branch master updated

2018-11-13 Thread David Disseldorp
The branch, master has been updated
   via  3634e20c760 s3: lib: nmbname: Ensure we limit the NetBIOS name 
correctly. CID: 1433607
  from  5a8583ed701 libcli/smb: don't overwrite status code

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


- Log -
commit 3634e20c7603103b0f2e00e5b61cc63f905d780d
Author: Jeremy Allison 
Date:   Mon Nov 12 11:37:31 2018 -0800

s3: lib: nmbname: Ensure we limit the NetBIOS name correctly. CID: 1433607

Firstly, make the exit condition from the loop explicit (we must
never write into byte n, where n >= sizeof(name->name).

Secondly ensure exiting from the loop that n==MAX_NETBIOSNAME_LEN,
as this is the sign of a correct NetBIOS name encoding (RFC1002)
in order to properly read the NetBIOS name type (which is always
encoded in byte 16 == name->name[15]).

Signed-off-by: Jeremy Allison 
Reviewed-by: David Disseldorp 

Autobuild-User(master): David Disseldorp 
Autobuild-Date(master): Tue Nov 13 20:54:56 CET 2018 on sn-devel-144

---

Summary of changes:
 source3/libsmb/nmblib.c | 34 +-
 1 file changed, 21 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/nmblib.c b/source3/libsmb/nmblib.c
index ef6177e5209..727939575a7 100644
--- a/source3/libsmb/nmblib.c
+++ b/source3/libsmb/nmblib.c
@@ -207,25 +207,33 @@ static int parse_nmb_name(char *inbuf,int ofs,int length, 
struct nmb_name *name)
unsigned char c1,c2;
c1 = ubuf[offset++]-'A';
c2 = ubuf[offset++]-'A';
-   if ((c1 & 0xF0) || (c2 & 0xF0) || (n > sizeof(name->name)-1))
+   if ((c1 & 0xF0) || (c2 & 0xF0)) {
return(0);
+   }
+   if (n >= sizeof(name->name)) {
+   return 0;
+   }
name->name[n++] = (c1<<4) | c2;
m -= 2;
}
-   name->name[n] = 0;
-
-   if (n==MAX_NETBIOSNAME_LEN) {
-   /* parse out the name type, its always
-* in the 16th byte of the name */
-   name->name_type = ((unsigned char)name->name[15]) & 0xff;
-
-   /* remove trailing spaces */
-   name->name[15] = 0;
-   n = 14;
-   while (n && name->name[n]==' ')
-   name->name[n--] = 0;
+   /*
+* RFC1002: For a valid NetBIOS name, exiting from the above,
+* n *must* be MAX_NETBIOSNAME_LEN (16).
+*/
+   if (n != MAX_NETBIOSNAME_LEN) {
+   return 0;
}
 
+   /* parse out the name type, its always
+* in the 16th byte of the name */
+   name->name_type = ((unsigned char)name->name[15]) & 0xff;
+
+   /* remove trailing spaces */
+   name->name[15] = 0;
+   n = 14;
+   while (n && name->name[n]==' ')
+   name->name[n--] = 0;
+
/* now the domain parts (if any) */
n = 0;
while (ubuf[offset]) {


-- 
Samba Shared Repository



[SCM] Socket Wrapper Repository - branch master updated

2018-11-13 Thread Andreas Schneider
The branch, master has been updated
   via  9731458 swrap: Do not log if we are over the limit in 
find_socket_info_index()
   via  9b01066 swrap: Also log the fd in swrap_socket()
  from  ce38138 swrap: Fix comparison of different signedness

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


- Log -
commit 97314589dec9feca4c10c2350dfbd7702ff44cb1
Author: Andreas Schneider 
Date:   Tue Nov 13 18:44:39 2018 +0100

swrap: Do not log if we are over the limit in find_socket_info_index()

There are applications which do:

for (fd = 0; fd <= getdtablesize(); fd++) {
close(fd)
};

This produced millions of error messsages.

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

commit 9b01066059a002d15996d797d911fdd693e29cb7
Author: Andreas Schneider 
Date:   Tue Nov 13 18:18:22 2018 +0100

swrap: Also log the fd in swrap_socket()

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

---

Summary of changes:
 src/socket_wrapper.c | 25 +++--
 1 file changed, 19 insertions(+), 6 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index ae3b2b0..df70df5 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1540,11 +1540,23 @@ static int find_socket_info_index(int fd)
}
 
if ((size_t)fd >= socket_fds_max) {
+   /*
+* Do not add a log here as some applications do stupid things
+* like:
+*
+* for (fd = 0; fd <= getdtablesize(); fd++) {
+* close(fd)
+* };
+*
+* This would produce millions of lines of debug messages.
+*/
+#if 0
SWRAP_LOG(SWRAP_LOG_ERROR,
- "The max socket index limit of %zu has been reached, "
- "trying to add %d",
- socket_fds_max,
- fd);
+ "Looking for a socket info for the fd %d is over the "
+ "max socket index limit of %zu.",
+ fd,
+ socket_fds_max);
+#endif
return -1;
}
 
@@ -3161,9 +3173,10 @@ static int swrap_socket(int family, int type, int 
protocol)
}
 
SWRAP_LOG(SWRAP_LOG_TRACE,
- "Created %s socket for protocol %s",
+ "Created %s socket for protocol %s, fd=%d",
  family == AF_INET ? "IPv4" : "IPv6",
- real_type == SOCK_DGRAM ? "UDP" : "TCP");
+ real_type == SOCK_DGRAM ? "UDP" : "TCP",
+ fd);
 
return fd;
 }


-- 
Socket Wrapper Repository



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

2018-11-13 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:

   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-13-1904/flakey.log

The failure seems to be in the "ctdb" suite, whose build logs are available 
here:

   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-13-1904/ctdb.stderr
   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-13-1904/ctdb.stdout
  
The top commit at the time of the failure was:

commit 5a8583ed701be97c33a20b2a20f6bbb8ac2f8e99
Author: Ralph Boehme 
Date:   Wed Nov 7 14:00:25 2018 +0100

libcli/smb: don't overwrite status code

The original commit c5cd22b5bbce724dcd68fe94320382b3f772cabf from bug
9175 never worked, as the preceeding signing check overwrote the status
variable.

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Stefan Metzmacher 

Autobuild-User(master): Ralph Böhme 
Autobuild-Date(master): Tue Nov 13 17:28:45 CET 2018 on sn-devel-144

and the last 50 lines of the stdout log were:

 PASSED  tests/simple/07_ctdb_process_exists.sh
 PASSED  tests/simple/08_ctdb_isnotrecmaster.sh
 PASSED  tests/simple/09_ctdb_ping.sh
 PASSED  tests/simple/11_ctdb_ip.sh
 PASSED  tests/simple/12_ctdb_getdebug.sh
 PASSED  tests/simple/13_ctdb_setdebug.sh
 PASSED  tests/simple/14_ctdb_statistics.sh
 PASSED  tests/simple/15_ctdb_statisticsreset.sh
 PASSED  tests/simple/16_ctdb_config_add_ip.sh
 PASSED  tests/simple/17_ctdb_config_delete_ip.sh
 PASSED  tests/simple/18_ctdb_reloadips.sh
 PASSED  tests/simple/19_ip_takeover_noop.sh
 PASSED  tests/simple/20_delip_iface_gc.sh
 PASSED  tests/simple/21_ctdb_attach.sh
 PASSED  tests/simple/23_ctdb_moveip.sh
 PASSED  tests/simple/24_ctdb_getdbmap.sh
 PASSED  tests/simple/25_dumpmemory.sh
 PASSED  tests/simple/26_ctdb_config_check_error_on_unreachable_ctdb.sh
 PASSED  tests/simple/27_ctdb_detach.sh
 PASSED  tests/simple/28_zero_eventscripts.sh
 PASSED  tests/simple/32_ctdb_disable_enable.sh
 PASSED  tests/simple/35_ctdb_getreclock.sh
 PASSED  tests/simple/42_ctdb_stop_continue.sh
 PASSED  tests/simple/43_stop_recmaster_yield.sh
 PASSED  tests/simple/51_message_ring.sh
 PASSED  tests/simple/52_fetch_ring.sh
 PASSED  tests/simple/53_transaction_loop.sh
 PASSED  tests/simple/54_transaction_loop_recovery.sh
 PASSED  tests/simple/55_ctdb_ptrans.sh
 PASSED  tests/simple/56_replicated_transaction_recovery.sh
 PASSED  tests/simple/58_ctdb_restoredb.sh
 PASSED  tests/simple/60_recoverd_missing_ip.sh
 PASSED  tests/simple/69_recovery_resurrect_deleted.sh
 PASSED  tests/simple/70_recoverpdbbyseqnum.sh
 PASSED  tests/simple/71_ctdb_wipedb.sh
 PASSED  tests/simple/72_update_record_persistent.sh
 PASSED  tests/simple/73_tunable_NoIPTakeover.sh
 PASSED  tests/simple/75_readonly_records_basic.sh
 PASSED  tests/simple/76_ctdb_pdb_recovery.sh
 PASSED  tests/simple/77_ctdb_db_recovery.sh
 PASSED  tests/simple/78_ctdb_large_db_recovery.sh
 PASSED  tests/simple/79_volatile_db_traverse.sh
 PASSED  tests/simple/80_ctdb_traverse.sh
 PASSED  tests/simple/81_tunnel_ring.sh
*FAILED* tests/simple/90_debug_hung_script.sh

528/529 tests passed

Removing TEST_VAR_DIR=/memdisk/autobuild/fl/b3171983/ctdb/ctdb/tests/var
autotest exited with exit status 1



[SCM] Samba Shared Repository - branch master updated

2018-11-13 Thread Ralph Böhme
The branch, master has been updated
   via  5a8583ed701 libcli/smb: don't overwrite status code
   via  a5d1bb5c5b5 s4:torture/smb2/session: test 
smbXcli_session_set_disconnect_expired() works
  from  bb93e691ca9 s3:smb2_sesssetup: check session_info security level 
before it gets talloc_move'd

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


- Log -
commit 5a8583ed701be97c33a20b2a20f6bbb8ac2f8e99
Author: Ralph Boehme 
Date:   Wed Nov 7 14:00:25 2018 +0100

libcli/smb: don't overwrite status code

The original commit c5cd22b5bbce724dcd68fe94320382b3f772cabf from bug
9175 never worked, as the preceeding signing check overwrote the status
variable.

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Stefan Metzmacher 

Autobuild-User(master): Ralph Böhme 
Autobuild-Date(master): Tue Nov 13 17:28:45 CET 2018 on sn-devel-144

commit a5d1bb5c5b5a57a2d7710dc5ab962683fe5c8e68
Author: Ralph Boehme 
Date:   Tue Nov 13 12:08:10 2018 +0100

s4:torture/smb2/session: test smbXcli_session_set_disconnect_expired() works

This adds a simple test that verifies that after having set
smbXcli_session_set_disconnect_expired() a session gets disconnected
when it expires.

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

Signed-off-by: Ralph Boehme 
Reviewed-by: Stefan Metzmacher 

---

Summary of changes:
 libcli/smb/smbXcli_base.c  |  12 +++--
 source4/torture/smb2/session.c | 110 +
 2 files changed, 117 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c
index d0cc33b8b05..40480c83aa0 100644
--- a/libcli/smb/smbXcli_base.c
+++ b/libcli/smb/smbXcli_base.c
@@ -3908,15 +3908,17 @@ static NTSTATUS smb2cli_conn_dispatch_incoming(struct 
smbXcli_conn *conn,
}
 
if (signing_key) {
-   status = smb2_signing_check_pdu(*signing_key,
-   state->conn->protocol,
-   [1], 3);
-   if (!NT_STATUS_IS_OK(status)) {
+   NTSTATUS signing_status;
+
+   signing_status = smb2_signing_check_pdu(*signing_key,
+   
state->conn->protocol,
+   [1], 3);
+   if (!NT_STATUS_IS_OK(signing_status)) {
/*
 * If the signing check fails, we disconnect
 * the connection.
 */
-   return status;
+   return signing_status;
}
}
 
diff --git a/source4/torture/smb2/session.c b/source4/torture/smb2/session.c
index 57a5addcfcc..3917e0c09c4 100644
--- a/source4/torture/smb2/session.c
+++ b/source4/torture/smb2/session.c
@@ -1596,6 +1596,114 @@ static bool test_session_expire2e(struct 
torture_context *tctx)
 true); /* force_encryption */
 }
 
+static bool test_session_expire_disconnect(struct torture_context *tctx)
+{
+   NTSTATUS status;
+   bool ret = false;
+   struct smbcli_options options;
+   const char *host = torture_setting_string(tctx, "host", NULL);
+   const char *share = torture_setting_string(tctx, "share", NULL);
+   struct cli_credentials *credentials = popt_get_cmdline_credentials();
+   struct smb2_tree *tree = NULL;
+   enum credentials_use_kerberos use_kerberos;
+   char fname[256];
+   struct smb2_handle _h1;
+   struct smb2_handle *h1 = NULL;
+   struct smb2_create io1;
+   union smb_fileinfo qfinfo;
+   bool connected;
+
+   use_kerberos = cli_credentials_get_kerberos_state(credentials);
+   if (use_kerberos != CRED_MUST_USE_KERBEROS) {
+   torture_warning(tctx, "smb2.session.expire1 requires -k yes!");
+   torture_skip(tctx, "smb2.session.expire1 requires -k yes!");
+   }
+
+   cli_credentials_invalidate_ccache(credentials, CRED_SPECIFIED);
+
+   lpcfg_set_option(tctx->lp_ctx, "gensec_gssapi:requested_life_time=4");
+   lpcfg_smbcli_options(tctx->lp_ctx, );
+   options.signing = SMB_SIGNING_REQUIRED;
+
+   status = smb2_connect(tctx,
+ host,
+ lpcfg_smb_ports(tctx->lp_ctx),
+ share,
+ lpcfg_resolve_context(tctx->lp_ctx),
+ credentials,
+ ,
+   

[SCM] Socket Wrapper Repository - branch master updated

2018-11-13 Thread Andreas Schneider
The branch, master has been updated
   via  ce38138 swrap: Fix comparison of different signedness
  from  ac18c80 Bump version to 1.2.0

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


- Log -
commit ce38138a9ac1b9e36b3338ee9ebcdc5686d541a4
Author: Andreas Schneider 
Date:   Tue Nov 13 14:28:17 2018 +0100

swrap: Fix comparison of different signedness

Found by csbuild.

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

---

Summary of changes:
 src/socket_wrapper.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)


Changeset truncated at 500 lines:

diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index 2b77ceb..ae3b2b0 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -1539,7 +1539,7 @@ static int find_socket_info_index(int fd)
return -1;
}
 
-   if (fd >= socket_fds_max) {
+   if ((size_t)fd >= socket_fds_max) {
SWRAP_LOG(SWRAP_LOG_ERROR,
  "The max socket index limit of %zu has been reached, "
  "trying to add %d",
@@ -1590,7 +1590,7 @@ static int swrap_create_socket(struct socket_info *si, 
int fd)
 {
int idx;
 
-   if (fd >= socket_fds_max) {
+   if ((size_t)fd >= socket_fds_max) {
SWRAP_LOG(SWRAP_LOG_ERROR,
  "The max socket index limit of %zu has been reached, "
  "trying to add %d",


-- 
Socket Wrapper Repository



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

2018-11-13 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:

   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-13-1426/flakey.log

The failure seems to be in the "samba" suite, whose build logs are available 
here:

   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-13-1426/samba.stderr
   
https://git.samba.org/autobuild.flakey.sn-devel-144/2018-11-13-1426/samba.stdout
  
The top commit at the time of the failure was:

commit 9f5768106fd43935bc2725ec1b2ecce5c69f1a34
Author: Martin Schwenke 
Date:   Tue Nov 13 10:05:21 2018 +1100

replace: Add check for variable program_invocation_short_name

It appears that wafsamba's configure() defines _GNU_SOURCE
unconditionally, so checking _GNU_SOURCE isn't enough to know if this
variable is available.

For example, it isn't available on AIX with the xlc compiler:

  [ 6/10] Compiling lib/replace/replace.c
  ...
  "../../lib/replace/replace.c", line 991.16: 1506-045 (S) Undeclared 
identifier program_invocation_short_name.

Instead, add a configure check for program_invocation_short_name and
use it.

Signed-off-by: Martin Schwenke 
Reviewed-by: Andreas Schneider 

Autobuild-User(master): Andreas Schneider 
Autobuild-Date(master): Tue Nov 13 11:11:11 CET 2018 on sn-devel-144

and the last 50 lines of the stdout log were:

[792(4836)/851 at 1h24m5s] samba4.rpc.echo.testdenied(rodc:local)
[793(4846)/851 at 1h24m8s] samba4.blackbox.smbclient(rodc:local)(rodc:local)
[794(4848)/851 at 1h24m9s] samba.tests.samba_tool.rodc(rodc:local)
[795(4857)/851 at 1h24m38s] samba.blackbox.rpcclient_samlogon(rodc:local)
[796(4861)/851 at 1h24m39s] 
samba.blackbox.rpcclient_samlogon_testallowed(rodc:local)
[797(4865)/851 at 1h24m39s] 
samba.blackbox.rpcclient_samlogon_testdenied(rodc:local)
[798(4869)/851 at 1h24m40s] 
samba4.drs.ridalloc_exop.python(vampire_dc)(vampire_dc)
[799(4880)/851 at 1h30m8s] 
samba4.drs.samba_tool_drs.python(vampire_dc)(vampire_dc:local)
[800(4894)/851 at 1h33m30s] 
samba4.drs.samba_tool_drs_showrepl.python(vampire_dc)(vampire_dc:local)
[801(4898)/851 at 1h33m38s] 
samba4.drs.replica_sync.python(vampire_dc)(vampire_dc:local)
[802(4914)/851 at 1h37m23s] 
samba4.drs.delete_object.python(vampire_dc)(vampire_dc)
[803(4916)/851 at 1h37m33s] samba4.drs.fsmo.python(vampire_dc)(vampire_dc)
[804(4921)/851 at 1h37m49s] samba4.drs.repl_move.python(vampire_dc)(vampire_dc)
[805(4942)/851 at 1h39m38s] samba4.drs.getnc_exop.python(vampire_dc)(vampire_dc)
[806(4954)/851 at 1h39m59s] 
samba4.drs.getnc_unpriv.python(vampire_dc)(vampire_dc)
[807(4958)/851 at 1h40m5s] 
samba4.drs.linked_attributes_drs.python(vampire_dc)(vampire_dc)
[808(4961)/851 at 1h40m7s] 
samba4.drs.link_conflicts.python(vampire_dc)(vampire_dc)
[809(4973)/851 at 1h49m2s] 
samba4.drs.samba_tool_drs.python(promoted_dc)(promoted_dc:local)
[810(4987)/851 at 1h52m25s] 
samba4.drs.samba_tool_drs_showrepl.python(promoted_dc)(promoted_dc:local)
[811(4991)/851 at 1h52m39s] 
samba4.drs.replica_sync.python(promoted_dc)(promoted_dc:local)
[812(5007)/851 at 1h57m27s] 
samba4.drs.delete_object.python(promoted_dc)(promoted_dc)
[813(5009)/851 at 1h57m36s] samba4.drs.fsmo.python(promoted_dc)(promoted_dc)
[814(5014)/851 at 1h57m53s] 
samba4.drs.repl_move.python(promoted_dc)(promoted_dc)
[815(5035)/851 at 2h1m30s] 
samba4.drs.getnc_exop.python(promoted_dc)(promoted_dc)
UNEXPECTED(failure): 
samba4.drs.getnc_exop.python(promoted_dc).getnc_exop.DrsReplicaSyncTestCase.test_link_utdv_hwm(promoted_dc)
REASON: Exception: Exception: Traceback (most recent call last):
  File 
"/memdisk/autobuild/fl/b3985480/samba/source4/torture/drs/python/getnc_exop.py",
 line 267, in test_link_utdv_hwm
drsuapi.DRSUAPI_DRS_WRIT_REP)
  File 
"/memdisk/autobuild/fl/b3985480/samba/source4/torture/drs/python/drs_base.py", 
line 364, in _check_replication
dn_ordered=dn_ordered)
  File 
"/memdisk/autobuild/fl/b3985480/samba/source4/torture/drs/python/drs_base.py", 
line 387, in _check_ctr6
self.assertEqual(ctr6.object_count, len(expected_dns))
AssertionError: 4 != 3

FAILED (1 failures, 0 errors and 0 unexpected successes in 0 testsuites)

A summary with detailed information can be found in:
  ./bin/ab/summary
TOP 10 slowest tests
samba4.drs.link_conflicts.python(vampire_dc)(vampire_dc) -> 536
samba4.ldap.rodc_rwdc.python(rodc)(rodc:local) -> 441
samba4.drs.ridalloc_exop.python(vampire_dc)(vampire_dc) -> 329
samba4.ldap.confidential_attr.python(ad_dc_ntvfs)(ad_dc_ntvfs) -> 313
samba4.drs.replica_sync.python(promoted_dc)(promoted_dc:local) -> 287
samba4.rpc.samr.passwords.lockout on ncacn_np with (ad_dc_ntvfs) -> 226
samba4.drs.replica_sync.python(vampire_dc)(vampire_dc:local) -> 225
samba4.ldap.vlv.python(ad_dc_ntvfs)(ad_dc_ntvfs) -> 222
samba4.drs.repl_move.python(promoted_dc)(promoted_dc) -> 217

[SCM] Samba Shared Repository - branch master updated

2018-11-13 Thread Ralph Böhme
The branch, master has been updated
   via  bb93e691ca9 s3:smb2_sesssetup: check session_info security level 
before it gets talloc_move'd
   via  181f18c4bf7 s4:torture/smb2/session: session reauth response must 
be signed
   via  5fdea4095ac s4:torture/smb2/session: add force_signing to 
test_session_expire1i
   via  ffc424ee6be s4:torture/smb2/session: require a signed session setup 
reauth response
   via  368e1860654 s4:torture/smb2/session: invalidate credential cache
   via  53fe148476a libcli/smb: use require_signed_response in 
smb2cli_conn_dispatch_incoming()
   via  7abf3900218 libcli/smb: defer singing check a little bit
   via  67cfb016118 libcli/smb: maintain require_signed_response in 
smbXcli_req_state
   via  d407201d9bd libcli/smb: add 
smb2cli_session_require_signed_response()
   via  b86c94f0b92 s3:selftest: also run smb2.session torture testsuite 
against ad_member
   via  d0a8899ed57 s3:selftest: split "raw.session" and "smb2.session"
  from  9f5768106fd replace: Add check for variable 
program_invocation_short_name

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


- Log -
commit bb93e691ca9b1922bf552363a1e7d70792749d67
Author: Ralph Boehme 
Date:   Thu Nov 8 17:31:41 2018 +0100

s3:smb2_sesssetup: check session_info security level before it gets 
talloc_move'd

We talloc_move() session_info to session->global->auth_session_info
which sets session_info to NULL.

This means security_session_user_level(NULL, NULL) will always return
SECURITY_ANONYMOUS so we never sign the session setup response.

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

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

Autobuild-User(master): Ralph Böhme 
Autobuild-Date(master): Tue Nov 13 14:22:46 CET 2018 on sn-devel-144

commit 181f18c4bf70754a6f3132375d06250baab2871b
Author: Ralph Boehme 
Date:   Fri Nov 9 12:39:41 2018 +0100

s4:torture/smb2/session: session reauth response must be signed

This test checks that a session setup reauth is signed even when neither
client nor server require signing.

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

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

commit 5fdea4095ac82536192c8d91c411b22e2683a5c1
Author: Ralph Boehme 
Date:   Fri Nov 9 12:19:16 2018 +0100

s4:torture/smb2/session: add force_signing to test_session_expire1i

Existing callers pass true, so no change in behaviour. The next commit
adds an additional test that passes force_signing=false.

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

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

commit ffc424ee6bedc3c208acb4c0c83da836a12d6123
Author: Ralph Boehme 
Date:   Fri Nov 9 15:34:24 2018 +0100

s4:torture/smb2/session: require a signed session setup reauth response

All existing tests using this function require signing, so currently
this passes. A subsequent commit adds a test where neither client nor
server require signing and that's where this trap will explode.

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

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

commit 368e1860654e737aa2fa9516cdd3668fa644009a
Author: Ralph Boehme 
Date:   Thu Nov 8 15:42:46 2018 +0100

s4:torture/smb2/session: invalidate credential cache

Invalidate credential cache before connecting to the server, otherwise
we will reuse the credentials from the credential cache populated by the
preceeding tests.

Also invalidate it at the end, otherwise subsequent tests might run into
problems if the credentials expire while authenticating.

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

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

commit 53fe148476a5566b7a8204d7e44b6e75ce7d45bc
Author: Ralph Boehme 
Date:   Sat Nov 10 22:00:04 2018 +0100

libcli/smb: use require_signed_response in smb2cli_conn_dispatch_incoming()

This can be used by the upper layers to force checking a response is
signed. It will be used to implement verification of session setup
reauth responses in a torture test. That comes next.

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

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

commit 7abf3900218e3d27c075b405735b2c38ec0fc4ca
Author: Ralph Boehme 
Date:   Sat Nov 10 21:56:28 2018 +0100

libcli/smb: defer singing check a little bit

This allows adding an additional condition to the if check where the
condition state may be modified in the "if (opcode ==
SMB2_OP_SESSSETUP)" case directly above.

No change in behaviour.

Bug: 

[SCM] Socket Wrapper Repository - annotated tag socket_wrapper-1.2.0 created

2018-11-13 Thread Andreas Schneider
The annotated tag, socket_wrapper-1.2.0 has been created
at  236e36b49e846406007ceacaf3dc130604a0775b (tag)
   tagging  ac18c80e2096f0edc542273325fb2571d35cb796 (commit)
  replaces  socket_wrapper-1.1.9
 tagged by  Andreas Schneider
on  Tue Nov 13 13:57:58 2018 +0100

- Log -
socket_wrapper-1.2.0

* Added threading support
* Moved to modern cmake
* Several smaller bugfixes
-BEGIN PGP SIGNATURE-

iQIzBAABCAAdFiEEjf9T4Y8qvI2PPJIjfuD8TcwBTj0FAlvqymMACgkQfuD8TcwB
Tj1NqRAAso0F8NBMehddx8yGDp47jvQJda+Q9SeR3WuruTjVa38epnrcgRRmbgCC
y5OMXRbE59FO24H7Kjo1NZaWrQQAo1hnnPILss0OqmNTQHmC/HHVusz8In62SSkH
cUGTbOhpWimNhq7kYizO+34q3o+/3IjjhsHXB/lwGujqHyoR1okrL/HcjLTegBso
K/H8Lc0l5IhcRF0GWxNuOwLBljWCEFCxydMrTqlGLVeiODX+mac7otzppFFzSX5T
YlNBzDBhoN+gWC4UCokioGEuh0ZyEcJMl+TzbrAxlFjolxAj6kyEgYbwxSEmy0R1
NgCK0yUz4gBnGO4icr8z8FMT/bDKJvCZqAv1s/3N1U4azAhuunpTcbUM8j/CYrES
p225sbRE5L/LoGPgzYXCEGA17UJri0rV2OeOL+snZh1o+L+uS58tYW/BxkUkPT7J
lBDaLdkZZdfsZSETD/f1U0lNJjk3dkNxl8he9IhFnDjUxanZkcOy2HI2ujdrqBjE
P3ihHyJLyRLF/zbCRZlCdQ6BmQt8EanXMgHmTQih6K2vSS2TzqXZc2IiUGXshzt3
vqxhSbMJHHcLUetEwPxTrDW1Kozfze0Umc5lUjtCfAiQOgN8cWHjKTQUq+7BvGLk
/sJSjPEXRflvoCqHCn5CqNVmCoCTN/HJ2OkkKalZ2vHTchRkayI=
=7Klo
-END PGP SIGNATURE-

Andreas Schneider (64):
  swrap: Avoid double semicolons in the code
  cmake: Fix checks for attributes
  cmake: Fix configure check for fall-through attribute
  tests: Increase wait time for setup and teardown to 5ms
  cmake: Run threaded tests with helgrind
  tests: Fix resouce leak in echo_srv tcp handling
  cpack: Do not package build dirs in source tarball
  Rename COPYING to LICENSE
  Update LICENSE
  swrap: Update header
  tests: Add missing header for IPPROTO_TCP
  ctest: Move to new dashboard
  cmake: Require at least cmake 3.2.0
  tests: Update valgrind suppression file
  cmake: Don't misuse CMAKE_REQUIRED_LIBRARIES
  cmake: Write helgrind logs to stderr so we can see them
  cmake: Create an error if helgrind finds a bug
  cmake: Suppress helgrind race condition warning we created on purpose
  cmake: Update CMake defaults
  cmake: Improve checks for compiler flags
  cmake: Remove obsolete DefineCompilerFlags.cmake
  cmake: Move Compiler flags to new file
  cmake: Add CFLAGS for AddressSanitizer and UndefinedSanitizer
  cmake: Support running the tests with AddressSanitizer
  cmake: Update cmocka requirement
  cmake: Update AddCMockaTest
  cmake: Require modern cmake version
  cmake: Use target_include_directories()
  cmake: Fix checking for required system libraries
  tests: Use assert_return_code() to get errno
  swrap: Add a mutex for resetting socket index
  swrap: Don't do a deep bind if we run with libasan
  echo_srv: Do not close bogus file descriptors
  torture: Wait longer for echo_srv startup
  echo_srv: Only use 128K as buffer size instead of 4MB
  echo_srv: Check for a valid pidfile pointer
  tests: Check return code of connnect in test_echo_tcp_sendmsg_recvmsg
  tests: Check the return code of connect in test_echo_udp_sendmsg_recvmsg
  tests: Check return code of connect in 
test_thread_echo_tcp_sendmsg_recvmsg
  tests: Check the correct return code in test_thread_echo_tcp_write_read
  tests: Return an error if setenv() fails in test_max_sockets
  tests: Init in_addr only once in test_tcp_socket_overwrite
  gitlab-ci: Add runners and toolchain files
  gitlab-ci: Add helgrind tests
  gitlab-ci: Disable the FreeBSD runner
  cmake: Don't use string PREPEND
  swrap: Protect IPv6 case in swrap_socket()
  tests: Protect IPv6 case in echo_srv
  tests: Protect IPv6 function in setup_echo_srv_tcp_ipv6
  cmake: Create a list with required libraries
  tests: Disable failing tests as on FreeBSD
  gitlab-ci: Enable freebsd runner
  cmake: Disable stack protector on Solaris
  cmake: Only set default flags if they have been detected
  cmake: Set LINK_FLAGS for socket_wrapper
  cmake: Set LINK_FLAGS for echo_srv
  cmake: SWRAP_REQUIRED_LIBRARIES should be a list
  tests: Protect IPv6 in st_echo_tcp_get_peer_sock_name
  gitlab-ci: Add csbuild
  swrap: Rename global variable for max sockets
  swrap: Always allocate the socket fd array to the maximum
  swrap: Better handling for default values in socket_wrapper_max_sockets()
  swrap: Also log the process name
  Bump version to 1.2.0

Anoop C S (25):
  tests: Remove extra test by moving getsockname() to another
  swrap: Use helper function swrap_get_socket_info
  swrap: Use helper functions to manage refcount
  swrap: Add new routines to handle socket creation
  swrap: Use swrap_create_socket within swrap_socket
  swrap: Use swrap_create_socket within swrap_accept
  swrap: Remove swrap_first_free_index
  

[SCM] Socket Wrapper Repository - branch master updated

2018-11-13 Thread Andreas Schneider
The branch, master has been updated
   via  ac18c80 Bump version to 1.2.0
   via  aff61a7 swrap: Also log the process name
   via  d26ceb5 swrap: Better handling for default values in 
socket_wrapper_max_sockets()
   via  74c3a9a swrap: Always allocate the socket fd array to the maximum
   via  87cc3f8 swrap: Rename global variable for max sockets
  from  d788cef tests: Enable threaded test cases on FreeBSD

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


- Log -
commit ac18c80e2096f0edc542273325fb2571d35cb796
Author: Andreas Schneider 
Date:   Mon Nov 12 11:14:20 2018 +0100

Bump version to 1.2.0

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

commit aff61a781700ce8c1e6f9d0cd74b4c484be354fa
Author: Andreas Schneider 
Date:   Mon Nov 12 15:22:35 2018 +0100

swrap: Also log the process name

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

commit d26ceb542342d6eef4a8df14f79ca2f81d1e550e
Author: Andreas Schneider 
Date:   Tue Nov 13 08:31:43 2018 +0100

swrap: Better handling for default values in socket_wrapper_max_sockets()

Pair-Programmed-With: Anoop C S 
Signed-off-by: Andreas Schneider 
Signed-off-by: Anoop C S 
Reviewed-by: Ralph Boehme 

commit 74c3a9a60e5cfb8d191876c24e88e5d3aa38ca58
Author: Andreas Schneider 
Date:   Mon Nov 12 17:34:08 2018 +0100

swrap: Always allocate the socket fd array to the maximum

This will allow that we can deal with duplicates if the default value is
used.

Pair-Programmed-With: Anoop C S 
Signed-off-by: Andreas Schneider 
Signed-off-by: Anoop C S 
Reviewed-by: Ralph Boehme 

commit 87cc3f8e5433471e986c3b50e351ae49289b4cbe
Author: Andreas Schneider 
Date:   Mon Nov 12 17:00:09 2018 +0100

swrap: Rename global variable for max sockets

We also need a mutex to protect access to it.

Pair-Programmed-With: Anoop C S 
Signed-off-by: Andreas Schneider 
Signed-off-by: Anoop C S 
Reviewed-by: Ralph Boehme 

---

Summary of changes:
 CMakeLists.txt|  4 +--
 ChangeLog |  5 +++
 ConfigureChecks.cmake |  9 ++
 config.h.cmake|  6 
 src/socket_wrapper.c  | 85 ++-
 5 files changed, 85 insertions(+), 24 deletions(-)


Changeset truncated at 500 lines:

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35527f1..2f51bea 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,7 @@ list(APPEND CMAKE_MODULE_PATH 
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules")
 include(DefineCMakeDefaults)
 include(DefineCompilerFlags)
 
-project(socket_wrapper VERSION 1.1.9 LANGUAGES C)
+project(socket_wrapper VERSION 1.2.0 LANGUAGES C)
 
 # global needed variables
 set(APPLICATION_NAME ${PROJECT_NAME})
@@ -23,7 +23,7 @@ set(APPLICATION_NAME ${PROJECT_NAME})
 # Increment AGE. Set REVISION to 0
 #   If the source code was changed, but there were no interface changes:
 # Increment REVISION.
-set(LIBRARY_VERSION "0.1.9")
+set(LIBRARY_VERSION "0.1.10")
 set(LIBRARY_SOVERSION "0")
 
 # add definitions
diff --git a/ChangeLog b/ChangeLog
index 50911b6..639044d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 ChangeLog
 ==
 
+version 1.2.0 (released 2018-11-13)
+  * Added threading support
+  * Moved to modern cmake
+  * Several smaller bugfixes
+
 version 1.1.9 (released 2017-12-04)
   * Fixed thread - signal deadlock issue
 
diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake
index 94fed22..6cedb90 100644
--- a/ConfigureChecks.cmake
+++ b/ConfigureChecks.cmake
@@ -54,6 +54,13 @@ check_include_file(sys/timerfd.h HAVE_SYS_TIMERFD_H)
 check_include_file(gnu/lib-names.h HAVE_GNU_LIB_NAMES_H)
 check_include_file(rpc/rpc.h HAVE_RPC_RPC_H)
 
+# SYMBOLS
+set(CMAKE_REQUIRED_FLAGS -D_GNU_SOURCE)
+check_symbol_exists(program_invocation_short_name
+"errno.h"
+HAVE_PROGRAM_INVOCATION_SHORT_NAME)
+unset(CMAKE_REQUIRED_FLAGS)
+
 # FUNCTIONS
 check_function_exists(strncpy HAVE_STRNCPY)
 check_function_exists(vsnprintf HAVE_VSNPRINTF)
@@ -65,6 +72,8 @@ check_function_exists(bindresvport HAVE_BINDRESVPORT)
 check_function_exists(accept4 HAVE_ACCEPT4)
 check_function_exists(open64 HAVE_OPEN64)
 check_function_exists(fopen64 HAVE_FOPEN64)
+check_function_exists(getprogname HAVE_GETPROGNAME)
+check_function_exists(getexecname HAVE_GETEXECNAME)
 
 check_function_exists(pledge HAVE_PLEDGE)
 
diff --git a/config.h.cmake b/config.h.cmake
index 5baa789..0207031 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -31,6 +31,10 @@
 #cmakedefine HAVE_STRUCT_SOCKADDR_SA_LEN 1
 #cmakedefine HAVE_STRUCT_MSGHDR_MSG_CONTROL 1
 
+/ SYMBOLS /
+
+#cmakedefine HAVE_PROGRAM_INVOCATION_SHORT_NAME 1
+
 

[SCM] Samba Shared Repository - branch master updated

2018-11-13 Thread Andreas Schneider
The branch, master has been updated
   via  9f5768106fd replace: Add check for variable 
program_invocation_short_name
   via  63a9fe1d445 nsswitch: Handle possible NULL return value of 
getprogname()
   via  7a9d003d01a lib:replace: Do not leak the file pointer in 
rep_getprogname()
  from  716715496c4 smbd: Use wire_perms_to_unix in unix_perms_from_wire

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


- Log -
commit 9f5768106fd43935bc2725ec1b2ecce5c69f1a34
Author: Martin Schwenke 
Date:   Tue Nov 13 10:05:21 2018 +1100

replace: Add check for variable program_invocation_short_name

It appears that wafsamba's configure() defines _GNU_SOURCE
unconditionally, so checking _GNU_SOURCE isn't enough to know if this
variable is available.

For example, it isn't available on AIX with the xlc compiler:

  [ 6/10] Compiling lib/replace/replace.c
  ...
  "../../lib/replace/replace.c", line 991.16: 1506-045 (S) Undeclared 
identifier program_invocation_short_name.

Instead, add a configure check for program_invocation_short_name and
use it.

Signed-off-by: Martin Schwenke 
Reviewed-by: Andreas Schneider 

Autobuild-User(master): Andreas Schneider 
Autobuild-Date(master): Tue Nov 13 11:11:11 CET 2018 on sn-devel-144

commit 63a9fe1d445f04eb83a7d0f9d27355c2baf9c5bf
Author: Andreas Schneider 
Date:   Mon Nov 12 15:47:46 2018 +0100

nsswitch: Handle possible NULL return value of getprogname()

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

commit 7a9d003d01adebaf089ca975b04b9d8d4e7640a2
Author: Andreas Schneider 
Date:   Mon Nov 12 15:31:09 2018 +0100

lib:replace: Do not leak the file pointer in rep_getprogname()

And return NULL on error.

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

---

Summary of changes:
 lib/replace/replace.c | 27 +--
 lib/replace/wscript   |  1 +
 nsswitch/wb_common.c  |  9 +++--
 3 files changed, 25 insertions(+), 12 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/replace/replace.c b/lib/replace/replace.c
index e38df98ea3a..a14322b8e57 100644
--- a/lib/replace/replace.c
+++ b/lib/replace/replace.c
@@ -980,22 +980,23 @@ int rep_memset_s(void *dest, size_t destsz, int ch, 
size_t count)
 #endif /* HAVE_MEMSET_S */
 
 #ifndef HAVE_GETPROGNAME
-# ifndef _GNU_SOURCE
+# ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME
 # define PROGNAME_SIZE 32
 static char rep_progname[PROGNAME_SIZE];
-# endif /* _GNU_SOURCE */
+# endif /* HAVE_PROGRAM_INVOCATION_SHORT_NAME */
 
 const char *rep_getprogname(void)
 {
-#ifdef _GNU_SOURCE
+#ifdef HAVE_PROGRAM_INVOCATION_SHORT_NAME
return program_invocation_short_name;
-#else /* _GNU_SOURCE */
+#else /* HAVE_PROGRAM_INVOCATION_SHORT_NAME */
FILE *fp = NULL;
char cmdline[4096] = {0};
char *p = NULL;
pid_t pid;
size_t nread;
int len;
+   int rc;
 
if (rep_progname[0] != '\0') {
return rep_progname;
@@ -1003,12 +1004,12 @@ const char *rep_getprogname(void)
 
len = snprintf(rep_progname, sizeof(rep_progname), "%s", "");
if (len <= 0) {
-   return "";
+   return NULL;
}
 
pid = getpid();
if (pid <= 1 || pid == (pid_t)-1) {
-   return rep_progname;
+   return NULL;
}
 
len = snprintf(cmdline,
@@ -1016,17 +1017,23 @@ const char *rep_getprogname(void)
   "/proc/%u/cmdline",
   (unsigned int)pid);
if (len <= 0 || len == sizeof(cmdline)) {
-   return rep_progname;
+   return NULL;
}
 
fp = fopen(cmdline, "r");
if (fp == NULL) {
-   return rep_progname;
+   return NULL;
}
 
nread = fread(cmdline, 1, sizeof(cmdline) - 1, fp);
+
+   rc = fclose(fp);
+   if (rc != 0) {
+   return NULL;
+   }
+
if (nread == 0) {
-   return rep_progname;
+   return NULL;
}
 
cmdline[nread] = '\0';
@@ -1046,6 +1053,6 @@ const char *rep_getprogname(void)
(void)snprintf(rep_progname, sizeof(rep_progname), "%s", p);
 
return rep_progname;
-#endif /* _GNU_SOURCE */
+#endif /* HAVE_PROGRAM_INVOCATION_SHORT_NAME */
 }
 #endif /* HAVE_GETPROGNAME */
diff --git a/lib/replace/wscript b/lib/replace/wscript
index c8693a3f2e1..ff918146ffa 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -607,6 +607,7 @@ def configure(conf):
 
 conf.CHECK_VARIABLE('rl_event_hook', define='HAVE_DECL_RL_EVENT_HOOK', 
always=True,
 headers='readline.h readline/readline.h 
readline/history.h')
+conf.CHECK_VARIABLE('program_invocation_short_name',