[SCM] Samba Shared Repository - branch master updated

2023-11-21 Thread Jeremy Allison
The branch, master has been updated
   via  f955d9aa49d smbd: Fix Coverity ID 1499372 Uninitialized scalar 
variable
   via  bc0df4fd97a winbind: Fix Coverity ID 1398910
   via  0bc329a3430 lsa4: Fix Coverity ID 1499410
   via  a5c2134cc23 samr4: Fix Coverity ID 1499378
   via  66a8a4f02ea utils: Fix Coverity ID 240113
   via  2651a7b03d6 smbd: Fix/remove a comment that became irrelevant
   via  7c5380c9589 smbd: Fix a comment
   via  af69ea73a42 smbd: Convert a void* into the real DIR*
  from  8863d84d537 s3:rpc_client: Remove unused rpccli_lsa_open_policy2()

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


- Log -
commit f955d9aa49dd880c004347b23e8c7a068bbd8952
Author: Volker Lendecke 
Date:   Wed Nov 15 14:53:06 2023 +0100

smbd: Fix Coverity ID 1499372 Uninitialized scalar variable

This is real.

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Tue Nov 21 18:33:51 UTC 2023 on atb-devel-224

commit bc0df4fd97a44dd69671b7faf8814307a552d400
Author: Volker Lendecke 
Date:   Wed Nov 15 14:48:20 2023 +0100

winbind: Fix Coverity ID 1398910

Coverity isn't smart enough for talloc

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit 0bc329a3430a91357e7062df4c0f8ac5cbde95da
Author: Volker Lendecke 
Date:   Wed Nov 15 14:39:33 2023 +0100

lsa4: Fix Coverity ID 1499410

It complains about uninitialized access, and I'm not sure it isn't
right. Just initialize the structure.

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit a5c2134cc2349e849b89c33dd91b25cc6bf2dd11
Author: Volker Lendecke 
Date:   Wed Nov 15 14:36:20 2023 +0100

samr4: Fix Coverity ID 1499378

Coverity isn't smart enough to see this is initialized. As it's good
practice to initialize vars, just do it.

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit 66a8a4f02eadf9c391be95712319bbca85cca8bc
Author: Volker Lendecke 
Date:   Wed Nov 15 14:26:09 2023 +0100

utils: Fix Coverity ID 240113

Not a leak, but Coverity does not understand talloc well enough.

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit 2651a7b03d6051a7ba054e1dd907a7de148f5159
Author: Volker Lendecke 
Date:   Wed Nov 15 06:24:15 2023 +0100

smbd: Fix/remove a comment that became irrelevant

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit 7c5380c95898969c73edc87d2715e1ef0199122b
Author: Volker Lendecke 
Date:   Sat Nov 18 17:38:09 2023 +0100

smbd: Fix a comment

See 84cf205ff435

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

commit af69ea73a42a4f3903637ee300a27a4f8db32c73
Author: Volker Lendecke 
Date:   Thu Nov 16 20:39:50 2023 +0100

smbd: Convert a void* into the real DIR*

Not sure why this was a void*

Signed-off-by: Volker Lendecke 
Reviewed-by: Jeremy Allison 

---

Summary of changes:
 source3/smbd/dir.c| 6 +-
 source3/smbd/files.c  | 2 +-
 source3/smbd/proto.h  | 2 +-
 source3/smbd/smb2_oplock.c| 8 +---
 source3/smbd/vfs.c| 7 ---
 source3/utils/net_ads.c   | 2 ++
 source3/winbindd/winbindd_ads.c   | 2 ++
 source4/rpc_server/lsa/lsa_init.c | 9 +
 source4/rpc_server/samr/dcesrv_samr.c | 4 ++--
 9 files changed, 23 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/dir.c b/source3/smbd/dir.c
index d9e10b919d3..8fb4476d4ab 100644
--- a/source3/smbd/dir.c
+++ b/source3/smbd/dir.c
@@ -647,11 +647,7 @@ bool smbd_dirptr_get_entry(TALLOC_CTX *ctx,
 
if (posix) {
/*
-* Posix always wants to see symlinks,
-* dangling or not. We've done the
-* openat_pathref_fsp() to fill in
-* smb_fname->fsp just in case it's not
-* dangling.
+* Posix always wants to see symlinks.
 */
ask_sharemode = false;
goto done;
diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 11fee8caf24..48b78dc32c0 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -216,7 +216,7 @@ NTSTATUS create_internal_fsp(connection_struct *conn,
  * Create an internal fsp for an *existing* directory.
  *
  * This should only be used by callers in the VFS that need to control the
- * opening of the directory. Otherwise use open_internal_dirfsp_at().
+ * opening of the directory. Otherwise use open_internal_dirfsp().
  */
 NTSTATUS 

[SCM] Samba Shared Repository - branch master updated

2023-11-21 Thread Andreas Schneider
The branch, master has been updated
   via  8863d84d537 s3:rpc_client: Remove unused rpccli_lsa_open_policy2()
   via  417c8180c44 s3:winbind: Always close the policy handle we opened
   via  05a006fab94 s3:winbind: Use dcerpc_lsa_open_policy_fallback() in 
winbindd_cm.c
   via  6b6a88cdddf s3:utils: Use any_nt_status_not_ok() in 
rpc_rights_grant_internal()
   via  28e7a754c8d s3:utils: Use goto to close the policy in 
rpc_rights_grant_internal()
   via  e5abb584b64 s3:utils: Use dcerpc_lsa_open_policy_fallback() in 
net_rpc_rights.c
   via  5b3e562006a s3:utils: Use dcerpc_lsa_open_policy_fallback() in 
net_rpc.c
   via  48fe294e51d s3:rpcclient: Use dcerpc_lsa_open_policy_fallback() in 
cmd_lsarpc.c
   via  367b946a34b s3:rpcclient: Remove trailing white spaces from 
cmd_lsarpc.c
   via  4f7c395cd3d s3:libnetapi: Use dcerpc_lsa_open_policy_fallback() in 
localgroup.c
   via  bea13a02d4b s3:utils: Use dcerpc_lsa_open_policy_fallback() in 
net_rpc_trust.c
   via  070cfeae527 s3:rpc_server: Use dcerpc_lsa_open_policy_fallback() 
for netlogon
   via  0db702322ce s3:rpc_client: Implement 
dcerpc_lsa_open_policy_fallback()
   via  aecd73becca s3:rpc_client: Implement dcerpc_lsa_open_policy3()
   via  f5a4dcb0a7c s4:torture: Implement lsa_OpenPolicy3 tests
   via  d18ce289054 s3:rpc_server: Implement _lsa_OpenPolicy3()
   via  15cecaaf0f1 s4:rpc_server: Implement dcesrv_lsa_OpenPolicy3()
   via  75e381d4433 s4:torture: Adapt LSA tests for newer Windows versions
   via  f5275ae3dcc lsa.idl: Backport changes from wireshark
   via  5c72df15a87 lsa.idl: Add new functions and types
   via  80ba5456d8c s4:rpc_server: Remove trailing white spaces from 
lsa_init.c
  from  028c90547e3 python:tests: Add ndrdump test for GMSA Managed 
Password blobs

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


- Log -
commit 8863d84d537117e073da0a371bc153e16e4ebd9f
Author: Andreas Schneider 
Date:   Thu Aug 31 18:09:37 2023 +0200

s3:rpc_client: Remove unused rpccli_lsa_open_policy2()

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

Autobuild-User(master): Andreas Schneider 
Autobuild-Date(master): Tue Nov 21 12:21:18 UTC 2023 on atb-devel-224

commit 417c8180c4406e9071ce88cfbe18d15e1f403fc1
Author: Andreas Schneider 
Date:   Tue Oct 24 09:39:09 2023 +0200

s3:winbind: Always close the policy handle we opened

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

commit 05a006fab946ec9dad820c2910bb9782c7fcd380
Author: Andreas Schneider 
Date:   Thu Aug 31 18:08:56 2023 +0200

s3:winbind: Use dcerpc_lsa_open_policy_fallback() in winbindd_cm.c

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

commit 6b6a88cdddff8355299793189b1bf7e8f5a273f0
Author: Andreas Schneider 
Date:   Thu Nov 2 08:31:32 2023 +0100

s3:utils: Use any_nt_status_not_ok() in rpc_rights_grant_internal()

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

commit 28e7a754c8d0d49729f6a85bdbfc02b1a7a023f5
Author: Andreas Schneider 
Date:   Thu Nov 2 08:30:36 2023 +0100

s3:utils: Use goto to close the policy in rpc_rights_grant_internal()

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

commit e5abb584b64c9e82ad73c0303c749688f306c455
Author: Andreas Schneider 
Date:   Thu Aug 31 17:57:09 2023 +0200

s3:utils: Use dcerpc_lsa_open_policy_fallback() in net_rpc_rights.c

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

commit 5b3e562006a1f8f9fc31a74fe2037e83544de7b9
Author: Andreas Schneider 
Date:   Thu Aug 31 16:22:02 2023 +0200

s3:utils: Use dcerpc_lsa_open_policy_fallback() in net_rpc.c

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

commit 48fe294e51de465482b0018e4ce10fe8ecdbd2a0
Author: Andreas Schneider 
Date:   Thu Aug 31 16:08:39 2023 +0200

s3:rpcclient: Use dcerpc_lsa_open_policy_fallback() in cmd_lsarpc.c

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

commit 367b946a34b45036ceacf97e926be87c0b11316d
Author: Andreas Schneider 
Date:   Thu Aug 31 15:39:51 2023 +0200

s3:rpcclient: Remove trailing white spaces from cmd_lsarpc.c

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

commit 4f7c395cd3d5cab9969a7778d0a5c3bca30d3db2
Author: Andreas Schneider 
Date:   Thu Aug 31 11:23:03 2023 +0200

s3:libnetapi: Use dcerpc_lsa_open_policy_fallback() in localgroup.c

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

commit bea13a02d4bc45b6041be435f129557fc1615ce3
Author: Andreas Schneider 
Date:   Thu Aug 31 10:27:12 2023 +0200

s3:utils: Use dcerpc_lsa_open_policy_fallback() in net_rpc_trust.c

Signed-off-by: Andreas Schneider 
Reviewed-by: Stefan 

[SCM] Samba Shared Repository - branch v4-19-test updated

2023-11-21 Thread Jule Anger
The branch, v4-19-test has been updated
   via  b6c13c49153 python:tests: SHA1 is no longer supported by 
cryptography module
   via  2f5a1ac1c96 python:tests: Fix assertEquals which doesn't exist in 
Python 3.12
   via  ec4893eea9c third_party: Build pypamtest with 
-Wno-error=declaration-after-statement
   via  ec5885982af Use python.h from libreplace
   via  2feaa755e25 lib:replace: Add python.h
   via  95af9424ccc smbd: fix close order of base_fsp and stream_fsp in 
smb_fname_fsp_destructor()
  from  a5b61b469a2 pytests: sid_strings: do not fail if epoch ending has 
zeros

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-19-test


- Log -
commit b6c13c49153a4de962f14fd03537eb8afe9c8961
Author: Andreas Schneider 
Date:   Thu Nov 9 22:27:03 2023 +0100

python:tests: SHA1 is no longer supported by cryptography module

See https://github.com/pyca/cryptography/issues/8213#issuecomment-1419060001

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

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 
(cherry picked from commit 938afb8b28973b0065cc3509b70ebe3f6986de47)

Autobuild-User(v4-19-test): Jule Anger 
Autobuild-Date(v4-19-test): Tue Nov 21 11:15:30 UTC 2023 on atb-devel-224

commit 2f5a1ac1c964ca509aa531ad3fefa151a8666ce2
Author: Andreas Schneider 
Date:   Thu Nov 9 21:43:54 2023 +0100

python:tests: Fix assertEquals which doesn't exist in Python 3.12

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

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 
(cherry picked from commit 362b0d69b16c5bbcd0ff7dd7ba12e1ac037a6b3d)

commit ec4893eea9cd7ee1490487b11789b1987eaf7534
Author: Andreas Schneider 
Date:   Thu Nov 9 17:16:17 2023 +0100

third_party: Build pypamtest with -Wno-error=declaration-after-statement

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

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 
(cherry picked from commit c290052fd28bbfa5b885119f322cb0718073e507)

commit ec5885982af6ad9d2b7330f199ddc29ed1678554
Author: Andreas Schneider 
Date:   Thu Nov 9 11:35:56 2023 +0100

Use python.h from libreplace

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

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 
(cherry picked from commit 9621a3d7a6949aa833425884cd22379387738cfa)

commit 2feaa755e25a980cd00ee24612917d9f6f96f3bc
Author: Andreas Schneider 
Date:   Thu Nov 9 11:32:58 2023 +0100

lib:replace: Add python.h

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

Signed-off-by: Andreas Schneider 
Reviewed-by: Andrew Bartlett 
(cherry picked from commit f337fd995024283f6e1b3f8ec1cc2b3aeb55a2a6)

commit 95af9424ccca96054a4350d0fa2f5d9200c93c27
Author: Ralph Boehme 
Date:   Thu Nov 16 10:50:32 2023 +0100

smbd: fix close order of base_fsp and stream_fsp in 
smb_fname_fsp_destructor()

VFS modules like streams_xattr use the function fsp_is_alternate_stream() 
on the
fsp to determine in an fsp is a stream, eg in streams_xattr_close(). If
fspo->base_fsp is arlready set to NULL, this won't work anymore.

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

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

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Thu Nov 16 18:31:17 UTC 2023 on atb-devel-224

(cherry picked from commit 4481a67c1b20549a71d6c5132b637798a09f966d)

---

Summary of changes:
 auth/credentials/pycredentials.c   |   2 +-
 buildtools/wafsamba/samba_autoconf.py  |   3 +
 lib/compression/pycompression.c|   2 +-
 lib/crypto/py_crypto.c |   2 +-
 lib/ldb-samba/pyldb.c  |   2 +-
 lib/ldb/pyldb.c|   2 +-
 lib/ldb/pyldb_util.c   |   2 +-
 .../hash_inode.h => lib/replace/system/python.h|  19 +-
 lib/smbconf/pysmbconf.c|   2 +-
 lib/smbconf/pysmbconf.h|   2 +-
 lib/talloc/pytalloc.c  |   2 +-
 lib/talloc/pytalloc_util.c |   2 +-
 lib/talloc/test_pytalloc.c |   2 +-
 lib/tdb/pytdb.c|   2 +-
 lib/tevent/pytevent.c  |   2 +-
 libcli/nbt/pynbt.c |   2 +-
 libcli/security/pysecurity.c   |   2 +-
 libcli/smb/py_reparse_symlink.c|   2 +-
 libgpo/pygpo.c |   2 +-
 pidl/lib/Parse/Pidl/Samba4/Python.pm   |   2 +-
 python/modules.c   

[SCM] Samba Shared Repository - branch v4-18-test updated

2023-11-21 Thread Jule Anger
The branch, v4-18-test has been updated
   via  d522d15c82b smbd: fix close order of base_fsp and stream_fsp in 
smb_fname_fsp_destructor()
  from  a2ad66e4933 system.c: fall back to become_root if CAP_DAC_OVERRIDE 
isn't usable

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-18-test


- Log -
commit d522d15c82bc413fcc83106c93fd3f051a04f270
Author: Ralph Boehme 
Date:   Thu Nov 16 10:50:32 2023 +0100

smbd: fix close order of base_fsp and stream_fsp in 
smb_fname_fsp_destructor()

VFS modules like streams_xattr use the function fsp_is_alternate_stream() 
on the
fsp to determine in an fsp is a stream, eg in streams_xattr_close(). If
fspo->base_fsp is arlready set to NULL, this won't work anymore.

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

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

Autobuild-User(master): Jeremy Allison 
Autobuild-Date(master): Thu Nov 16 18:31:17 UTC 2023 on atb-devel-224

(cherry picked from commit 4481a67c1b20549a71d6c5132b637798a09f966d)

Autobuild-User(v4-18-test): Jule Anger 
Autobuild-Date(v4-18-test): Tue Nov 21 10:24:37 UTC 2023 on atb-devel-224

---

Summary of changes:
 source3/smbd/files.c | 24 +---
 1 file changed, 13 insertions(+), 11 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/smbd/files.c b/source3/smbd/files.c
index 792e9424bdc..d3f6b629264 100644
--- a/source3/smbd/files.c
+++ b/source3/smbd/files.c
@@ -406,6 +406,7 @@ static void destroy_fsp_smb_fname_link(struct 
fsp_smb_fname_link **_link)
 static int smb_fname_fsp_destructor(struct smb_filename *smb_fname)
 {
struct files_struct *fsp = smb_fname->fsp;
+   struct files_struct *base_fsp = NULL;
NTSTATUS status;
int saved_errno = errno;
 
@@ -417,17 +418,7 @@ static int smb_fname_fsp_destructor(struct smb_filename 
*smb_fname)
}
 
if (fsp_is_alternate_stream(fsp)) {
-   struct files_struct *tmp_base_fsp = fsp->base_fsp;
-
-   fsp_set_base_fsp(fsp, NULL);
-
-   status = fd_close(tmp_base_fsp);
-   if (!NT_STATUS_IS_OK(status)) {
-   DBG_ERR("Closing fd for fsp [%s] failed: %s. "
-   "Please check your filesystem!!!\n",
-   fsp_str_dbg(fsp), nt_errstr(status));
-   }
-   file_free(NULL, tmp_base_fsp);
+   base_fsp = fsp->base_fsp;
}
 
status = fd_close(fsp);
@@ -439,6 +430,17 @@ static int smb_fname_fsp_destructor(struct smb_filename 
*smb_fname)
file_free(NULL, fsp);
smb_fname->fsp = NULL;
 
+   if (base_fsp != NULL) {
+   base_fsp->stream_fsp = NULL;
+   status = fd_close(base_fsp);
+   if (!NT_STATUS_IS_OK(status)) {
+   DBG_ERR("Closing fd for base_fsp [%s] failed: %s. "
+   "Please check your filesystem!!!\n",
+   fsp_str_dbg(base_fsp), nt_errstr(status));
+   }
+   file_free(NULL, base_fsp);
+   }
+
errno = saved_errno;
return 0;
 }


-- 
Samba Shared Repository