summaryrefslogtreecommitdiff
path: root/examples
AgeCommit message (Collapse)AuthorFilesLines
2026-03-01vfs: Remove unused SMB_VFS_GETWD()Volker Lendecke2-15/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sun Mar 1 21:22:24 UTC 2026 on atb-devel-224
2026-02-15vfs: Add "fsp" to SMB_VFS_SET_QUOTAVolker Lendecke2-5/+11
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15vfs: Change SMB_VFS_GET_QUOTA to take a fsp instead of a nameVolker Lendecke2-9/+9
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15vfs: Remove SMB_VFS_STATVFSVolker Lendecke2-17/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15vfs: Add SMB_VFS_FSTATVFSVolker Lendecke2-0/+17
To replace SMB_VFS_STATVFS next Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2026-02-15vfs: Change SMB_VFS_DISK_FREE to take a fspVolker Lendecke2-9/+9
The modules that change the pathname need a synthetic_pathref now for the SMB_VFS_NEXT_DISK_FREE() call. I think this is the right thing to do anyway, as this goes through all the path scrutiny and does not depend on direct multi-component paths anymore. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-27smbXsrvdump: catch exception from unparsable recordsRalph Boehme1-2/+9
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-11-10examples: Fix trailing whitespaceVolker Lendecke3-17/+17
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10vfs: Remove audit_file functionVolker Lendecke2-24/+0
Added in 2012 with 0dc3f423d25d3a, but I could not find any user of that call. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-11-10vfs: Remove connectpath functionVolker Lendecke2-19/+0
Nobody called this Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-10-21vfs: Add SMB_VFS_RENAME_STREAMVolker Lendecke2-0/+22
[MS-FSA] 2.1.5.15.12.1 Algorithm for Performing Stream Rename is simpler and diffent enough from renaming a file or directory that I believe a separate VFS operation is justified instead of tunneling it through the renameat call. For example it's only possible to rename streams within a file, so only one stream open fsp and a newname which is guaranteed to be a stream name is necessary. Add stub implementations to our streams modules, to be filled later. Signed-off-by: Volker Lendecke <vl@samba.org> vfs_streams_xattr: rename_streams Reviewed-by: Ralph Boehme <slow@samba.org>
2025-08-19examples/libsmbclient: Fix CID #1273089 Resource leakGünther Deschner1-1/+3
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Anoop C S <anoopcs@samba.org>
2025-04-18s3:libsmb: introduce smbsock_connect.hStefan Metzmacher2-0/+2
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18example/winexe: pass struct smb_transports through some more layersStefan Metzmacher1-6/+5
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18example/fuse: pass struct smb_transports to connect_one()Stefan Metzmacher1-4/+7
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-04-18s3:libsmb: pass struct smb_transports to cli_full_connection_creds()Stefan Metzmacher2-3/+7
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-11-13examples:winexe: Initialize Trustee.ptstrName at the right timePavel Filipenský1-1/+2
This is a regression of a39cb60 examples:winexe: Fully initialize EXPLICIT_ACCESS BUG: https://bugzilla.samba.org/show_bug.cgi?id=15752 Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org> Autobuild-Date(master): Wed Nov 13 15:47:40 UTC 2024 on atb-devel-224
2024-08-21s3:vfs: add vfs_rename_how to SMB_VFS_RENAMEAT()Stefan Metzmacher2-3/+6
This will support renameat2-like operations in future. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15693 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-07-18examples:winexe: Initialize integerAndreas Schneider1-1/+1
"Error: UNINIT (CWE-457): samba-4.20.0rc2/examples/winexe/winexesvc.c:147: var_decl: Declaring variable ""res"" without initializer. samba-4.20.0rc2/examples/winexe/winexesvc.c:156: uninit_use: Using uninitialized value ""res"". 154| GetOverlappedResult(pipe->h, &pipe->o, (LPDWORD)&res, TRUE); 155| FlushFileBuffers(pipe->h); 156|-> return res; 157| } 158|" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2024-07-18examples:winexe: Fully initialize EXPLICIT_ACCESSAndreas Schneider1-10/+14
"Error: UNINIT (CWE-457): samba-4.20.0rc2/examples/winexe/winexesvc.c:60: var_decl: Declaring variable ""ea"" without initializer. samba-4.20.0rc2/examples/winexe/winexesvc.c:86: uninit_use_in_call: Using uninitialized value ""ea"". Field ""ea.Trustee.pMultipleTrustee"" is uninitialized when calling ""SetEntriesInAclA"". 84| 85| /* Create a new ACL that contains the new ACEs */ 86|-> dwRes = SetEntriesInAcl(1, &ea, NULL, &pACL); 87| if (ERROR_SUCCESS != dwRes) { 88| dbg(""SetEntriesInAcl Error %lu\n"", GetLastError());" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2024-07-08examples: Initialize char arraysAndreas Schneider1-2/+2
"Error: UNINIT (CWE-457): samba-4.20.0rc2/examples/libsmbclient/testacl.c:35: var_decl: Declaring variable ""value"" without initializer. samba-4.20.0rc2/examples/libsmbclient/testacl.c:254: uninit_use_in_call: Using uninitialized value ""*value"" as argument to ""%s"" when calling ""printf"". [Note: The source code implementation of the function has been overridden by a builtin model.] 252| } 253| 254|-> printf(""Attributes for [%s] are:\n%s\n"", path, value); 255| 256| if (stat_and_retry)" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-06-30examples: Make sure the array is probably initializedAndreas Schneider1-1/+1
"Error: UNINIT (CWE-457): samba-4.20.0rc2/examples/libsmbclient/testacl2.c:27: var_decl: Declaring variable ""value"" without initializer. samba-4.20.0rc2/examples/libsmbclient/testacl2.c:48: uninit_use_in_call: Using uninitialized value ""*value"" as argument to ""%s"" when calling ""printf"". [Note: The source code implementation of the function has been overridden by a builtin model.] 46| } 47| 48|-> printf(""Attributes for [%s] are:\n%s\n"", argv[1], value); 49| 50| flags = 0;" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2024-06-30winexe: Make sure specificError is initializedAndreas Schneider1-1/+1
"Error: UNINIT (CWE-457): samba-4.20.0rc2/examples/winexe/winexesvc.c:684: var_decl: Declaring variable ""specificError"" without initializer. samba-4.20.0rc2/examples/winexe/winexesvc.c:711: uninit_use: Using uninitialized value ""specificError"". 709| winexesvcStatus.dwWaitHint = 0; 710| winexesvcStatus.dwWin32ExitCode = status; 711|-> winexesvcStatus.dwServiceSpecificExitCode = specificError; 712| 713| SetServiceStatus(winexesvcStatusHandle, &winexesvcStatus);" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2024-06-28examples: Initialize char arraysAndreas Schneider1-2/+2
"Error: UNINIT (CWE-457): samba-4.20.0rc2/examples/libsmbclient/testacl3.c:15: var_decl: Declaring variable ""value"" without initializer. samba-4.20.0rc2/examples/libsmbclient/testacl3.c:55: uninit_use_in_call: Using uninitialized value ""*value"" as argument to ""%s"" when calling ""printf"". [Note: The source code implementation of the function has been overridden by a builtin model.] 53| } 54| 55|-> printf(""Attributes for [%s] are:\n%s\n"", path, value); 56| } 57|" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2024-06-28examples: Use cp with force optionAndreas Schneider1-3/+3
"Error: SHELLCHECK_WARNING: /usr/share/doc/samba/printing/VampireDriversFunctions:951:15: warning[SC2216]: Piping to 'cp', a command that doesn't read stdin. Wrong command or missing xargs? 949| CWD2=""$( pwd )"" ; 950| cd ""${i}""; 951|-> echo ""yes"" | cp ../alldriverfiles.txt . 2> /dev/null ; 952| 953| cat alldriverfiles.txt \" Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Noel Power <npower@samba.org>
2024-05-31examples:winexe: embed Samba version as exe timestampDouglas Bagnall1-7/+14
It turns out the timestamp doesn't need to be real, and it isn't used, but it might as well tell you something. So let's make it tell you what version of Samba it came from, which could be useful for people who have lots of old winexes lying around, the poor souls. 00000040 0e 1f ba 0e 00 b4 09 cd 21 b8 01 4c cd 21 54 68 |........!..L.!Th| 00000050 69 73 20 70 72 6f 67 72 61 6d 20 63 61 6e 6e 6f |is program canno| 00000060 74 20 62 65 20 72 75 6e 20 69 6e 20 44 4f 53 20 |t be run in DOS | 00000070 6d 6f 64 65 2e 0d 0d 0a 24 00 00 00 00 00 00 00 |mode....$.......| 00000080 50 45 00 00 64 86 0a 00 00 15 04 00 00 00 00 00 |PE..d...........| | | | | | major 4. | minor 21. release 0 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13213 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Fri May 31 01:28:06 UTC 2024 on atb-devel-224
2024-05-31examples:winexe: reproducible builds with zero timestampDouglas Bagnall2-2/+16
Windows Portable Executable files have a timestamp field and a checksum field. By default the timestamp field is updated to the current time, which consequently changes the checksum. This makes the build nondeterministic. It looks like this: --- a/tmp/winexe-1/winexesvc64_exe_binary.c +++ b/tmp/winexe-2/winexesvc64_exe_binary.c @@ -23,7 +23,7 @@ const DATA_BLOB *winexesvc64_exe_binary(void) 0x6D, 0x6F, 0x64, 0x65, 0x2E, 0x0D, 0x0D, 0x0A, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x45, 0x00, 0x00, 0x64, 0x86, 0x0A, 0x00, - 0xB2, 0x16, 0x55, 0x66, 0x00, 0x00, 0x00, 0x00, + 0xD3, 0x3B, 0x55, 0x66, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x00, 0x2E, 0x02, 0x0B, 0x02, 0x02, 0x26, 0x00, 0x86, 0x00, 0x00, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, @@ -33,7 +33,7 @@ const DATA_BLOB *winexesvc64_exe_binary(void) 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, - 0x73, 0xD7, 0x00, 0x00, 0x03, 0x00, 0x60, 0x01, + 0x94, 0xFC, 0x00, 0x00, 0x03, 0x00, 0x60, 0x01, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, https://learn.microsoft.com/en-us/windows/win32/debug/pe-format says that a timestamp of zero can be used to represent a time that is not "real or meaningful", so we do that. As far as I can tell, the timestamp and checksum are only used in DLLs, not directly executed .exe files. Thanks to Freexian and the Debian LTS project for sponsoring this work. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13213 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-31examples:winexe: more efficient C array generation, no py2Douglas Bagnall1-18/+7
We don't need to recreate the src array every time, and we don't need to worry about Python 2 strings. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-05-22libsmb: Execute a "TODO", remove IVAL2_TO_SMB_BIG_UINTVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-04-29s3:libsmb: Pass memory context to cli_full_connection_creds()Andreas Schneider2-5/+12
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2024-01-09examples/scripts: add smbXsrvdumpRalph Boehme1-0/+87
A simple python tool to dump smbXsrv TDB databases. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-10-25examples: Fix code spellingJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13examples: Fix invalid escape sequencesJoseph Sutton1-5/+5
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-13examples: Don’t use deprecated method ‘has_key()’Joseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-10-12examples: Enable posix for teststatVolker Lendecke1-0/+2
Show that we can properly detect non-regular files created by the Windows NFS server. Tested manually against Windows 2022. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-10-12examples: Print file type as part of teststatVolker Lendecke1-4/+31
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-10-10examples: Expand IS_DOS_DIR() macrosVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-10-10libsmb: Pass "flags" through cli_close_send() and pylibsmbVolker Lendecke1-20/+17
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15487 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-10-10libsmb: Add "flags" to cli_smb2_close_fnum_send()Volker Lendecke1-1/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15487 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-10-04libsmb: Pass NTTIME to interpret_long_date()Volker Lendecke1-8/+8
Separate concerns of conversion and pulling off the wire. Needed soon for smb311 pidl generated parsing. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-09-25clifuse: Start implementing forget()Volker Lendecke1-0/+20
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-09-25clifuse: Use an empty array for holding the inode pathVolker Lendecke1-1/+1
Cleaner these days. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-09-25examples: Slightly modernize printfs in teststatVolker Lendecke1-8/+14
long long works, but it's a bit too specific now that we have intmax_t Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-09-25examples: Use explicit SMBCCTXVolker Lendecke1-2/+12
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-08-23examples: Use lpcfg_set_cmdline()Pavel Kalugin1-2/+5
Signed-off-by: Pavel Kalugin <pkalugin@inno.tech> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-08-22clifuse: Use direct FSCC info levelVolker Lendecke1-8/+12
Avoid the magic -1000 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-07-17examples: Remove outdated validcharsAndreas Schneider5-815/+0
I don't think we even look into this anymore and have other tests in place. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-07-17example: Remove outdated config files from tridgeAndreas Schneider6-162/+0
I don't think he still runs Windows 95 ... Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-07-13examples: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2023-07-13examples: Make codespell happyAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>