summaryrefslogtreecommitdiff
path: root/examples
Commit message (Collapse)AuthorAgeFilesLines
* winexe: Add support for connecting to a host on an alternate portKarl Lenz2019-07-051-3/+23
| | | | | | | | | | | | | | | | | | This commit allows an optional port number to be specified after the hostname on the winexe command line. If no port is given, it defaults to port 445, just like it used before. Although this is probably a pretty uncommon use-case, it allows port-forwarding the service through a firewall to an alternate port, which can occassionally be helpful. $ ./bin/winexe -U karl%password1 //127.0.0.1:5445 cmd.exe Microsoft Windows [Version 6.1.7601] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Windows\system32> Signed-off-by: Karl Lenz <xorangekiller@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* winexe: Fix translation of the winexesvc binaries to CKarl Lenz2019-07-051-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Two small Windows binaries that winexe uses to execute commands on a remote system, winexesvc32.exe and winexesvc64.exe, are compiled then translated into a C byte array as hex so that they can be embedded into the winexe binary. Although the winexesvc binaries were built properly, the Python method that does the translation to C tried to open them in text mode, which would have worked in Python 2 before the concept of bytearrays was introduced, but instead raises an exception in Python 3. The exception was unfortunately suppressed, so the build didn't stop, and the winexe binary that was produced was effectively useless because it didn't contain either winexesvc binary as expected. After winexe successfully authenticated with a Windows host, it showed the error message below rather than executing the given command on the remote system. $ ./bin/winexe -U karl%password1 -d 2 //192.168.56.3 cmd winexe_svc_install: dcerpc_svcctl_StartServiceW failed: WERR_BAD_EXE_FORMAT main: winexe_svc_install failed: NT_STATUS_BAD_INITIAL_PC This commit fixes that problem by opening the winexesvc binaries in binary mode rather than text mode when the winexe build script reads them to translate them to C. Furthermore it adds an additional sanity check that will cause the winexesvc binary generator commands to fail if the winexesvc binaries cannot be opened or read correctly to guarantee that the build does not silently "succeed" if something like this ever happens again. Signed-off-by: Karl Lenz <xorangekiller@gmail.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* vfs: Remove unused "msg_ctx" from SMB_VFS_BRL_UNLOCK_WINDOWSVolker Lendecke2019-07-022-3/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Remove "blocking_lock" from SMB_VFS_BRL_LOCK_WINDOWSVolker Lendecke2019-07-022-6/+3
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* s3:vfs: add SMB_VFS_FS_FILE_ID()Ralph Boehme2019-07-012-0/+15
| | | | | | | Not yet used, that comes next. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* vfs: Remove SMB_VFS_BRL_CANCEL_WINDOWSVolker Lendecke2019-06-202-17/+0
| | | | | | | | | | | This is not called anymore, bump the VFS version number in a separate commit 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): Thu Jun 20 18:34:20 UTC 2019 on sn-devel-184
* winexe: Use C99 initializer for poptOption in winexe.cStefan Metzmacher2019-05-281-34/+115
| | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* libsmb: add in/out cblobs to cli_smb2_create_fnumVolker Lendecke2019-03-011-4/+6
| | | | | | | | This is driven by the imminent smb2 unix extensions, we'll want to make use of it from source3/libsmb. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* libsmb: Reformat the cli_smb2_create_fnum_send argsVolker Lendecke2019-03-011-8/+19
| | | | | | | We'll add parameters in the next commit, make that commit a bit more obvious Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: Use C99 initializer for poptOption in testaclAndreas Schneider2019-01-281-26/+74
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* examples: Reformat testacl libsmbclient exampleAndreas Schneider2019-01-281-270/+270
| | | | | Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3:smbd: pass (raw) ev to SMB_VFS_GET_DOS_ATTRIBUTES_SEND() instead of ↵Ralph Boehme2019-01-112-5/+3
| | | | | | | | | | | smb_vfs_ev_glue This also removes smb_vfs_ev_glue_[push|pop]_use() as the only caller got removed. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3:smbd: let SMB_VFS_GETXATTRAT_SEND() do explicit impersonationRalph Boehme2019-01-112-5/+3
| | | | | | | | | | SMB_VFS_GETXATTRAT_SEND() gets passed a raw event context and the default implementation uses that as well a raw threadpool. Impersonation is done explicitly instead of by the tevent and pthreadpool wrappers. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* PY3: change shebang to python3 in misc dirsJoe Guo2018-12-141-1/+1
| | | | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Fri Dec 14 18:00:40 CET 2018 on sn-devel-144
* Change order of flags in Makefile so that crackcheck builds under UbuntuBrian Candler2018-12-141-1/+1
| | | | | | | | | Signed-off-by: Brian Candler <b.candler@pobox.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Dec 14 04:13:38 CET 2018 on sn-devel-144
* Add #include <unistd.h> to provide prototype for getopt()Brian Candler2018-12-141-0/+1
| | | | | | | Signed-off-by: Brian Candler <b.candler@pobox.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3:libsmb: pass impersonation_level to cli_ntcreate_send()Stefan Metzmacher2018-12-131-0/+3
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Tim Beale <timbeale@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* s3:libsmb: pass impersonation_level to cli_smb2_create_fnum_send()Stefan Metzmacher2018-12-131-2/+4
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=7113 BUG: https://bugzilla.samba.org/show_bug.cgi?id=11892 BUG: https://bugzilla.samba.org/show_bug.cgi?id=13676 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Tim Beale <timbeale@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* PY3: fix "TabError: inconsistent use of tabs and spaces"Noel Power2018-09-271-10/+10
| | | | | Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* examples: Fix the smb2mount buildVolker Lendecke2018-09-072-2/+2
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13465 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* examples: Fix mingw64 detectionVolker Lendecke2018-09-051-0/+2
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* examples: Add winexe re-implemented on current Samba libsVolker Lendecke2018-08-286-0/+2788
| | | | | | | | | | | | | | | | | | | | | | | | | | | winexe from https://sourceforge.net/projects/winexe/ is a project based on Samba libraries from 2012. According to the winexe git repository the last Samba commit winexe was updated to is 47bbf9886f0c from November 6, 2012. As winexe uses unpublished Samba internal libraries, it broke over time. This is a port of the winexe functionality to more modern Samba versions. It still uses internal APIs, but it being part of the tree means that it is much easier to keep up to date. The Windows service files were taken literally from the original winexe from the sourceforge git. Andrzej Hajda chose GPLv3 only and not GPLv3+. As GPL evolves very slowly, this should not be a practical problem for quite some time. To build it under Linux, you need mingw binaries on your build system. Under Debian stretch, the package names are gcc-mingw-w64 and friends. 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 28 02:03:07 CEST 2018 on sn-devel-144
* PEP8: fix W291: trailing whitespaceJoe Guo2018-08-241-2/+2
| | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* PEP8: fix E401: multiple imports on one lineJoe Guo2018-08-241-1/+4
| | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* PEP8: fix E303: too many blank lines (2)Joe Guo2018-08-241-1/+0
| | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* PEP8: fix E261: at least two spaces before inline commentJoe Guo2018-08-241-1/+1
| | | | | | Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
* s3: vfs: add SMB_VFS_GET_DOS_ATTRIBUTES_SEND/RECVRalph Boehme2018-07-272-0/+130
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: vfs: add SMB_VFS_GETXATTRAT_SEND/RECVRalph Boehme2018-07-272-0/+145
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* examples/VFS/skel_transparent: make vfs_fn_pointers staticStefan Metzmacher2018-07-251-1/+1
| | | | | | | | Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed Jul 25 20:44:12 CEST 2018 on sn-devel-144
* examples/VFS/skel_opaque: make vfs_fn_pointers staticRalph Boehme2018-07-251-1/+1
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* examples/VFS/skel_opaque: fix a likely a copy/paste errorRalph Boehme2018-07-251-1/+0
| | | | | | | This line was probably copied over from skel_transparent.c, remove it. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* examples/VFS/skel_transparent: call smb_vfs_assert_all_fns()Stefan Metzmacher2018-07-251-0/+8
| | | | | | | This template should always include all calls. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* examples/VFS/skel_transparent: add missing durable handle functionsRalph Boehme2018-07-251-0/+46
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* examples/VFS/skel_transparent: add missing audit_file_fnRalph Boehme2018-07-251-0/+14
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* examples/VFS/skel_opaque: call smb_vfs_assert_all_fns()Stefan Metzmacher2018-07-251-0/+7
| | | | | | | This template should always implement all calls. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* examples/VFS/skel_opaque: add missing durable handle functionsRalph Boehme2018-07-251-0/+33
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* examples/VFS/skel_opaque: add missing audit_file_fnRalph Boehme2018-07-251-0/+10
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* s3: VFS: Remove SMB_VFS_FCHMOD_ACL().Jeremy Allison2018-05-252-17/+0
| | | | | | | No longer used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3: VFS: Remove SMB_VFS_CHMOD_ACL().Jeremy Allison2018-05-252-17/+0
| | | | | | | No longer used. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
* Fix typo for responseJoe Guo2018-05-121-1/+1
| | | | | | | | reponse --> response Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
* s3: client: Add btime_ts to struct finfo.Jeremy Allison2018-05-051-0/+1
| | | | | | | | | | Fill it in when available, else return it as zero. Based on a patch from Puran Chand <pchand@vmware.com>. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
* s3: VFS: Remove SMB_VFS_WRITE() function and all implementations.Jeremy Allison2018-05-052-15/+0
| | | | | | | | | | All code in Samba now uses SMB_VFS_PWRITE or SMB_VFS_PWRITE_SEND. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Sat May 5 01:38:07 CEST 2018 on sn-devel-144
* s3: VFS: Remove SMB_VFS_READ() function and all implementations.Jeremy Allison2018-05-042-15/+0
| | | | | | | All code in Samba now uses SMB_VFS_PREAD or SMB_VFS_PREAD_SEND. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* s3: VFS: Remove fsync_fn() from the VFS and all modules. VFS ABI change.Jeremy Allison2018-05-022-13/+0
| | | | | | | | Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed May 2 01:06:28 CEST 2018 on sn-devel-144
* Samba-VirusFilter: common headers and sources.Trever L. Adams2018-01-241-0/+284
| | | | | | | | | | | | | | | | | | | | | | Samba-VirusFilter Contributors: SATOH Fumiyasu @ OSS Technology Corp., Japan Module creator/maintainer Luke Dixon luke.dixon@zynstra.com Samba 4 support Trever L. Adams Documentation Code contributions Samba-master merge work With many thanks to the Samba Team. Signed-off-by: Trever L. Adams <trever.adams@gmail.com> Signed-off-by: SATOH Fumiyasu <fumiyas@osstech.co.jp> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* examples/scripts: remove unused shares directoryStefan Metzmacher2017-12-136-1228/+0
| | | | | | | | | | These scripts are not that useful anymore, as they rely on parameters to be defined in loadparm.c It's confusing to get 'git grep' matches for parameters there... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* VFS examples: remove init_search_opsUri Simchoni2017-11-112-12/+0
| | | | | Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* Removed unused 'oplock contention limit' config parameterChristof Schmitt2017-10-191-1/+0
| | | | | Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* examples: add cache effectiveness stats to gencache.stpRalph Boehme2017-08-111-0/+23
| | | | | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Fri Aug 11 14:19:24 CEST 2017 on sn-devel-144
* examples: add winbindd.stp and a shell script to generate itRalph Boehme2017-07-192-0/+3168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Usage: Instrument all winbindd processes: # stap winbindd.stp Instrument a specific winbindd process: # stap -x PID winbindd.stp Example output: # stap winbindd.stp Collecting data, press ctrl-C to stop... ^C Winbind request service time ============================ winbindd_getpwnam_send count: 99, sum: 6229 ms (min: 2669 us, avg: 62921 us, max: 157907 us) Winbind request runtime ======================= winbindd_getpwnam_send count: 99, sum: 3 ms (min: 21 us, avg: 36 us, max: 77 us) Winbind domain-child request service time ========================================= _wbint_LookupName count: 99, sum: 1403 ms (min: 619 us, avg: 14181 us, max: 136613 us) _wbint_GetNssInfo count: 99, sum: 0 ms (min: 2 us, avg: 3 us, max: 6 us) _wbint_LookupSid count: 102, sum: 49 ms (min: 13 us, avg: 481 us, max: 6315 us) _wbint_Sids2UnixIDs count: 101, sum: 2 ms (min: 18 us, avg: 29 us, max: 49 us) _wbint_LookupSids count: 101, sum: 84 ms (min: 411 us, avg: 838 us, max: 3524 us) Winbind domain-child AD-backend service time ============================================ sid_to_name count: 56, sum: 45 ms (min: 431 us, avg: 816 us, max: 6275 us) sequence_number count: 12, sum: 1209 ms (min: 46618 us, avg: 100803 us, max: 131439 us) name_to_sid count: 99, sum: 176 ms (min: 547 us, avg: 1781 us, max: 9866 us) ... Regenerate winbindd.stp: $ examples/systemtap/generate-winbindd.stp.sh Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Jul 19 16:20:56 CEST 2017 on sn-devel-144