[SCM] Samba Shared Repository - branch master updated

2019-08-14 Thread Christof Schmitt
The branch, master has been updated
   via  ec05edcceed smbd: Make sys_disk_free static
   via  f77c6c8be6b selftest: Add test for quota query on directory with 
SGID
   via  bbb259e7acb vfs_fake_dfq: Add option to fake stat information
   via  72c4e33decb vfs_gpfs: Check group quota for directory when SGID is 
set
   via  02b7e6c79b8 quotas: Check group quota for directory when SGID is set
  from  9b7825d2d38 auth:ntlmssp: Use generate_random_buffer() for session 
keys

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


- Log -
commit ec05edcceed96f4a17ce7e45c4554b0500946ce0
Author: Christof Schmitt 
Date:   Tue Aug 13 13:45:48 2019 -0700

smbd: Make sys_disk_free static

The function is only called from the same file.

Signed-off-by: Christof Schmitt 
Reviewed-by: Volker Lendecke 

Autobuild-User(master): Christof Schmitt 
Autobuild-Date(master): Wed Aug 14 17:47:33 UTC 2019 on sn-devel-184

commit f77c6c8be6b19880fb46fb5524a39cea03ef7bd5
Author: Christof Schmitt 
Date:   Tue Aug 13 13:44:52 2019 -0700

selftest: Add test for quota query on directory with SGID

Signed-off-by: Christof Schmitt 
Reviewed-by: Volker Lendecke 

commit bbb259e7acb2485232359191f9d799e4c87bcbae
Author: Christof Schmitt 
Date:   Tue Aug 13 13:37:22 2019 -0700

vfs_fake_dfq: Add option to fake stat information

Add an option to allow faking the gid and the SGID bit in the returned
stat buffer. That will be used to verify quota queries on folders with
SGID set.

Signed-off-by: Christof Schmitt 
Reviewed-by: Volker Lendecke 

commit 72c4e33decbaa19f9e7845240fdcf02029ded82c
Author: Christof Schmitt 
Date:   Wed Aug 7 10:42:26 2019 -0700

vfs_gpfs: Check group quota for directory when SGID is set

On directories with the "set group id" (SGID) bit is set, new files and
subfolders will be created with the group of the directory, and not with
the primary group of the user. Checking for free space in this case
should query the group quota for the gid of the directory.

This is the same change as the common smbd code, but since vfs_gpfs
still has its own check for available space and quotas, add it here as
well. A future goal would be to use the common free space check instead
of duplicating code in vfs_gpfs.

Signed-off-by: Christof Schmitt 
Reviewed-by: Volker Lendecke 

commit 02b7e6c79b866ba0d339cad6c4fc9eb0d0be8968
Author: Christof Schmitt 
Date:   Tue Aug 13 13:40:48 2019 -0700

quotas: Check group quota for directory when SGID is set

On directories with the "set group id" (SGID) bit is set, new files and
subfolders will be created with the group of the directory, and not with
the primary group of the user. Checking for free space in this case
should query the group quota for the gid of the directory.

Signed-off-by: Christof Schmitt 
Reviewed-by: Volker Lendecke 

---

Summary of changes:
 source3/modules/vfs_fake_dfq.c   | 79 
 source3/modules/vfs_gpfs.c   | 20 +++-
 source3/script/tests/test_dfree_quota.sh |  9 
 source3/smbd/dfree.c |  7 ++-
 source3/smbd/proto.h |  2 -
 source3/smbd/quotas.c| 23 --
 6 files changed, 130 insertions(+), 10 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/modules/vfs_fake_dfq.c b/source3/modules/vfs_fake_dfq.c
index 019b2e8891d..5347d7500af 100644
--- a/source3/modules/vfs_fake_dfq.c
+++ b/source3/modules/vfs_fake_dfq.c
@@ -187,11 +187,90 @@ out:
return rc;
 }
 
+static void dfq_fake_stat(struct vfs_handle_struct *handle,
+ struct smb_filename *smb_fname,
+ SMB_STRUCT_STAT *sbuf)
+{
+   int snum = SNUM(handle->conn);
+   char *full_path = NULL;
+   char *to_free = NULL;
+   char path[PATH_MAX + 1];
+   int len;
+   gid_t gid;
+
+   len = full_path_tos(handle->conn->cwd_fname->base_name,
+   smb_fname->base_name,
+   path, sizeof(path),
+   &full_path, &to_free);
+   if (len == -1) {
+   DBG_ERR("Could not allocate memory in full_path_tos.\n");
+   return;
+   }
+
+   gid = dfq_load_param(snum, full_path, "stat", "sgid", 0);
+   if (gid != 0) {
+   sbuf->st_ex_gid = gid;
+   sbuf->st_ex_mode |= S_ISGID;
+   }
+
+   TALLOC_FREE(to_free);
+}
+
+static int dfq_stat(vfs_handle_struct *handle,
+   struct smb_filename *smb_fname)
+{
+   int ret;
+
+   ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
+   if (ret == -1) {
+   return ret;
+   }
+
+   dfq_fake_st

[SCM] Samba Shared Repository - branch master updated

2019-08-14 Thread Alexander Bokovoy
The branch, master has been updated
   via  9b7825d2d38 auth:ntlmssp: Use generate_random_buffer() for session 
keys
   via  6fa3e4de7c1 s3:passdb: Use generate_secret_buffer() for generating 
passwords
   via  a3e36dd8f43 s4:samdb: Use generate_nonce_buffer() for AEC GCM nonce
   via  93196dd823e lib:util: Use generate_secret_buffer() for long term 
passwords
   via  d73be972ea5 Revert "s4:rpc_server: Use generate_secret_buffer() to 
create a session key"
   via  38b0695ddac Revert "s4:rpc_server: Use generate_secret_buffer() for 
backupkey wap_key"
   via  1c68085404c Revert "s4:rpc_server: Use generate_secret_buffer() for 
netlogon challange"
   via  689760f2652 Revert "libcli:auth: Use generate_secret_buffer() for 
netlogon challenge"
   via  97c441d7c28 lib:util: Fix documentation for random number functions
  from  4d276a93fc6 smbtorture: extend rpc.lsa to lookup machine over 
forest-wide LookupNames

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


- Log -
commit 9b7825d2d387bcb2515154418a990669ab96358d
Author: Andreas Schneider 
Date:   Mon Aug 12 19:07:15 2019 +0200

auth:ntlmssp: Use generate_random_buffer() for session keys

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 

Autobuild-User(master): Alexander Bokovoy 
Autobuild-Date(master): Wed Aug 14 16:26:47 UTC 2019 on sn-devel-184

commit 6fa3e4de7c168dc7c869ec9966729a36bda27f57
Author: Andreas Schneider 
Date:   Mon Aug 12 18:57:06 2019 +0200

s3:passdb: Use generate_secret_buffer() for generating passwords

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 

commit a3e36dd8f43a5c06969ae158fa54fbc649f44d03
Author: Andreas Schneider 
Date:   Mon Aug 12 18:56:35 2019 +0200

s4:samdb: Use generate_nonce_buffer() for AEC GCM nonce

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 

commit 93196dd823e114f260a68d28bb59eac3909c30d8
Author: Andreas Schneider 
Date:   Mon Aug 12 18:55:56 2019 +0200

lib:util: Use generate_secret_buffer() for long term passwords

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 

commit d73be972ea58d564c770698bf6374a6074f111fe
Author: Andreas Schneider 
Date:   Mon Aug 12 18:50:02 2019 +0200

Revert "s4:rpc_server: Use generate_secret_buffer() to create a session key"

This reverts commit 4b2480518bd3887be3a6cfb713523ac084e09fd5.

Reviewed-by: Alexander Bokovoy 

commit 38b0695ddac244c67b2a33eb927ad3e95d2e8bd6
Author: Andreas Schneider 
Date:   Mon Aug 12 18:49:52 2019 +0200

Revert "s4:rpc_server: Use generate_secret_buffer() for backupkey wap_key"

This reverts commit 5a62056b4530e4c509444be9164a1fca1dce193f.

Reviewed-by: Alexander Bokovoy 

commit 1c68085404cd467c217640e3eabfc4b7f8b1ce9f
Author: Andreas Schneider 
Date:   Mon Aug 12 18:49:37 2019 +0200

Revert "s4:rpc_server: Use generate_secret_buffer() for netlogon challange"

This reverts commit a21770cfdffd2a21045a1bc87e489af0f4c6f130.

Reviewed-by: Alexander Bokovoy 

commit 689760f26521fe5b4c8964a25ddd3ab1c9e9977c
Author: Andreas Schneider 
Date:   Mon Aug 12 18:49:31 2019 +0200

Revert "libcli:auth: Use generate_secret_buffer() for netlogon challenge"

This reverts commit c3ba556f52b15dd80efc26e4fb8f43ce2ee3a7f0.

Reviewed-by: Alexander Bokovoy 

commit 97c441d7c28feb29168e81ebbc5c55b09a845087
Author: Andreas Schneider 
Date:   Mon Aug 12 16:10:20 2019 +0200

lib:util: Fix documentation for random number functions

Signed-off-by: Andreas Schneider 
Reviewed-by: Alexander Bokovoy 

---

Summary of changes:
 auth/ntlmssp/ntlmssp_client.c  | 2 +-
 lib/util/genrand.c | 9 +++--
 lib/util/genrand.h | 8 ++--
 lib/util/genrand_util.c| 6 +++---
 libcli/auth/netlogon_creds_cli.c   | 3 +--
 source3/passdb/pdb_nds.c   | 3 ++-
 source4/dsdb/samdb/ldb_modules/encrypted_secrets.c | 2 +-
 source4/rpc_server/backupkey/dcesrv_backupkey.c| 3 +--
 source4/rpc_server/netlogon/dcerpc_netlogon.c  | 3 +--
 source4/rpc_server/samr/samr_password.c| 5 ++---
 10 files changed, 25 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/auth/ntlmssp/ntlmssp_client.c b/auth/ntlmssp/ntlmssp_client.c
index b8d1190466b..2a80feb4fed 100644
--- a/auth/ntlmssp/ntlmssp_client.c
+++ b/auth/ntlmssp/ntlmssp_client.c
@@ -696,7 +696,7 @@ NTSTATUS ntlmssp_client_challenge(struct gensec_security 
*gensec_security,
.size = session_key.length,
};
 
-   generate_secret_buffer(client_session_key, 
sizeof(client_session_key));
+   gen

[SCM] Samba Shared Repository - branch master updated

2019-08-14 Thread Alexander Bokovoy
The branch, master has been updated
   via  4d276a93fc6 smbtorture: extend rpc.lsa to lookup machine over 
forest-wide LookupNames
   via  685bb03de6a lookup_name:  allow own domain lookup when flags == 0
   via  317bc6a7342 torture/rpc/lsa: allow testing different lookup levels
  from  2dd7ebe072a smbd: Fix CID 1452293 Incorrect expression (NO_EFFECT)

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


- Log -
commit 4d276a93fc624dc04d880f5b4157f272d3555be6
Author: Alexander Bokovoy 
Date:   Sat Aug 10 11:53:12 2019 +0300

smbtorture: extend rpc.lsa to lookup machine over forest-wide LookupNames

Add a simple test to resolve DOMAIN\MACHINE$ via LSA LookupNames3
using LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 level. This level would pass
zero lookup flags to lookup_name().

Signed-off-by: Alexander Bokovoy 
Reviewed-by: Andreas Schneider 

Autobuild-User(master): Alexander Bokovoy 
Autobuild-Date(master): Wed Aug 14 13:07:42 UTC 2019 on sn-devel-184

commit 685bb03de6ab733590831d1df4f5fd60d2ac427d
Author: Alexander Bokovoy 
Date:   Thu Aug 1 15:48:58 2019 +0300

lookup_name:  allow own domain lookup when flags == 0

In 2007, we've added support for multiple lookup levels for LSA
LookupNames family of calls. However, forest-wide lookups, as described
in MS-LSAT 2.2.16, never worked because flags passed to lookup_name()
were always set to zero, expecting at least default lookup on a DC to
apply. lookup_name() was instead treating zero flags as 'skip all
checks'.

Allow at least own domain lookup in case domain name is the same.
This should allow FreeIPA DC to respond to LSA LookupNames3 calls from a
trusted AD DC side.

For the reference, below is a request Windows Server 2016 domain
controller sends to FreeIPA domain controller when attempting to look up
a user from a trusted forest root domain that attemps to login to the
domain controller. Notice the level in the lsa_LookupNames3 call and
resulting flags in lookup_name().

[2019/08/03 07:14:24.156065,  1, pid=23639, effective(967001000, 
967001000), real(967001000, 0), class=rpc_parse] 
../../librpc/ndr/ndr.c:471(ndr_print_function_debug)
   lsa_LookupNames3: struct lsa_LookupNames3
  in: struct lsa_LookupNames3
  handle   : *
  handle: struct policy_handle
  handle_type  : 0x (0)
  uuid : 
004c---455d-3018575c
  num_names: 0x0001 (1)
  names: ARRAY(1)
  names: struct lsa_String
  length   : 0x000a (10)
  size : 0x000c (12)
  string   : *
  string   : 'XS\ab'
  sids : *
  sids: struct lsa_TransSidArray3
  count: 0x (0)
  sids : NULL
  level: 
LSA_LOOKUP_NAMES_UPLEVEL_TRUSTS_ONLY2 (6)
  count: *
  count: 0x (0)
  lookup_options   : 
LSA_LOOKUP_OPTION_SEARCH_ISOLATED_NAMES (0)
  client_revision  : LSA_CLIENT_REVISION_2 (2)
[2019/08/03 07:14:24.156189,  6, pid=23639, effective(967001000, 
967001000), real(967001000, 0), class=rpc_srv] 
../../source3/rpc_server/rpc_handles.c:339(find_policy_by_hnd_internal)
  Found policy hnd[0] [] 00 00 00 00 4C 00 00 00   00 00 00 00 45 5D 30 
18   L... E]0.
  [0010] 57 5C 00 00W\..
[2019/08/03 07:14:24.156228,  4, pid=23639, effective(967001000, 
967001000), real(967001000, 0)] ../../source3/smbd/sec_ctx.c:215(push_sec_ctx)
  push_sec_ctx(967001000, 967001000) : sec_ctx_stack_ndx = 2
[2019/08/03 07:14:24.156246,  4, pid=23639, effective(967001000, 
967001000), real(967001000, 0)] ../../source3/smbd/uid.c:552(push_conn_ctx)
  push_conn_ctx(0) : conn_ctx_stack_ndx = 0
[2019/08/03 07:14:24.156259,  4, pid=23639, effective(967001000, 
967001000), real(967001000, 0)] 
../../source3/smbd/sec_ctx.c:319(set_sec_ctx_internal)
  setting sec ctx (0, 0) - sec_ctx_stack_ndx = 2
[2019/08/03 07:14:24.156273,  5, pid=23639, effective(967001000, 
967001000), real(967001000, 0)] 
../../libcli/security/security_token.c:53(security_token_debug)
  Security token: (NULL)
[2019/08/03 07:14:24.156285,  5, pid=23639, effective(967001000, 
967001000), real(967001000, 0)] 
../../source3/auth/token_util.c:865(debug_unix_user_tok

[SCM] Samba Shared Repository - branch master updated

2019-08-14 Thread Ralph Böhme
The branch, master has been updated
   via  2dd7ebe072a smbd: Fix CID 1452293 Incorrect expression (NO_EFFECT)
  from  6c9d1f855ea ctdb-daemon: Avoid signed/unsigned comparison by casting

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


- Log -
commit 2dd7ebe072acdad56f9bab8237cc9421f230f67e
Author: Volker Lendecke 
Date:   Wed Aug 14 10:26:59 2019 +0200

smbd: Fix CID 1452293 Incorrect expression (NO_EFFECT)

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

Autobuild-User(master): Ralph Böhme 
Autobuild-Date(master): Wed Aug 14 11:48:42 UTC 2019 on sn-devel-184

---

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


Changeset truncated at 500 lines:

diff --git a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c 
b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c
index 0e8e9c68bd7..4c252ceadc5 100644
--- a/source3/rpc_server/mdssvc/srv_mdssvc_nt.c
+++ b/source3/rpc_server/mdssvc/srv_mdssvc_nt.c
@@ -153,7 +153,7 @@ void _mdssvc_open(struct pipes_struct *p, struct 
mdssvc_open *r)
 
*r->out.device_id = *r->in.device_id;
*r->out.unkn2 = *r->in.unkn2;
-   *r->out.unkn3 = *r->out.unkn3;
+   *r->out.unkn3 = *r->in.unkn3;
outpath[0] = '\0';
 
snum = lp_servicenumber(r->in.share_name);


-- 
Samba Shared Repository



[SCM] Samba Shared Repository - branch master updated

2019-08-14 Thread Amitay Isaacs
The branch, master has been updated
   via  6c9d1f855ea ctdb-daemon: Avoid signed/unsigned comparison by casting
   via  4bdfbbd8d4f ctdb-daemon: Avoid signed/unsigned comparison by 
declaring as unsigned
   via  5a3d99dc7ad ctdb-common: Return value of ctdb_queue_length() should 
be unsigned
   via  f7f9f57d2e1 ctdb-tests: Use select_test_node() in ctdb setdebug 
simple test
   via  3ea95ab4cb7 ctdb-tests: Add function select_test_node()
   via  a074dbf6454 ctdb-tools: Fix usage for "ctdb cattdb"
   via  695b3a965b8 ctdb-tests: Don't print summary on failure if -e option 
is specified
   via  7c01bf3d37b ctdb-tests: Drop mention of non-existent -s option
   via  b3b44ae532a ctdb-tests: Add -I  option for iterating tests
   via  91e6fc209be ctdb-tests: Factor out main test loop into run_tests()
   via  da33fb27ab4 ctdb-tests: Add shellcheck test for some test scripts 
and includes
   via  027b7ca0036 ctdb-tests: New variable CTDB_SCRIPTS_TESTS_BIN_DIR
   via  ba55306fce0 ctdb-tests: Rename CTDB_SCRIPTS_TESTS_BINDIR to 
CTDB_SCRIPTS_TESTS_LIBEXEC_DIR
   via  061656d3837 ctdb-tests: Simplify test_wrap script
   via  b1d36e94d2e ctdb-tests: Avoid shellcheck warning SC2045
   via  7d95cb22a4e ctdb-tests: Avoid shellcheck warning SC2034
   via  b198de03dce ctdb-tests: Avoid shellcheck warning SC2230
   via  93b3b010327 ctdb-tests: Avoid shellcheck warning SC2188
   via  45c9fe3abbf ctdb-tests: Avoid shellcheck warning SC2155
   via  664968e523c ctdb-tests: Avoid shellcheck warning SC2004
   via  034f4cfab8b ctdb-tests: Avoid shellcheck warning SC2164
   via  83f73b5abce ctdb-tests: Avoid shellcheck warning SC2086
   via  758962a0d43 ctdb-tools: Drop 'o' option from getopts command
  from  dee721af72e torture: Fix CID 1452288 Null pointer dereferences  
(NULL_RETURNS)

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


- Log -
commit 6c9d1f855ea3fe3d12f712678b7b4347f8982977
Author: Martin Schwenke 
Date:   Thu Aug 1 10:58:42 2019 +1000

ctdb-daemon: Avoid signed/unsigned comparison by casting

Compiling with -Wsign-compare complains:

 1047 |  &&  (call->call_id == CTDB_FETCH_WITH_HEADER_FUNC)) {
  | ^~

struct ctdb_call is a protocol element, so we can't simply change it.

Found by csbuild.

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

Autobuild-User(master): Amitay Isaacs 
Autobuild-Date(master): Wed Aug 14 10:29:59 UTC 2019 on sn-devel-184

commit 4bdfbbd8d4fb681d509d702a8a357b11c8dddcac
Author: Martin Schwenke 
Date:   Thu Aug 1 10:55:39 2019 +1000

ctdb-daemon: Avoid signed/unsigned comparison by declaring as unsigned

Compiling with -Wsign-compare complains:

ctdb/server/ctdb_call.c:831:12: warning: comparison of integer expressions 
of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} 
[-Wsign-compare]
  831 |  if (count <= ctdb_db->statistics.hot_keys[0].count) {
  |^~

and

ctdb/server/ctdb_call.c:844:13: warning: comparison of integer expressions 
of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} 
[-Wsign-compare]
  844 |   if (count <= ctdb_db->statistics.hot_keys[i].count) {
  | ^~

Found by cs-build.

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

commit 5a3d99dc7ad49717252d8c9625e0f8d064cffcd8
Author: Martin Schwenke 
Date:   Thu Aug 1 10:46:36 2019 +1000

ctdb-common: Return value of ctdb_queue_length() should be unsigned

Compiling with -Wsign-compare complains:

ctdb/server/ctdb_daemon.c: scope_hint: In function ‘daemon_queue_send’
ctdb/server/ctdb_daemon.c:259:40: warning: comparison of integer 
expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} 
[-Wsign-compare]
...

The struct ctdb_queue member out_queue_length is actually uint32_t, so
just return that type.

Found by csbuild.

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

commit f7f9f57d2e13e7ced1f2237273965af8dfc29335
Author: Martin Schwenke 
Date:   Fri Jul 26 11:15:50 2019 +1000

ctdb-tests: Use select_test_node() in ctdb setdebug simple test

There is no requirement for IP addresses here.

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

commit 3ea95ab4cb70224b96a3f40fed9bb6dcc2abedf7
Author: Martin Schwenke 
Date:   Fri Jul 26 11:15:05 2019 +1000

ctdb-tests: Add function select_test_node()

Should be used when public IP addresses are not assigned.

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

commit a074dbf6454cc37ec9cda92dd897316cc27cd630
Author: Martin Schwenke 
Date:   Thu Aug 1 16:16:31 2019 +1000

ctdb-tools: Fix usage for "ctdb cattdb"
   

[SCM] Samba Shared Repository - branch master updated

2019-08-14 Thread Ralph Böhme
The branch, master has been updated
   via  dee721af72e torture: Fix CID 1452288 Null pointer dereferences  
(NULL_RETURNS)
   via  77ae0429c91 lib: CID 1452289: API usage errors  (USE_AFTER_FREE)
   via  f1b749eebda smbd: Fix CID 1452290 Null pointer dereferences  
(REVERSE_INULL)
   via  02eb2c92252 smbd: Fix CID 1452291 Null pointer dereferences  
(NULL_RETURNS)
   via  a3dad84630e librpc: Fix CID 1452292 Null pointer dereferences  
(REVERSE_INULL)
  from  f2472f48f53 s3/pdb: fix debug message typos

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


- Log -
commit dee721af72ec68f45c7a230ea0c1a0a3ebe1c7f6
Author: Volker Lendecke 
Date:   Wed Aug 14 08:41:03 2019 +0200

torture: Fix CID 1452288 Null pointer dereferences  (NULL_RETURNS)

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

Autobuild-User(master): Ralph Böhme 
Autobuild-Date(master): Wed Aug 14 08:59:23 UTC 2019 on sn-devel-184

commit 77ae0429c91c03163eaf7545888a7ca7d76ace11
Author: Volker Lendecke 
Date:   Wed Aug 14 08:39:10 2019 +0200

lib: CID 1452289: API usage errors  (USE_AFTER_FREE)

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

commit f1b749eebda720ecf97ed6016faeba7116e6
Author: Volker Lendecke 
Date:   Wed Aug 14 08:37:00 2019 +0200

smbd: Fix CID 1452290 Null pointer dereferences  (REVERSE_INULL)

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

commit 02eb2c9225287ac1fed740f68e014aff52ab5fc9
Author: Volker Lendecke 
Date:   Wed Aug 14 08:36:00 2019 +0200

smbd: Fix CID 1452291 Null pointer dereferences  (NULL_RETURNS)

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

commit a3dad84630e58d380f5c735123fba7f67ce1d180
Author: Volker Lendecke 
Date:   Wed Aug 14 08:34:18 2019 +0200

librpc: Fix CID 1452292 Null pointer dereferences  (REVERSE_INULL)

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

---

Summary of changes:
 lib/util/tiniparser.c   | 1 -
 source3/smbd/dir.c  | 3 ++-
 source3/smbd/dosmode.c  | 2 +-
 source4/librpc/rpc/dcerpc_roh.c | 2 +-
 source4/torture/local/mdspkt.c  | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/tiniparser.c b/lib/util/tiniparser.c
index dbd1c058b0d..428ccff8a63 100644
--- a/lib/util/tiniparser.c
+++ b/lib/util/tiniparser.c
@@ -328,7 +328,6 @@ struct tiniparser_dictionary *tiniparser_load_stream(FILE 
*fp)
 
d = malloc(sizeof(struct tiniparser_dictionary));
if (d == NULL) {
-   fclose(fp);
return NULL;
}
d->section_list = NULL;
diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index 521cb60324e..f60812fd8c9 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -333,11 +333,12 @@ done:
 
 void dptr_CloseDir(files_struct *fsp)
 {
-   struct smbd_server_connection *sconn = fsp->dptr->conn->sconn;
+   struct smbd_server_connection *sconn = NULL;
 
if (fsp->dptr == NULL) {
return;
}
+   sconn = fsp->dptr->conn->sconn;
 
/*
 * The destructor for the struct smb_Dir (fsp->dptr->dir_hnd)
diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c
index bdcdda69ac8..173b90d2cd0 100644
--- a/source3/smbd/dosmode.c
+++ b/source3/smbd/dosmode.c
@@ -922,7 +922,7 @@ static void dos_mode_at_vfs_get_dosmode_done(struct 
tevent_req *subreq)
   NULL,
   &state->smb_fname->st,
   0);
-   if (tevent_req_nomem(path, req)) {
+   if (tevent_req_nomem(smb_path, req)) {
return;
}
 
diff --git a/source4/librpc/rpc/dcerpc_roh.c b/source4/librpc/rpc/dcerpc_roh.c
index 33baa52c618..3aa7551034a 100644
--- a/source4/librpc/rpc/dcerpc_roh.c
+++ b/source4/librpc/rpc/dcerpc_roh.c
@@ -609,7 +609,7 @@ static ssize_t tstream_roh_pending_bytes(struct 
tstream_context *stream)
 
tstream = http_conn_tstream(
ctx->roh_conn->default_channel_out->http_conn);
-   if (stream == NULL) {
+   if (tstream == NULL) {
errno = ENOTCONN;
return -1;
}
diff --git a/source4/torture/local/mdspkt.c b/source4/torture/local/mdspkt.c
index a73c176e746..dd9c391e9e7 100644
--- a/source4/torture/local/mdspkt.c
+++ b/source4/torture/local/mdspkt.c
@@ -72,7 +72,7 @@ static bool test_mdspkt_empty_cnid_fm(struct torture_context 
*tctx)
torture_assert_goto(tctx, ret, ret, done, "sl_unpack failed\n");
 
cnids = dalloc_get(d, "DALLOC_CTX", 0, "sl_cnids_t", 1);
-   torture_assert_not_null_goto(tctx, d, ret, done,
+   torture_assert_not_null_goto(tctx, cnids, ret, done,
 "da