summaryrefslogtreecommitdiff
path: root/source4/utils
AgeCommit message (Collapse)AuthorFilesLines
2023-11-30s4:utils: Use correct enumeration constantJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-30s4:utils: Remove trailing whitespaceJoseph Sutton1-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-08-22s4:utils: Fix shellcheck errors in test_samba_tool.shAndreas Schneider1-1/+1
source4/utils/tests/test_samba_tool.sh:38:110: 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>
2022-07-08s4:utils: Reformat shell scriptsAndreas Schneider3-7/+10
shfmt -f source4/utils/ | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org> Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org> Autobuild-Date(master): Fri Jul 8 09:59:19 UTC 2022 on sn-devel-184
2021-06-20s4:utils: Migrate oLschema2ldif to new cmdline option parserAndreas Schneider2-21/+27
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-06-16testprogs: Use new kerberos options for smbclient(4) testsAndreas Schneider1-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-08-28lib/util: remove extra safe_string.h fileMatthew DeVore1-0/+2
lib/util/safe_string.h is similar to source3/include/safe_string.h, but the former has fewer checks. It is missing bcopy, strcasecmp, and strncasecmp. Add the missing elements to lib/util/safe_string.h remove the other safe_string.h which is in the source3-specific path. To accomodate existing uses of str(n?)casecmp, add #undef lines to source files where they are used. Signed-off-by: Matthew DeVore <matvore@google.com> Reviewed-by: David Mulder <dmulder@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Aug 28 02:18:40 UTC 2020 on sn-devel-184
2020-05-08Fix clang 9 missing-field-initializer warningsGary Lockyer1-1/+1
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-04-03s4/selftest: Adjust samba4.blackbox.samba_tool to use (s3) smbclientNoel Power1-2/+2
(s4) smbclient doesn't negotiate smb2, (s3) smbclient is what is used and what we really should be testing. Additionally remove entry from ski_smb1_fails file Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Ralph Boehme <slow@samba.org>
2019-12-18source4/utils/oLschema2ldif: include stdint.h before cmocka.hFabrice Fontaine1-0/+1
This fix the following build failure: In file included from /home/fabrice/buildroot/output/host/opt/ext-toolchain/lib/gcc/mips64el-buildroot-linux-uclibc/5.5.0/include/stdint.h:9:0, from /home/fabrice/buildroot/output/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/inttypes.h:27, from ../../lib/replace/../replace/replace.h:64, from ../../source4/include/includes.h:23, from ../../source4/utils/oLschema2ldif/test.c:25: /home/fabrice/buildroot/output/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/stdint.h:122:27: error: conflicting types for ‘uintptr_t’ typedef unsigned long int uintptr_t; ^ In file included from ../../source4/utils/oLschema2ldif/test.c:23:0: /home/fabrice/buildroot/output/host/mips64el-buildroot-linux-uclibc/sysroot/usr/include/cmocka.h:132:28: note: previous declaration of ‘uintptr_t’ was here typedef unsigned int uintptr_t; Fixes: - http://autobuild.buildroot.org/results/9507739b3d5d51024ee9c60b74c2f85d5004e7e2 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14218 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Dec 18 16:57:52 UTC 2019 on sn-devel-184
2019-11-19utils: only compile test_oLschema2ldif if fmemopen existsRobert Scott1-0/+1
in the vein of da87fa998ab71328f30bcdf5b41aee8675aee48a Signed-off-by: Robert Scott <code@humanleg.org.uk> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Nov 19 06:12:29 UTC 2019 on sn-devel-184
2019-08-22s4: free popt context in utilsSwen Schillig1-0/+2
If done with popt context it should be free'd. Signed-off-by: Swen Schillig <swen@linux.ibm.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Böhme <slow@samba.org>
2019-04-30s4:utils: Use gnutls SHA256 in oLschema2ldifAndreas Schneider1-6/+12
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-04-03oLschema2ldif: Resolve multiple parsing bugsMichael Hanselmann3-1/+235
The "oLschema2ldif" program contained multiple bugs triggered by malformed inputs: * Iteration beyond list of recognized dsdb syntax OIDs when value wasn't found (bug 9567) * NULL pointer dereference when input didn't define a name * Heap buffer overflows for unterminated token values Tests are added to reproduce all identified bugs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=9567 Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Then adapted to use ARRAY_SIZE() consistently as suggested by metze. Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Apr 3 02:43:07 UTC 2019 on sn-devel-144
2019-03-26Remove ad2oLschema man pageMichael Hanselmann1-87/+0
ad2oLschema itself was removed in commit 17aac8cad2b in March 2009. Also remove the last reference to the program. Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-26Split oLschema2ldif into library and binaryMichael Hanselmann6-128/+205
The oLschema2ldif program was contained in a single file, making reuse of its parsing logic elsewhere impossible. With this change the majority of the code is moved to a new file, "lib.c", while the CLI interface is now in a "main.c" file. End-of-line whitespace is also removed. Signed-off-by: Michael Hanselmann <public@hansmi.ch> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-10s4/utils/test: PY3 make sure we call correct python version for samba-toolNoel Power1-4/+4
fixes samba4.blackbox.samba_tool blackbox test Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-06-07tests/demote: replace demote test bash script to pythonJoe Guo1-38/+0
Convert bash script to python and add demote and dns remove test on top. Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Thu Jun 7 04:21:17 CEST 2018 on sn-devel-144
2018-03-20s4:utils: Fix size typesAndreas Schneider1-1/+1
This fixes compilation with -Wstrict-overflow=2 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-12-09man pages: change http://samba.org to https://www.samba.orgBjörn Jacke2-3/+3
Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Karolin Seeger <kseeger@samba.org>
2016-11-29ntlm_auth4: Remove itVolker Lendecke3-1459/+0
This had install=False for rather exactly 4 years now. If someone wants to start working on it again, we can always dig it up from the git history. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Nov 29 02:18:37 CET 2016 on sn-devel-144
2016-11-20lib: Remove global xfile.h includesVolker Lendecke1-0/+1
This makes it more obvious where this legacy code is used 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): Sun Nov 20 06:23:19 CET 2016 on sn-devel-144
2016-05-04lib: Give base64.c its own .hVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2016-05-04lib: Make callers of base64_encode_data_blob check for successVolker Lendecke1-0/+2
Quite a few callers already did check for !=NULL. With the current code this is pointless due to a SMB_ASSERT in base64_encode_data_blob() itself. Make the callers consistently check, so that we can remove SMB_ASSERT from base64.c. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2016-03-11Added MSV1_0_ALLOW_MSVCHAPV2 flag to ntlm_authHerwin Weststrate1-0/+8
An implementation of https://lists.samba.org/archive/samba/2012-March/166497.html (which has been discussed in 2012, but was never implemented). It has been tested on a Debian Jessie system with this patch added to the Debian package (which is currently 4.1.17). Even though this is Samba 4, the ntlm_auth installed is the one from Samba 3 (yes, it surprised me too). The backend was a machine with Windows 2012R2. It was first tested with the local security policy 'Network Security: LAN Manager authentication level' setting changed to 'Send NTLMv2 Response Only' (allow ntlm v1). This way we are able to authenticate with and without the MSV1_0_ALLOW_MSVCHAPV2 flag (as expected). After the basic step has been verified, the local security policy 'Network Security: LAN Manager authentication level' setting was changed to 'Send NTLMv2 Response Only. Refuse LM & NTLM' (only allow ntlm v2). The behaviour now changed according to the MSV1_0_ALLOW_MSVCHAPV2 flag (again: as expected). $ ntlm_auth --request-nt-key --username=XXXXXXXXXXXXX --challenge=XXXXXXXXXXXXXXXXX --nt-response=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --domain= Logon failure (0xc000006d) $ ntlm_auth --request-nt-key --username=XXXXXXXXXXXXX --challenge=XXXXXXXXXXXXXXXXX --nt-response=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX --domain= --allow-mschapv2 NT_KEY: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX The changes in `wbclient.h` are intended for programs that use libwinbind directly instead of authenticating via `ntlm_auth`. I intend to use that within FreeRADIUS (see https://bugzilla.samba.org/show_bug.cgi?id=11149). BUG: https://bugzilla.samba.org/show_bug.cgi?id=11694 Signed-off-by: Herwin Weststrate <herwin@quarantainenet.nl> Reviewed-by: Kai Blin <kai@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-11-06Fix various spelling errorsMathieu Parent1-1/+1
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Nov 6 13:43:45 CET 2015 on sn-devel-104
2015-05-13ntlm_auth: Remove two uses of hex_encode()Volker Lendecke1-10/+8
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-14Typo: s/preceeded/preceded/Jelmer Vernooij1-1/+1
Caught by lintian, the Debian package linter :) Change-Id: Ia7162ea8c2b1845155345526b66d71ae64f15227 Reviewed-on: https://gerrit.samba.org/216 Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Mon Apr 14 03:51:15 CEST 2014 on sn-devel-104
2014-03-27s4:ntlm_auth: make use of gensec_update_ev()Stefan Metzmacher1-1/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-11-11oLschema2ldif: Add some NULL checksVolker Lendecke1-0/+6
This should fix Coverity ID 1034812 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ira Cooper <ira@samba.org>
2013-09-10ldb: Do not build libldb-cmdline when using system ldb.Jeroen Dekkers2-2/+1
Cleanup leftover include and linking of libldb-cmdline in oLschema2ldif. Do not build libldb-cmdline anymore when using the system ldb, oLschema2ldif was the only reason for building libldb-cmdline. Signed-off-by: Jeroen Dekkers <jeroen@dekkers.ch> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Sep 10 12:52:26 CEST 2013 on sn-devel-104
2013-08-10auth/gensec: introduce gensec_internal.hStefan Metzmacher1-0/+1
We should treat most gensec related structures private. It's a long way, but this is a start. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-05s4:ntlm_auth: make use of cli_credentials_[set_]callback_data*Stefan Metzmacher1-4/+6
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-12-03ntlm_auth4: Use new samba_getpass() function.Andreas Schneider1-1/+7
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2012-11-29docs: man oLschema2ldif: Add missing meta data.Karolin Seeger1-0/+3
This avoids warnings during the waf build and removes "FIXME" entries from the manpage. Karolin Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Nov 29 15:27:45 CET 2012 on sn-devel-104
2012-11-29docs: man ntlm_auth4: Add missing meta data.Karolin Seeger1-0/+3
This avoids warnings during the waf build and removes "FIXME" entries from the manpage. Karolin Reviewed-by: Andreas Schneider <asn@samba.org>
2012-11-28docs: Rename man ntlm_auth.Karolin Seeger2-38/+38
Rename man ntlm_auth to ntlm_auth4. Karolin Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Nov 28 20:41:48 CET 2012 on sn-devel-104
2012-11-22build: Use ntlm_auth from source3 as the only ntlm_auth installed on the systemAndrew Bartlett1-6/+8
The ntlm_auth4 binary is untested, and is missing major features compared with the source3 binary. The two are being slowly merged, but I have not finished that. Andrew Bartlett Reviewed-by: Andreas Schneider <asn@samba.org>
2012-08-28selftest: Add test of smbclient --machine-pass against and using both s3 and s4Andrew Bartlett1-0/+34
This uses both smbclient binaries to ensure that both work in both environments. Andrew Bartlett
2012-05-31s4:selftest: change the blackbox.samba_tool_demote test to use a binary ↵Michael Adam1-2/+2
mapping for smbclient
2012-05-31s4:selftest: change the blackbox.samba_tool test to use a binary mapping for ↵Michael Adam1-2/+2
smbclient
2012-05-31s4:selftest: determine nmblookup via binary mapping for blackbox test in ↵Michael Adam1-4/+2
tests.py
2012-05-05olschema2ldif: be more strict where checking for open/closed bracesMatthieu Patou1-3/+15
2012-02-17s4:samba-tool fsmo * - fix missing "takes_optiongroups"Matthias Dieter Wallnöfer1-0/+2
This has been reported in bug #8755. Reviewed-by: Jelmer
2012-02-01selftest: Remove unused support for --exeextAndrew Bartlett3-5/+5
2011-12-05s4: add blackbox test for the demote functionMatthieu Patou1-0/+38
2011-11-27s4:selftest/test_samba_tool.sh - add a basic unit test for the new "domain ↵Matthias Dieter Wallnöfer1-5/+8
info" command Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-18gensec: move event context from gensec_*_init() to gensec_update()Andrew Bartlett1-3/+3
This avoids keeping the event context around on a the gensec_security context structure long term. In the Samba3 server, the event context we either supply is a NULL pointer as no server-side modules currently use the event context. Andrew Bartlett Signed-off-by: Stefan Metzmacher <metze@samba.org>
2011-10-13s4-messaging: Pass the loadparm context, not just the messaging pathAndrew Bartlett1-1/+1
This will allow the TDB layer to get at the lp_ctx for tdb options. Andrew Bartlett
2011-08-03gensec: clarify memory ownership for gensec_session_info() and ↵Andrew Bartlett1-3/+3
gensec_session_key() This is slightly less efficient, because we no longer keep a cache on the gensec structures, but much clearer in terms of memory ownership. Both gensec_session_info() and gensec_session_key() now take a mem_ctx and put the result only on that context. Some duplication of memory in the callers (who were rightly uncertain about who was the rightful owner of the returned memory) has been removed to compensate for the internal copy. Andrew Bartlett