[SCM] Samba Shared Repository - branch master updated

2019-05-07 Thread Gary Lockyer
The branch, master has been updated
   via  93061fb822d CID 1363286: Resource leak by failing to free tmp_ctx
   via  a4973270423 CID 1363287: Resource leak using str_list_append
  from  bead4fdb88c wafsamba: Enable warnings about zero-length formats

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


- Log -
commit 93061fb822d5af5c29f223e9fe1ce91b7264f082
Author: Garming Sam 
Date:   Tue May 7 13:28:49 2019 +1200

CID 1363286: Resource leak by failing to free tmp_ctx

There are a few oddities in this function, including a duplicated NULL
check, a talloc_free of a context which is passed in and a number of
missing frees before a return.

Signed-off-by: Garming Sam 
Reviewed-by: Gary Lockyer 

Autobuild-User(master): Gary Lockyer 
Autobuild-Date(master): Wed May  8 00:36:14 UTC 2019 on sn-devel-184

commit a4973270423203d9881cdbf2d24fadd02c3228c0
Author: Garming Sam 
Date:   Thu May 2 17:11:57 2019 +1200

CID 1363287: Resource leak using str_list_append

Signed-off-by: Garming Sam 
Reviewed-by: Gary Lockyer 

---

Summary of changes:
 source4/auth/session.c  | 27 ++-
 source4/dsdb/samdb/ldb_modules/samba_dsdb.c |  4 
 2 files changed, 22 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source4/auth/session.c b/source4/auth/session.c
index 3a8c40b7fb8..71d236aa3e1 100644
--- a/source4/auth/session.c
+++ b/source4/auth/session.c
@@ -115,10 +115,6 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX 
*mem_ctx,
TALLOC_FREE(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
-   if (!sids) {
-   talloc_free(tmp_ctx);
-   return NT_STATUS_NO_MEMORY;
-   }
 
num_sids = user_info_dc->num_sids;
 
@@ -134,14 +130,19 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX 
*mem_ctx,
 
if (session_info_flags & AUTH_SESSION_INFO_DEFAULT_GROUPS) {
sids = talloc_realloc(tmp_ctx, sids, struct dom_sid, num_sids + 
2);
-   NT_STATUS_HAVE_NO_MEMORY(sids);
+   if (sids == NULL) {
+   TALLOC_FREE(tmp_ctx);
+   return NT_STATUS_NO_MEMORY;
+   }
 
if (!dom_sid_parse(SID_WORLD, [num_sids])) {
+   TALLOC_FREE(tmp_ctx);
return NT_STATUS_INTERNAL_ERROR;
}
num_sids++;
 
if (!dom_sid_parse(SID_NT_NETWORK, [num_sids])) {
+   TALLOC_FREE(tmp_ctx);
return NT_STATUS_INTERNAL_ERROR;
}
num_sids++;
@@ -149,9 +150,13 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX 
*mem_ctx,
 
if (session_info_flags & AUTH_SESSION_INFO_AUTHENTICATED) {
sids = talloc_realloc(tmp_ctx, sids, struct dom_sid, num_sids + 
1);
-   NT_STATUS_HAVE_NO_MEMORY(sids);
+   if (sids == NULL) {
+   TALLOC_FREE(tmp_ctx);
+   return NT_STATUS_NO_MEMORY;
+   }
 
if (!dom_sid_parse(SID_NT_AUTHENTICATED_USERS, 
[num_sids])) {
+   TALLOC_FREE(tmp_ctx);
return NT_STATUS_INTERNAL_ERROR;
}
num_sids++;
@@ -159,9 +164,13 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX 
*mem_ctx,
 
if (session_info_flags & AUTH_SESSION_INFO_NTLM) {
sids = talloc_realloc(tmp_ctx, sids, struct dom_sid, num_sids + 
1);
-   NT_STATUS_HAVE_NO_MEMORY(sids);
+   if (sids == NULL) {
+   TALLOC_FREE(tmp_ctx);
+   return NT_STATUS_NO_MEMORY;
+   }
 
if (!dom_sid_parse(SID_NT_NTLM_AUTHENTICATION, 
[num_sids])) {
+   TALLOC_FREE(tmp_ctx);
return NT_STATUS_INTERNAL_ERROR;
}
num_sids++;
@@ -187,11 +196,11 @@ _PUBLIC_ NTSTATUS auth_generate_session_info(TALLOC_CTX 
*mem_ctx,
"",
dom_sid_str_buf([i], ));
if (sid_dn == NULL) {
-   TALLOC_FREE(user_info_dc);
+   TALLOC_FREE(tmp_ctx);
return NT_STATUS_NO_MEMORY;
}
sid_blob = data_blob_string_const(sid_dn);
-   
+
/* This function takes in memberOf values and expands
 * them, as long as they meet the filter - so only
 * builtin groups
diff --git a/source4/dsdb/samdb/ldb_modules/samba_dsdb.c 

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

2019-05-07 Thread autobuild
The autobuild test system (on sn-devel-184) 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-184/2019-05-07-2209/flakey.log

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

   
https://git.samba.org/autobuild.flakey.sn-devel-184/2019-05-07-2209/samba-ad-dc-5.stderr
   
https://git.samba.org/autobuild.flakey.sn-devel-184/2019-05-07-2209/samba-ad-dc-5.stdout
  
The top commit at the time of the failure was:

commit bead4fdb88c9684a6c0ed066194cecb5d186026d
Author: Andreas Schneider 
Date:   Thu Feb 14 12:08:37 2019 +0100

wafsamba: Enable warnings about zero-length formats

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

Autobuild-User(master): Andreas Schneider 
Autobuild-Date(master): Tue May  7 18:45:06 UTC 2019 on sn-devel-184

and the last 50 lines of the stdout log were:

[63(261)/322 at 19m19s] samba4.rpc.dssetup on ncalrpc with 
validate(ad_dc_default:local)
[64(262)/322 at 19m20s] samba4.rpc.altercontext on ncalrpc with 
validate(ad_dc_default:local)
smbtorture 4.11.0pre1-DEVELOPERBUILD
WARNING: The "lsa over netlogon" option is deprecated
WARNING: The "server schannel" option is deprecated
Using seed 1557266919
opening LSA connection
Testing change of primary context

Testing OpenPolicy2
Testing change of primary context
Opening secondary DSSETUP context
Testing change of primary context
Opening bad secondary connection
Testing DSSETUP pipe operations
dcerpc_dssetup_DsRoleGetPrimaryDomainInformation level 1
dcerpc_dssetup_DsRoleGetPrimaryDomainInformation level 2
dcerpc_dssetup_DsRoleGetPrimaryDomainInformation level 3

Testing Close

Testing change of primary context

Testing OpenPolicy2

Testing Close

Testing change of primary context

Testing OpenPolicy2
UNEXPECTED(failure): samba4.rpc.altercontext on ncalrpc with 
validate.altercontext(ad_dc_default:local)
REASON: Exception: Exception: ../../source4/torture/rpc/lsa.c:188: status was 
NT_STATUS_CONNECTION_RESET, expected NT_STATUS_CONNECTION_DISCONNECTED: 
OpenPolicy2 failed

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.ldb.ldap with options '-U"$USERNAME%$PASSWORD"  
--option=clientldapsaslwrapping=plain'(ad_dc_default)(ad_dc_default) -> 84
samba4.ldb.ldap with options '-U"$USERNAME%$PASSWORD" -k yes 
--option=clientldapsaslwrapping=plain'(ad_dc_default)(ad_dc_default) -> 81
samba4.rpc.schannel on ncacn_ip_tcp with seal,padcheck(ad_dc_default) -> 72
samba4.rpc.schannel on ncacn_np with seal,padcheck(ad_dc_default) -> 70
samba4.rpc.schannel on ncalrpc with seal,padcheck(ad_dc_default:local) -> 62
samba4.ldb.ldap with options '-U"$USERNAME%$PASSWORD" -k yes 
--encrypt'(ad_dc_default)(ad_dc_default) -> 59
samba4.rpc.schannel on ncalrpc with validate(ad_dc_default:local) -> 59
samba4.ldb.ldap with options '-U"$USERNAME%$PASSWORD"  
--sign'(ad_dc_default)(ad_dc_default) -> 56
samba4.ldb.ldap with options '-U"$USERNAME%$PASSWORD" -k yes 
--sign'(ad_dc_default)(ad_dc_default) -> 55
samba4.ldb.ldap with options '-U"$USERNAME%$PASSWORD"  
--encrypt'(ad_dc_default)(ad_dc_default) -> 53
ERROR: test failed with exit code 1
Makefile:16: recipe for target 'test' failed



[SCM] Samba Shared Repository - branch master updated

2019-05-07 Thread Andreas Schneider
The branch, master has been updated
   via  bead4fdb88c wafsamba: Enable warnings about zero-length formats
   via  e6f84048279 wafsamba: Enable warnings about format overflows
   via  d16e9dfc81d ctdb: Fix format in db_hash_test
  from  5a9e338330f ctdb-tests: Don't clean up test var directory in 
autotest target

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


- Log -
commit bead4fdb88c9684a6c0ed066194cecb5d186026d
Author: Andreas Schneider 
Date:   Thu Feb 14 12:08:37 2019 +0100

wafsamba: Enable warnings about zero-length formats

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

Autobuild-User(master): Andreas Schneider 
Autobuild-Date(master): Tue May  7 18:45:06 UTC 2019 on sn-devel-184

commit e6f8404827958705a5d7fc92a43efed365dd0451
Author: Andreas Schneider 
Date:   Thu Feb 14 12:06:57 2019 +0100

wafsamba: Enable warnings about format overflows

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

commit d16e9dfc81d7d79c8d2bcffc66b6fe008e726974
Author: Andreas Schneider 
Date:   Mon Apr 29 13:26:04 2019 +0200

ctdb: Fix format in db_hash_test

error: ā€˜%04dā€™ directive writing between 4 and 11 bytes into a region of
size 5 [-Werror=format-overflow=]
   sprintf(key, "key%04d", i);

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

---

Summary of changes:
 buildtools/wafsamba/samba_autoconf.py | 2 ++
 ctdb/tests/src/db_hash_test.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)


Changeset truncated at 500 lines:

diff --git a/buildtools/wafsamba/samba_autoconf.py 
b/buildtools/wafsamba/samba_autoconf.py
index 06ec7da333a..0dbfd54393f 100644
--- a/buildtools/wafsamba/samba_autoconf.py
+++ b/buildtools/wafsamba/samba_autoconf.py
@@ -738,6 +738,8 @@ def SAMBA_CONFIG_H(conf, path=None):
   cflags='-Wmissing-field-initializers 
-Werror=missing-field-initializers',
   msg="Checking C99 init of nested structs."):
 conf.ADD_CFLAGS('-Wmissing-field-initializers', testflags=True)
+conf.ADD_CFLAGS('-Wformat-overflow=2', testflags=True)
+conf.ADD_CFLAGS('-Wformat-zero-length', testflags=True)
 conf.ADD_CFLAGS('-Wcast-align -Wcast-qual', testflags=True)
 conf.ADD_CFLAGS('-fno-common', testflags=True)
 
diff --git a/ctdb/tests/src/db_hash_test.c b/ctdb/tests/src/db_hash_test.c
index 1f93743e000..31aa5011653 100644
--- a/ctdb/tests/src/db_hash_test.c
+++ b/ctdb/tests/src/db_hash_test.c
@@ -99,7 +99,7 @@ static void do_traverse_test(enum db_hash_type type)
 {
struct db_hash_context *dh = NULL;
TALLOC_CTX *mem_ctx = talloc_new(NULL);
-   char key[] = "key";
+   char key[16] = "key";
char value[] = "This is some test value";
int count, ret, i;
 


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2019-05-07 Thread Amitay Isaacs
The branch, master has been updated
   via  5a9e338330f ctdb-tests: Don't clean up test var directory in 
autotest target
   via  a2ab6485e02 ctdb-tests: Fix usage message
   via  3cb53a7a054 ctdb-tests: Wait to allow database attach/detach to 
take effect
   via  066cc5b0c56 ctdb-tests: Avoid bulk output in $out, prefer $outfile
   via  9d02452a246 ctdb-tests: Make try_command_on_node less error-prone
   via  7c3819d1ac2 ctdb-tests: Change sanity_check_output() to internally 
use $out
   via  b80967f5dcc ctdb-scripts: Drop script configuration variable 
CTDB_MONITOR_SWAP_USAGE
   via  8108b3134c0 ctdb-tests: Extend test to cover ctdb rddumpmemory
   via  f78d9388fb4 ctdb-tools: Fix ctdb dumpmemory to avoid printing 
trailing NUL
   via  95477e69e3e ctdb-daemon: Log when ctdbd CPU utilisation exceeds a 
threshold
   via  87032ccebdd ctdb-build: Add check for getrusage()
  from  3d42e257a61 s4 dns_server Bind9: Log opertion durations

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


- Log -
commit 5a9e338330fe136908a3a17a5df81c054c5cc5b0
Author: Martin Schwenke 
Date:   Wed May 1 15:17:14 2019 +1000

ctdb-tests: Don't clean up test var directory in autotest target

If the directory is always cleaned up then it is not possible to look
at daemon logs to debug test failures.

This target is only really used by autobuild.py, which (optionally)
cleans up the parent directory anyway.

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

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

Autobuild-User(master): Amitay Isaacs 
Autobuild-Date(master): Tue May  7 06:56:01 UTC 2019 on sn-devel-184

commit a2ab6485e027ebb13871c7d83b7626ac5c9b98c0
Author: Martin Schwenke 
Date:   Wed May 1 15:10:28 2019 +1000

ctdb-tests: Fix usage message

Since commit 0e9ead8f28fced3ebfa888786a1dc5bb59e734a3 daemons have
been shut down after each test, so this option no longer has anything
to do with killing daemons.

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

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

commit 3cb53a7a05409925024d6a67bcfaeb962d896e0b
Author: Martin Schwenke 
Date:   Sat Apr 27 14:54:09 2019 +1000

ctdb-tests: Wait to allow database attach/detach to take effect

Sometimes the detach test fails:

  Check detaching single test database detach_test1.tdb
  BAD: database detach_test1.tdb is still attached
  Number of databases:4
  dbid:0x5ae995ee name:detach_test4.tdb 
path:tests/var/simple/node.0/db/volatile/detach_test4.tdb.0
  dbid:0xd84cc13c name:detach_test3.tdb 
path:tests/var/simple/node.0/db/volatile/detach_test3.tdb.0
  dbid:0x8e8e8cef name:detach_test2.tdb 
path:tests/var/simple/node.0/db/volatile/detach_test2.tdb.0
  dbid:0xc62491f4 name:detach_test1.tdb 
path:tests/var/simple/node.0/db/volatile/detach_test1.tdb.0
  Number of databases:3
  dbid:0x5ae995ee name:detach_test4.tdb 
path:tests/var/simple/node.1/db/volatile/detach_test4.tdb.1
  dbid:0xd84cc13c name:detach_test3.tdb 
path:tests/var/simple/node.1/db/volatile/detach_test3.tdb.1
  dbid:0x8e8e8cef name:detach_test2.tdb 
path:tests/var/simple/node.1/db/volatile/detach_test2.tdb.1
  Number of databases:4
  dbid:0x5ae995ee name:detach_test4.tdb 
path:tests/var/simple/node.2/db/volatile/detach_test4.tdb.2
  dbid:0xd84cc13c name:detach_test3.tdb 
path:tests/var/simple/node.2/db/volatile/detach_test3.tdb.2
  dbid:0x8e8e8cef name:detach_test2.tdb 
path:tests/var/simple/node.2/db/volatile/detach_test2.tdb.2
  dbid:0xc62491f4 name:detach_test1.tdb 
path:tests/var/simple/node.2/db/volatile/detach_test1.tdb.2
  *** TEST COMPLETED (RC=1) AT 2019-04-27 03:35:40, CLEANING UP...

When issued from a client, the detach control re-broadcasts itself
asynchronously to all nodes and then returns success.  The controls to
some nodes to do the actual detach may still be in flight when success
is returned to the client.  Therefore, the test should wait for a few
seconds to allow the asynchronous controls to complete.

The same is true for the attach control, so workaround the problem in
the attach test too.

An alternative is to make the attach and detach controls synchronous
by avoiding the broadcast and waiting for the results of the
individual controls sent to the nodes.  However, a simple
implementation would involve adding new nested event loops.

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

Signed-off-by: Martin Schwenke 
Reviewed-by: Amitay Isaacs 

commit 066cc5b0c561464ed08890d9aa1a1a55b545e9cc
Author: Martin Schwenke 
Date:   Thu Apr 11 20:55:20 2019 +1000

ctdb-tests: Avoid bulk output in $out, prefer $outfile

BUG: