summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* libsmb: Introduce type-safe struct cli_smb2_create_flagsVolker Lendecke2023-04-181-2/+2
| | | | | | | | | | | | | | | This makes it clearer what to pass into the create_flags argument to cli_smb2_create_fnum(). There was already confusion in source3/torture/test_smb2.c: It passed in SMB2_OPLOCK_LEVEL_NONE (which was okay because it #defines to 0), but it should have been a straight 0, for example SMB2_OPLOCK_LEVEL_EXCLUSIVE would have been wrong. This way adding other flags (.nofollow comes to mind) will be much easier to handle. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* examples: Fix spellingAndreas Schneider2023-04-111-1/+1
| | | | | | Best reviewed with: `git show --word-diff`. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
* examples: Improve comment in smb.conf.defaultAndreas Schneider2023-03-281-1/+1
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org>
* examples: Remove trailing whitespaces in smb.conf.defaultAndreas Schneider2023-03-281-12/+12
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org>
* examples: Fix code spellingAndreas Schneider2023-03-2817-26/+26
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org>
* examples: Remove trailing whitespaces in mklogon.confAndreas Schneider2023-03-281-9/+9
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org>
* examples: Remove trailing whitespaces in ol-schema-migrate.plAndreas Schneider2023-03-281-26/+26
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Rowland Penny <rpenny@samba.org>
* lib: Remove idtree from samba_util.hVolker Lendecke2023-01-101-0/+1
| | | | | | | No need to recompile the world when only a few files need this. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* build: Convert winexe to use enabled= in wscriptAndrew Bartlett2022-12-161-26/+34
| | | | | | | | | | | | | This also allows --without-winexe to stop building the .exe files even if the compilers are present on the system. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15264 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Dec 16 07:41:38 UTC 2022 on sn-devel-184
* libsmb: Pass symlink error up through cli_smb2_create_fnum_recv()Volker Lendecke2022-11-221-2/+2
| | | | | | | | Not passing through the sync wrapper yet. Not needed right now, and it's simple to add if required. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Return symlink error struct from smb2cli_create_recv()Volker Lendecke2022-11-221-6/+16
| | | | | | | | Looks larger than it is, this just adds a parameter and while there adapts long lines to README.Coding Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Add dirfsp to connectpath_fn()Volker Lendecke2022-09-172-5/+9
| | | | | | | | | | So far we only call CONNECTPATH on full paths. In the future, we'll have a call that will not have converted a relative path to absolute just for efficiency reasons. To give shadow_copy2 the chance to still find the snapshot directory, pass the dirfsp down to it. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: A tiny bit of README.Coding for teststat.cVolker Lendecke2022-08-261-17/+12
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Make libsmbclient samples look a *bit* less uglyVolker Lendecke2022-08-2619-1921/+1916
| | | | | | | | Remove trailing whitespace, indent to tabs. Yes, this introduces long lines, but makes review with "git show -w" trivial. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Fix shellcheck error in VampireDriversFunctionsAndreas Schneider2022-08-171-16/+16
| | | | | | | examples/printing/VampireDriversFunctions:183:24: error: Double quote array expansions to avoid re-splitting elements. [SC2068] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* examples: Remove trailing spaces in VampireDriversFunctionsAndreas Schneider2022-08-171-206/+206
| | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* examples: Fix shellcheck error in get_next_oidAndreas Schneider2022-08-171-2/+2
| | | | | | | examples/LDAP/get_next_oid:6:4: error: Remove spaces around += to assign (or quote '+=' if literal). [SC2285] Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
* vfs: Add struct vfs_open_how.resolveVolker Lendecke2022-08-061-0/+5
| | | | | | | | | | | | | | | | | | This prepares the later introduction of VFS_OPEN_HOW_RESOLVE_NO_SYMLINKS, which will be used to make use of RESOLVE_NO_SYMLINKS on linux with openat2(). Right now all terminal VFS objects reject any resolve bits with ENOSYS. So we only prepare the vfs layer for now without any real change. But this will make backports to 4.17 much easier. Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Aug 6 02:39:11 UTC 2022 on sn-devel-184
* vfs: change openat propotype to match linux openat2Volker Lendecke2022-08-062-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Linux prototype for openat2 looks like this: long openat2(int dirfd, const char *pathname, struct open_how *how, size_t size); where "struct open_how" is defined in "linux/openat2.h". It is designed to be extensible with further flags. The "size" parameter is required because there is no type checking between userland and kernelspace, so the way for Linux to find which version of open_how is being passed in is looking at the size: "open_how" is expected to only every grow with additional fields, should a change be necessary in the future. Samba does not have this problem, we can typecheck the struct and pointers, we expect all VFS modules to be compiled against the current vfs.h. For now this adds no functionality, but it will make further patches much smaller. Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples/winexe: fix fetching return code of the remote commandYury Lunev2022-07-281-1/+1
| | | | | | | | | | | | | | ctrl_inbuf field is used to parse remote-side information. A typo was there that tried to parse return code as "version 0x%x" whereas the correct way to do it (tested on Windows 10) is to scan for "return_code %x". Signed-off-by: Yury Lunev <yury.lunev@gmail.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu Jul 28 18:01:16 UTC 2022 on sn-devel-184
* examples: Update winbind.stpSamuel Cabrero2022-05-192-1/+22
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Update winbind.stpSamuel Cabrero2022-05-192-22/+22
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Update winbind.stpSamuel Cabrero2022-05-192-22/+22
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Update winbind.stpSamuel Cabrero2022-05-192-22/+22
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Update winbind.stp, delete removed functionsSamuel Cabrero2022-05-192-43/+1
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Update winbind.stp and generate scriptSamuel Cabrero2022-04-302-1/+22
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Revert "vfs: remove dirfsp arg from SMB_VFS_CREATE_FILE()"Volker Lendecke2022-04-282-0/+3
| | | | | | | | | | This reverts commit 322574834f1e71bc01f21be9059ca4d386517c84. Not strictly a revert anymore, but for future work we do need "dirfsp" in create_file_default() passed through the VFS. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* vfs: Remove name-based SMB_VFS_GET_REAL_FILENAME()Volker Lendecke2022-04-282-21/+0
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* vfs: Add SMB_VFS_GET_REAL_FILENAME_ATVolker Lendecke2022-04-282-0/+21
| | | | | | | | | | | | | In a patchset that I'm working on right now there's the need to call getrealfilename while the code does have a pathref fsp already around. Doing the name-based call including non_widelink_open is not necessary in this case. Start by adding the _at based call to the VFS. For now, fall back to the name-based call. glusterfs-fuse will in a future patch be converted to fgetxattr. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* examples: Update winbindd.stp and generate scriptSamuel Cabrero2022-04-082-1/+22
| | | | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Apr 8 21:06:01 UTC 2022 on sn-devel-184
* examples: Update winbindd.stp and its generator scriptSamuel Cabrero2022-03-252-23/+23
| | | | | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Mar 25 17:57:18 UTC 2022 on sn-devel-184
* lib/replace: Do not typedef int boolAndrew Bartlett2022-03-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | We need a genuine boolean type, as otherwise expressions like bool foo = (4 & 4); if (foo == true) { exit(1); } else { exit(2); } could evaluate differently on non-modern platforms, and that would be a real pain to debug. _Bool and bool are in C99 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15028 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Mar 23 12:31:47 UTC 2022 on sn-devel-184
* vfs: Convert get_real_filename() to NTSTATUSVolker Lendecke2022-03-102-10/+11
| | | | | | | | | This makes it possible to more easily handle STOPPED_ON_SYMLINK vs OBJECT_PATH_NOT_FOUND vs OBJECT_NAME_NOT_FOUND and so on. The next patch needs this to properly handle symlinks. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Add SMB_VFS_FSTATATVolker Lendecke2022-03-102-0/+23
| | | | | | | | Useful if you want to stat/fstat/lstat relative to a directory without doing chdir first. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Update winbindd.stp and its generator scriptSamuel Cabrero2022-03-062-22/+22
| | | | | Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* examples: Reformat shell scriptsAndreas Schneider2022-02-2215-218/+255
| | | | | | | | | | shfmt -f examples/ | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Feb 22 16:20:58 UTC 2022 on sn-devel-184
* s3:rpc_client: Pass remote name and socket to ↵Günther Deschner2021-12-021-2/+12
| | | | | | | | | | cli_rpc_pipe_open_noauth_transport() BUG: https://bugzilla.samba.org/show_bug.cgi?id=14767 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Guenther Deschner <gd@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3-winexe: Fix winexe core dump (use-after-free)Günther Deschner2021-11-051-4/+12
| | | | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14893 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Fri Nov 5 11:43:57 UTC 2021 on sn-devel-184
* vfs: Add flags and xferlen args to SMB_VFS_OFFLOAD_READ_RECVRalph Boehme2021-10-082-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We missed these values which follow from MS-FSCC 2.3.80 “FSCTL_OFFLOAD_READ Reply”: Flags (4 bytes): A 32-bit unsigned integer that indicates which flags were returned for this operation. Possible values for the flags follow. All unused bits are reserved for future use, SHOULD be set to 0, and MUST be ignored. OFFLOAD_READ_FLAG_ALL_ZERO_BEYOND_CURRENT_RANGE (0x00000001) => The data beyond the current range is logically equivalent to zero. TransferLength (8 bytes): A 64-bit unsigned integer that contains the amount, in bytes, of data that the Token logically represents. This value indicates a contiguous region of the file from the beginning of the requested offset in the FileOffset field in the FSCTL_OFFLOAD_READ_INPUT data element (section 2.3.79). This value can be smaller than the CopyLength field specified in the FSCTL_OFFLOAD_READ_INPUT data element, which indicates that less data was logically represented (logically read) with the Token than was requested. The value of this field MUST be greater than 0x0000000000000000 and MUST be aligned to a logical sector boundary on the volume. As we currently only implement COPY_CHUNK over the OFFLOAD VFS interface, the VFS COPY_CHUNK backend in vfs_default just sets both values to 0 and they are unused in the SMB frontend. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples/VFS/skel_opaque: Rename kernel_flock to filesystem_sharemodeChristof Schmitt2021-09-211-4/+5
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples/VFS/skel_transparent: Rename kernel_flock to filesystem_sharemodeChristof Schmitt2021-09-211-4/+5
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* VFS: Rename kernel_flock to filesystem_sharemodeChristof Schmitt2021-09-212-3/+6
| | | | | | | | | With the removal of the call to flock LOCK_MAND, the only remaining use of this VFS path is to register sharemodes with specific file systems. Rename the VFS call to reflect that this is no longer related to flock. Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: RIP SMB_VFS_GETXATTR()Jeremy Allison2021-07-042-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | .--. .-, .-..-.__ .'(`.-` \_.-'-./` |\_( "\__ __.>\ '; _;---,._| / __/`'--) /.--. : |/' _.--.<| / | | _..-' `\ /' /` /_/ _/_/ >_.-``-. `Y /' _;---.`|/)))) '` .-''. \|: .' __, .-'"` .'--._ `-: \/: /' '.\ _|_ /.'`\ :; /' `- `-|-` -` | | | :.; : | .-'~^~`-. |: | .' _ _ `. |:. | | |_) | |_) | :. : | | | \ | | | : ; | | | : ; | | SMB_VFS | : ; | | GETXATTR | : ; | | | .jgs. : ; | | -."-/\\\/:::. `\."-._'."-"_\\-| |///."- " -."-.\\"-."//.-".`-."_\\-.".-\\`=.........=`//-". Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* VFS: Remove SMB_VFS_CHFLAGS, not used anymoreNoel Power2021-06-292-17/+0
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* VFS: Add initial implemenataion for SMB_VFS_FCHFLAGSNoel Power2021-06-292-0/+17
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
* winexe: Some code cleanup and fixesAndreas Schneider2021-06-201-3/+3
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* winexe: Use the new cmdline option parserAndreas Schneider2021-06-202-109/+36
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14616 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3: VFS: RIP SMB_VFS_SYS_ACL_BLOB_GET_FILE()Jeremy Allison2021-06-092-22/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (\ _ /) ( \ O / ) (// \\) X / \ /___\ _____/ \\_____ | + || | || | SMB_VFS_SYS_ACL || | BLOB_GET_FILE() || | || | || | || | _ ___ _ || | | \ | | \ || | | | | | | || | |_/ | |_/ || | | \ | | || | | \ | | || | | \. _|_. | . || | || * * | * ** * ** |** ** \)),.,\(/.,(//,,..,,\||(,,.,\\,.((// Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: RIP SMB_VFS_SYS_ACL_GET_FILE()Jeremy Allison2021-06-092-19/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (\ _ /) ( \ O / ) (// \\) X / \ /___\ _____/ \\_____ | + || | || | SMB_VFS_SYS_ || | ACL_GET_FILE() || | || | || | || | _ ___ _ || | | \ | | \ || | | | | | | || | |_/ | |_/ || | | \ | | || | | \ | | || | | \. _|_. | . || | || * * | * ** * ** |** ** \)),.,\(/.,(//,,..,,\||(,,.,\\,.((// Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* vfs: RIP SMB_VFS_GET_NT_ACL_AT()Jeremy Allison2021-06-092-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | .--. .-, .-..-.__ .'(`.-` \_.-'-./` |\_( "\__ __.>\ '; _;---,._| / __/`'--) /.--. : |/' _.--.<| / | | _..-' `\ /' /` /_/ _/_/ >_.-``-. `Y /' _;---.`|/)))) '` .-''. \|: .' __, .-'"` .'--._ `-: \/: /' '.\ _|_ /.'`\ :; /' `- `-|-` -` | | | :.; : | .-'~^~`-. |: | .' _ _ `. |:. | | |_) | |_) | :. : | | | \ | | | : ; | | | : ; | | SMB_VFS | : ; | | GET_NT_ | : ; | | ACL_AT | .jgs. : ; | | -."-/\\\/:::. `\."-._'."-"_\\-| |///."- " -."-.\\"-."//.-".`-."_\\-.".-\\`=.........=`//-". Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>