summaryrefslogtreecommitdiff
path: root/source3/utils
AgeCommit message (Collapse)AuthorFilesLines
2023-01-12lib: Fix a use-after-free in "net vfs getntacl"Volker Lendecke1-1/+3
Don't hang "sd" off "fsp", which is free'ed before printing Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Jan 12 16:41:07 UTC 2023 on sn-devel-184
2023-01-12build: Don't compile source3/lib/util_sd.c four timesVolker Lendecke1-3/+5
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2023-01-12s3:utils:mdsearch go to cmdline_messaging_context_freeJones Syue1-9/+11
mdsearch utility would exit earlier with failure in several cases like: a. samba server is not running yet, [~] # mdsearch -Uuser%password1 ${server} Public '*=="Samba"' main: Cannot connect to server: NT_STATUS_CONNECTION_REFUSED b. spotlight backend service is not ready yet, [~] # mdsearch -Uuser%password1 ${server} Public '*=="Samba"' Failed to connect mdssvc c. mdsearch utility paramters is not as expecred, [~] # mdsearch -Uuser%password1 ${server} share_not_exist '*=="Samba"' mdscli_search failed And in the mean while once mdsearch utility exit earlier with failure, the lock files are left behind in the directory 'msg.sock' and 'msg.lock'. If a script to run mdsearch utility in a loop, this might result in used space slowly growing-up on underlying filesystem. Supposed to add a new label 'fail_free_messaging', make it go through the cmdline_messaging_context_free() which deletes the lock files in the directory msg.sock and msg.lock before mdsearch utility is exiting with failure. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15284 Signed-off-by: Jones Syue <jonessyue@qnap.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Jan 12 11:40:19 UTC 2023 on sn-devel-184
2023-01-11s3:smbstatus: go to cmdline_messaging_context_freeJones Syue1-1/+2
If the locking.tdb is not found, (for example, fresh new installed samba server is not running yet) smbstatus utility would exit earlier, and lock files are left behind in the directory 'msg.sock' and 'msg.lock'. Consider that a script to run smbstatus utility in a loop, this might result in used space slowly growing-up on the underlying filesystem. Since the samba server is not running yet, there is no cleanupd daemon could delete these files to reclaim space. Supposed to use 'ret = 0; goto done;' instead of exit(0), this would go through the cmdline_messaging_context_free() which deletes the lock files in the directory msg.sock and msg.lock before smbstatus utility is exiting. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15282 Signed-off-by: Jones Syue <jonessyue@qnap.com> Reviewed-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Jan 11 17:08:10 UTC 2023 on sn-devel-184
2023-01-10lib: Make map_share_mode_to_deny_mode() static to smbstatusVolker Lendecke1-0/+22
At some point in the future this might disappear, we should really not show DOS share modes in smbstatus. Maybe this can't be changed though. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-16s3-librpc: add ads.idl and convert ads_struct to talloc.Günther Deschner1-3/+3
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-13CVE-2022-37966 s3:net_ads: let 'net ads enctypes list' pretty print ↵Stefan Metzmacher1-0/+6
AES256-SK and RESOURCE-SID-COMPRESSION-DISABLED BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-12-13CVE-2022-37966 s3:net_ads: no longer reference des encryption typesStefan Metzmacher1-1/+2
We no longer have support for des encryption types in the kerberos libraries anyway. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-12-13CVE-2022-37966 s3:net_ads: remove unused ifdef HAVE_ENCTYPE_AES*Stefan Metzmacher1-4/+0
aes encryption types are always supported. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-12-13CVE-2022-37966 testparm: warn about 'kerberos encryption types = legacy'Stefan Metzmacher1-0/+8
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15237 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-12-13CVE-2022-38023 testparm: warn about unsecure schannel related optionsStefan Metzmacher1-0/+61
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15240 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-12-13CVE-2022-38023 testparm: warn about server/client schannel != yesStefan Metzmacher1-3/+17
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15260 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-12-13CVE-2022-38023 s3:net: add and use net_warn_member_options() helperStefan Metzmacher8-0/+52
This makes sure domain member related 'net' commands print warnings about unsecure smb.conf options. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15240 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-12-13CVE-2022-38023 libcli/auth: pass lp_ctx to netlogon_creds_cli_set_global_db()Stefan Metzmacher1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15240 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-12-05s3:utils: Fix stack smashing in net offlinejoinAndreas Schneider1-3/+8
Cast from 'uint32_t *' (aka 'unsigned int *') to 'size_t *' (aka 'unsigned long *') increases required alignment from 4 to 8 ==10343==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffdc6784fc0 at pc 0x7f339f1ea500 bp 0x7ffdc6784ed0 sp 0x7ffdc6784ec8 WRITE of size 8 at 0x7ffdc6784fc0 thread T0 #0 0x7f339f1ea4ff in fd_load ../../lib/util/util_file.c:220 #1 0x7f339f1ea5a4 in file_load ../../lib/util/util_file.c:245 #2 0x56363209a596 in net_offlinejoin_requestodj ../../source3/utils/net_offlinejoin.c:267 #3 0x56363209a9d0 in net_offlinejoin ../../source3/utils/net_offlinejoin.c:74 #4 0x56363208f61c in net_run_function ../../source3/utils/net_util.c:453 #5 0x563631fe8a9f in main ../../source3/utils/net.c:1358 #6 0x7f339b22c5af in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58 #7 0x7f339b22c678 in __libc_start_main_impl ../csu/libc-start.c:381 #8 0x563631faf374 in _start ../sysdeps/x86_64/start.S:115 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15257 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Dec 5 12:05:24 UTC 2022 on sn-devel-184
2022-11-24net: use correct printf format, fi3_id is an uint32_tRalph Boehme1-1/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Thu Nov 24 16:39:12 UTC 2022 on sn-devel-184
2022-11-02smbget: Adds a rate limiting option --limit-rate in KB/svporpo1-0/+73
This patch implements a very simple rate limiter. It works by pausing the main download loop whenever the bytes transferred are more than what we would get with if it were transferred at the rate set by the user. Please note that this may reduce the blocksize if the limit is too small. Signed-off-by: Vasileios Porpodas <v.porpodas@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Nov 2 22:47:10 UTC 2022 on sn-devel-184
2022-10-27s3:util: add 'net ads keytab delete'Stefan Metzmacher1-0/+50
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-10-27s3:utils: Fix old-style function definitionAndreas Schneider1-6/+6
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-10-21s3-utils: Fix typo in error message in net groupmapJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2022-10-17s3/utils: check result of talloc_strdupNoel Power1-0/+5
follow to commit 4b15d8c2a5c8547b84e7926fed9890b5676b8bc3 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15205 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Oct 17 19:49:37 UTC 2022 on sn-devel-184
2022-10-17s3/utils: Check return of talloc_strdupNoel Power1-2/+10
followup to e82699fcca3716d9ed0450263fd83f948de8ffbe BUG: https://bugzilla.samba.org/show_bug.cgi?id=15205 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-10-14s3/utils: Fix use after free with popt 1.19Noel Power1-3/+3
popt1.19 fixes a leak that exposes a use as free, make sure we duplicate return of poptGetArg if poptFreeContext is called before we use it. ==6055== Command: ./bin/testparm /etc/samba/smb.conf ==6055== ==6055== Invalid read of size 1 ==6055== at 0x4849782: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4C1E50F: __vfprintf_internal (in /usr/lib64/libc.so.6) ==6055== by 0x4C1EB74: buffered_vfprintf (in /usr/lib64/libc.so.6) ==6055== by 0x4C119E9: fprintf (in /usr/lib64/libc.so.6) ==6055== by 0x10EBFA: main (testparm.c:862) ==6055== Address 0x72dab70 is 0 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 1 ==6055== at 0x4849794: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4C1E50F: __vfprintf_internal (in /usr/lib64/libc.so.6) ==6055== by 0x4C1EB74: buffered_vfprintf (in /usr/lib64/libc.so.6) ==6055== by 0x4C119E9: fprintf (in /usr/lib64/libc.so.6) ==6055== by 0x10EBFA: main (testparm.c:862) ==6055== Address 0x72dab71 is 1 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 1 ==6055== at 0x4C44DD0: _IO_default_xsputn (in /usr/lib64/libc.so.6) ==6055== by 0x4C1E39E: __vfprintf_internal (in /usr/lib64/libc.so.6) ==6055== by 0x4C1EB74: buffered_vfprintf (in /usr/lib64/libc.so.6) ==6055== by 0x4C119E9: fprintf (in /usr/lib64/libc.so.6) ==6055== by 0x10EBFA: main (testparm.c:862) ==6055== Address 0x72dab70 is 0 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 1 ==6055== at 0x4C44DDF: _IO_default_xsputn (in /usr/lib64/libc.so.6) ==6055== by 0x4C1E39E: __vfprintf_internal (in /usr/lib64/libc.so.6) ==6055== by 0x4C1EB74: buffered_vfprintf (in /usr/lib64/libc.so.6) ==6055== by 0x4C119E9: fprintf (in /usr/lib64/libc.so.6) ==6055== by 0x10EBFA: main (testparm.c:862) ==6055== Address 0x72dab72 is 2 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== Load smb config files from /etc/samba/smb.conf ==6055== Invalid read of size 1 ==6055== at 0x4849782: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927E1C: talloc_strdup (talloc.c:2470) ==6055== by 0x48B5D37: talloc_sub_basic (substitute.c:303) ==6055== by 0x4889B98: lp_load_ex (loadparm.c:4004) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab70 is 0 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 1 ==6055== at 0x4849794: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927E1C: talloc_strdup (talloc.c:2470) ==6055== by 0x48B5D37: talloc_sub_basic (substitute.c:303) ==6055== by 0x4889B98: lp_load_ex (loadparm.c:4004) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab71 is 1 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 8 ==6055== at 0x484D3AE: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927DC2: __talloc_strlendup (talloc.c:2457) ==6055== by 0x4927E32: talloc_strdup (talloc.c:2470) ==6055== by 0x48B5D37: talloc_sub_basic (substitute.c:303) ==6055== by 0x4889B98: lp_load_ex (loadparm.c:4004) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab70 is 0 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 2 ==6055== at 0x484D400: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927DC2: __talloc_strlendup (talloc.c:2457) ==6055== by 0x4927E32: talloc_strdup (talloc.c:2470) ==6055== by 0x48B5D37: talloc_sub_basic (substitute.c:303) ==6055== by 0x4889B98: lp_load_ex (loadparm.c:4004) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab80 is 16 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 1 ==6055== at 0x484D430: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927DC2: __talloc_strlendup (talloc.c:2457) ==6055== by 0x4927E32: talloc_strdup (talloc.c:2470) ==6055== by 0x48B5D37: talloc_sub_basic (substitute.c:303) ==6055== by 0x4889B98: lp_load_ex (loadparm.c:4004) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab82 is 18 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 1 ==6055== at 0x4849782: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927E1C: talloc_strdup (talloc.c:2470) ==6055== by 0x4B5974B: add_to_file_list (loadparm.c:1023) ==6055== by 0x4889BD4: lp_load_ex (loadparm.c:4011) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab70 is 0 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 1 ==6055== at 0x4849794: strlen (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927E1C: talloc_strdup (talloc.c:2470) ==6055== by 0x4B5974B: add_to_file_list (loadparm.c:1023) ==6055== by 0x4889BD4: lp_load_ex (loadparm.c:4011) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab71 is 1 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 8 ==6055== at 0x484D3AE: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927DC2: __talloc_strlendup (talloc.c:2457) ==6055== by 0x4927E32: talloc_strdup (talloc.c:2470) ==6055== by 0x4B5974B: add_to_file_list (loadparm.c:1023) ==6055== by 0x4889BD4: lp_load_ex (loadparm.c:4011) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab70 is 0 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 2 ==6055== at 0x484D400: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927DC2: __talloc_strlendup (talloc.c:2457) ==6055== by 0x4927E32: talloc_strdup (talloc.c:2470) ==6055== by 0x4B5974B: add_to_file_list (loadparm.c:1023) ==6055== by 0x4889BD4: lp_load_ex (loadparm.c:4011) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab80 is 16 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== ==6055== Invalid read of size 1 ==6055== at 0x484D430: memmove (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4927DC2: __talloc_strlendup (talloc.c:2457) ==6055== by 0x4927E32: talloc_strdup (talloc.c:2470) ==6055== by 0x4B5974B: add_to_file_list (loadparm.c:1023) ==6055== by 0x4889BD4: lp_load_ex (loadparm.c:4011) ==6055== by 0x488A29E: lp_load_with_registry_shares (loadparm.c:4237) ==6055== by 0x10EC06: main (testparm.c:864) ==6055== Address 0x72dab82 is 18 bytes inside a block of size 20 free'd ==6055== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB28B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x4BB35D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EBAC: main (testparm.c:854) ==6055== Block was alloc'd at ==6055== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==6055== by 0x4BB42EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==6055== by 0x10EB2E: main (testparm.c:830) ==6055== BUG: https://bugzilla.samba.org/show_bug.cgi?id=15205 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-10-14s3/utils: Fix use after free with popt 1.19Noel Power1-1/+1
popt1.19 fixes a leak that exposes a use as free, make sure we duplicate return of poptGetArg if poptFreeContext is called before we use it. ==5914== Invalid read of size 1 ==5914== at 0x4FDF740: strlcpy (in /usr/lib64/libbsd.so.0.11.6) ==5914== by 0x49E09A9: tdbsam_getsampwnam (pdb_tdb.c:583) ==5914== by 0x49D94E5: pdb_getsampwnam (pdb_interface.c:340) ==5914== by 0x10DED1: print_user_info (pdbedit.c:372) ==5914== by 0x111413: main (pdbedit.c:1324) ==5914== Address 0x73b6750 is 0 bytes inside a block of size 7 free'd ==5914== at 0x484617B: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==5914== by 0x4C508B8: poptResetContext (in /usr/lib64/libpopt.so.0.0.2) ==5914== by 0x4C515D4: poptFreeContext (in /usr/lib64/libpopt.so.0.0.2) ==5914== by 0x1113E6: main (pdbedit.c:1323) ==5914== Block was alloc'd at ==5914== at 0x48437B4: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so) ==5914== by 0x4C522EE: poptGetNextOpt (in /usr/lib64/libpopt.so.0.0.2) ==5914== by 0x110AE5: main (pdbedit.c:1137) ==5914== BUG: https://bugzilla.samba.org/show_bug.cgi?id=15205 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-10-14s3/utils: Add missing poptFreeContextNoel Power1-0/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15205 Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-09-20s3:g_lock: add callback function to g_lock_lock()Stefan Metzmacher2-2/+9
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-19registry3: Move registry_value_cmp() to its only userVolker Lendecke1-0/+9
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-09-15s3: smbcacls: Now cli_resolve_path() and cli_list() can handle DFS names we ↵Jeremy Allison1-71/+2
no longer need local_cli_resolve_path(). Remove local_cli_resolve_path(). No more special treatment for DFS names in smbcacls. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Noel Power <noel.power@suse.com>
2022-09-15s3: smbcacls: In cli_lsa_lookup_domain_sid(), replace ↵Jeremy Allison1-6/+3
cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). There are now no more external users of cli_state_save_tcon()/cli_state_restore_tcon() so we can make them static. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2022-09-15s3: utils: In show_userlist() replace ↵Jeremy Allison1-6/+4
cli_state_save_tcon()/cli_state_restore_tcon() with cli_state_save_tcon_share()/cli_state_restore_tcon_share(). Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2022-09-07ntlm_auth: Remove an unused #includeVolker Lendecke1-1/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-26s3:afs: Zero memory for afs_keyfilePavel Filipenský1-0/+2
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26s3:net: Zero password in secrets_fetch_ipc_userpass() callersPavel Filipenský1-2/+2
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26s3:net: Fix trailing whitespace in net.cPavel Filipenský1-1/+1
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-26s3:passdb: Zero password in fetch_ldap_pw() callersPavel Filipenský1-2/+1
Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-08-19s3:g_lock: add some const to the shared array passed via g_lock_dump*()Stefan Metzmacher1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-17s3:utils remove documentation of -l as alias for --longChristian Ambach1-8/+8
This was removed in 94fc9ca4c506468ab1907d501c0964d67b9d963c, so remove it from the usage output and manpage. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15145 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Aug 17 07:14:21 UTC 2022 on sn-devel-184
2022-08-12s3:utils: Fix NULL checkAndreas Schneider1-1/+1
CID 1507864 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15140 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 12 21:50:23 UTC 2022 on sn-devel-184
2022-08-12s3:util: Initialize json_object structures so we can call json_free()Andreas Schneider1-7/+24
CID 1507863 CID 1507865 CID 1507866 CID 1507867 CID 1507868 CID 1507869 CID 1507870 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15140 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-08-09smbstatus: Fix the 32-bit build on FreeBSDVolker Lendecke1-4/+6
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Aug 9 20:04:26 UTC 2022 on sn-devel-184
2022-08-08smbstatus: add JSON support for smbstatus --profileJule Anger4-12/+38
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: fix indentation in profile_separator()Ralph Boehme1-8/+8
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jule Anger <janger@samba.org>
2022-08-08smbstatus: add a method to add profile items to jsonJule Anger3-0/+54
The method changes the json item of a given traverse_state. The root dictionary contains for each section a dictionary, which has a dictionary for each subsection. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add JSON support for smbstatusJule Anger1-5/+31
Adds the option --json for all informations except the profiling. With --json sets the json_output variable to true, so that the json dictionary can be created and printed. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add machine readable creation_time to notifyJule Anger1-0/+9
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add server_id to notifiesJule Anger4-5/+8
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add a notifies dictionaryJule Anger4-7/+99
Adds an empty json dictionary under the key "notifies" and adds foreach notify a dictionary with information to the notify dictionary. Uses the pid as key. Only print to stdout, if json_output is not set. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add file_id information to byte-range locks in json outputJule Anger4-0/+8
Adds a dictionary with file_id information (devid, inode and extid) for each byte-range locked file. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add locks to byte-range locked files in json outputJule Anger4-0/+88
At the moment, there is only information about the byte-range locked files. Adds a list of its locks for each file. An open is represented as a dictionary. Contains all information (pid, dev_inode, read_write, start and size) about the lock. Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2022-08-08smbstatus: add server_id to byte-range locksJule Anger4-0/+8
Signed-off-by: Jule Anger <janger@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>