[SCM] Samba Shared Repository - branch master updated

2019-02-12 Thread Andrew Bartlett
The branch, master has been updated
   via  30d505e91bb selftest: Only set clockskew to 5 seconds for MIT 
Kerberos
   via  c9fa0a05d90 wafsamba/samba_utils.py: override symlink to allow 
force link
   via  22c016b1214 selftest: Change backup/restore testenvs to use 1 
prefork child
   via  85a7b4bf704 selftest: Use default 'prefork children' smb.conf 
setting
   via  d21801b8887 ldb_dn: don't free a known NULL pointer
   via  d4ebe006885 ldb_dn: remove unreachable code in dn_explode
   via  cb502997b37 replmd: move a if (ret) closer to ret source
   via  c874b62556b dsdb: check NULL guid strings in la_fix_links
   via  a086a6457b4 dsdb: linked attrs: check a talloc_new()
   via  5b0a9818ffd dsdb: make get_parsed_dns_trusted() a common helper 
function
   via  d0e26ea67fb spelling of associated
  from  f8a85ed5693 s3:utils: Add missing NULL check in 
rpc_fetch_domain_aliases()

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


- Log -
commit 30d505e91bbf8e08d6f80314798e4e1a48ae43f9
Author: Andrew Bartlett 
Date:   Tue Feb 12 09:34:54 2019 +1300

selftest: Only set clockskew to 5 seconds for MIT Kerberos

This was added in ac5427c6eba09134411f76a5e6f7e2643fa74eed as part of the 
MIT KDC
effort, but makes some tests much less reliable under high load.

As the Heimdal build does not need this, only specify for the MIT build.

Tested with an MIT AD DC build with:
 make test TESTS="samba3.raw.session samba3.smb2.session"

Signed-off-by: Andrew Bartlett 
Reviewed-by: Gary Lockyer 

Autobuild-User(master): Andrew Bartlett 
Autobuild-Date(master): Wed Feb 13 05:49:43 CET 2019 on sn-devel-144

commit c9fa0a05d90f8c1d84c41efe32a6938c026dc328
Author: Joe Guo 
Date:   Tue Feb 12 19:16:06 2019 +1300

wafsamba/samba_utils.py: override symlink to allow force link

if bin is not empty and I have been sharing the samba tree into
a Vagrant environment and we run make, we get annoying linking error like 
this:

 File "~/samba/lib/tevent/wscript", line 130, in build
installdir='python')
  File "./buildtools/wafsamba/wafsamba.py", line 745, in SAMBA_SCRIPT
os.symlink(link_src, link_dst)
FileExistsError: [Errno 17] File exists: '~/samba/lib/tevent/tevent.py' 
-> '~/samba/bin/default/../python/tevent.py'
Makefile:7: recipe for target 'all' failed

Override the symlink method to allow force linking.

Signed-off-by: Joe Guo 
Reviewed-by: Gary Lockyer 
Reviewed-by: Andrew Bartlett 

commit 22c016b12142e675c5b8ef0ea1f450385f555268
Author: Tim Beale 
Date:   Tue Feb 5 12:23:43 2019 +1300

selftest: Change backup/restore testenvs to use 1 prefork child

Recently the gitlab CI jobs were hitting memory resource limits and
using swap, which then caused test failures. The process model used in
the testenvs seemed to be contributing to this problem.

We can reduce the memory overhead of the restore/backup testenvs by
using 1 prefork child process instead of the default of 4 (kudos to
Garming for the idea). The tests run against these testenvs are basic
sanity-checks, rather than heavy-duty stress tests, so the number of
prefork workers shouldn't matter.

This is a bit of a tradeoff between testing the defaults that will
actually be used in production vs using limited resources efficiently on
shared CI runner machines.

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

commit 85a7b4bf7040b0c95edc2f5a13252830c8c0d378
Author: Tim Beale 
Date:   Tue Feb 5 12:18:38 2019 +1300

selftest: Use default 'prefork children' smb.conf setting

The default setting should be 4, so there should be no need to specify
this in the testenv smb.conf.

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

commit d21801b88877629dfe04bf552d5dbffb2143400a
Author: Douglas Bagnall 
Date:   Fri Feb 8 15:49:56 2019 +1300

ldb_dn: don't free a known NULL pointer

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

commit d4ebe006885e100da6797e210f9331fabffec8d4
Author: Douglas Bagnall 
Date:   Thu Feb 7 13:39:09 2019 +1300

ldb_dn: remove unreachable code in dn_explode

Every time I look at this file, I spend a few minutes wondering how
these bits of code are ever run. Never again.

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

commit cb502997b377f3aea05635c4c658754f70b34fd6
Author: Douglas Bagnall 
Date:   Wed Jan 16 17:35:48 2019 +1300

replmd: move a if (ret) closer to ret source

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

commit c874b62556b711082b62451f937f6102abdc3761
Author: Douglas Bagnall 
Date:   Thu Jan 10 12:55:19 2019 +1300

dsdb: check NULL guid strings in 

[SCM] Samba Shared Repository - branch master updated

2019-02-12 Thread Jeremy Allison
The branch, master has been updated
   via  f8a85ed5693 s3:utils: Add missing NULL check in 
rpc_fetch_domain_aliases()
   via  77dbe6b9efd s3:locking: Add missing NULL check
  from  b1740f3bafc CI: split out "samba-ad-dc-ntvfs[-py2]" test targets

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


- Log -
commit f8a85ed5693d31b517fd8d3b15c7a4300cdb81c9
Author: Andreas Schneider 
Date:   Mon Feb 4 17:23:05 2019 +0100

s3:utils: Add missing NULL check in rpc_fetch_domain_aliases()

Signed-off-by: Andreas Schneider 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Wed Feb 13 00:52:25 CET 2019 on sn-devel-144

commit 77dbe6b9efd2b8051c4c1a7ad1233bee3ca61573
Author: Andreas Schneider 
Date:   Mon Feb 4 17:19:55 2019 +0100

s3:locking: Add missing NULL check

Signed-off-by: Andreas Schneider 
Reviewed-by: Jeremy Allison 

---

Summary of changes:
 source3/locking/locking.c | 3 +++
 source3/utils/net_rpc.c   | 4 
 2 files changed, 7 insertions(+)


Changeset truncated at 500 lines:

diff --git a/source3/locking/locking.c b/source3/locking/locking.c
index ae5f0bbcf33..d4c3b32be7f 100644
--- a/source3/locking/locking.c
+++ b/source3/locking/locking.c
@@ -150,6 +150,9 @@ bool strict_lock_check_default(files_struct *fsp, struct 
lock_struct *plock)
 * autocleanup. This is the slow path anyway.
 */
br_lck = brl_get_locks(talloc_tos(), fsp);
+   if (br_lck == NULL) {
+   return true;
+   }
ret = brl_locktest(br_lck, plock);
TALLOC_FREE(br_lck);
}
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index f2d63d2af65..a56190f7be5 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -4669,6 +4669,10 @@ static NTSTATUS rpc_fetch_domain_aliases(struct 
rpc_pipe_client *pipe_hnd,
 
if (alias.num_members > 0) {
alias.members = SMB_MALLOC_ARRAY(struct 
dom_sid, alias.num_members);
+   if (alias.members == NULL) {
+   status = NT_STATUS_NO_MEMORY;
+   goto done;
+   }
 
for (j = 0; j < alias.num_members; j++)
sid_copy([j],


-- 
Samba Shared Repository



[SCM] Socket Wrapper Repository - branch master updated

2019-02-12 Thread Andreas Schneider
The branch, master has been updated
   via  24e5973 swrap: Fix a TODO
   via  74e9e13 Remove thread-safety task from TODO
   via  dd2f1b0 cmake: Disable deep binding for helgrind
   via  e7c9380 swrap: Add env variable to disable deep binding
  from  cf436b6 swrap: Use #ifdef instead of #if for config.h definitions

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


- Log -
commit 24e597330ec6fbbdc149d798e70d6ed48729bd84
Author: Anoop C S 
Date:   Thu Dec 6 11:16:15 2018 +0530

swrap: Fix a TODO

Use realpath(3) instead of strncmp(3)

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

commit 74e9e13c38eeda6b31a0bf971e03d2d79eb81681
Author: Anoop C S 
Date:   Thu Dec 6 11:15:46 2018 +0530

Remove thread-safety task from TODO

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

commit dd2f1b001de4a8e70f7c6fa52734b2a82bd2b566
Author: Andreas Schneider 
Date:   Wed Nov 28 09:23:52 2018 +0100

cmake: Disable deep binding for helgrind

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

commit e7c9380faf0f0557c202119f960026f8700667ee
Author: Andreas Schneider 
Date:   Wed Nov 28 09:20:58 2018 +0100

swrap: Add env variable to disable deep binding

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

---

Summary of changes:
 TODO |  2 --
 doc/socket_wrapper.1 |  9 +++--
 doc/socket_wrapper.1.txt |  7 +++-
 src/socket_wrapper.c | 93 +++-
 tests/CMakeLists.txt |  2 +-
 5 files changed, 83 insertions(+), 30 deletions(-)


Changeset truncated at 500 lines:

diff --git a/TODO b/TODO
index 147c166..4a851e6 100644
--- a/TODO
+++ b/TODO
@@ -10,7 +10,6 @@ Library:
 -
 
 Goals:
-* Thread safety
 * The proposed way ==> - fd-passing for tcp sockets (for free)
   Approach:
   - tdb "in small". So a "db file".
@@ -30,4 +29,3 @@ Testing:
 * Add a test for sento() to broadcast 255.255.255.255.
 * Add a test to check that read/readv/send/ only work on connected sockets.
 * Add unit tests for conversion functions like convert_in_un_remote().
-* Add threaded tests.
diff --git a/doc/socket_wrapper.1 b/doc/socket_wrapper.1
index 7e10224..a064eed 100644
--- a/doc/socket_wrapper.1
+++ b/doc/socket_wrapper.1
@@ -2,12 +2,12 @@
 .\" Title: socket_wrapper
 .\"Author: Samba Team
 .\" Generator: DocBook XSL Stylesheets vsnapshot 
-.\"  Date: 2018-06-26
+.\"  Date: 2018-11-28
 .\"Manual: \ \&
 .\"Source: \ \&
 .\"  Language: English
 .\"
-.TH "SOCKET_WRAPPER" "1" "2018\-06\-26" "\ \&" "\ \&"
+.TH "SOCKET_WRAPPER" "1" "2018\-11\-28" "\ \&" "\ \&"
 .\" -
 .\" * Define some portability stuff
 .\" -
@@ -147,6 +147,11 @@ If you need to see what is going on in socket_wrapper 
itself or try to find a bu
 3 = TRACE
 .RE
 .RE
+.PP
+\fBSOCKET_WRAPPER_DISABLE_DEEPBIND\fR
+.RS 4
+This allows you to disable deep binding in socket_wrapper\&. This is useful 
for running valgrind tools or sanitizers like (address, undefined, thread)\&.
+.RE
 .SH "EXAMPLE"
 .sp
 .if n \{\
diff --git a/doc/socket_wrapper.1.txt b/doc/socket_wrapper.1.txt
index 583b50a..da16c6d 100644
--- a/doc/socket_wrapper.1.txt
+++ b/doc/socket_wrapper.1.txt
@@ -1,6 +1,6 @@
 socket_wrapper(1)
 =
-:revdate: 2018-06-26
+:revdate: 2018-11-28
 :author: Samba Team
 
 NAME
@@ -78,6 +78,11 @@ debug symbols.
 - 2 = DEBUG
 - 3 = TRACE
 
+*SOCKET_WRAPPER_DISABLE_DEEPBIND*::
+
+This allows you to disable deep binding in socket_wrapper. This is useful for
+running valgrind tools or sanitizers like (address, undefined, thread).
+
 EXAMPLE
 ---
 
diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c
index ca0a833..de5cc7a 100644
--- a/src/socket_wrapper.c
+++ b/src/socket_wrapper.c
@@ -555,7 +555,7 @@ struct swrap {
 static struct swrap swrap;
 
 /* prototypes */
-static const char *socket_wrapper_dir(void);
+static char *socket_wrapper_dir(void);
 
 #define LIBC_NAME "libc.so"
 
@@ -587,15 +587,25 @@ static void *swrap_load_lib_handle(enum swrap_lib lib)
int i;
 
 #ifdef RTLD_DEEPBIND
-   const char *env = getenv("LD_PRELOAD");
+   const char *env_preload = getenv("LD_PRELOAD");
+   const char *env_deepbind = getenv("SOCKET_WRAPPER_DISABLE_DEEPBIND");
+   bool enable_deepbind = true;
 
/* Don't do a deepbind if we run with libasan */
-   if (env != NULL && strlen(env) < 1024) {
-   const char *p = strstr(env, "libasan.so");
-   if (p == NULL) {
-   flags |= RTLD_DEEPBIND;
+   if (env_preload != NULL &&