summaryrefslogtreecommitdiff
path: root/source4/scripting/devel
AgeCommit message (Collapse)AuthorFilesLines
2023-11-16s4-scripting: Remove repl_cleartext_pwd.pyAndrew Bartlett1-413/+0
This script was the precursor to newer samba-tool commands and no longer works. The previous commits record some of the work to have it operate in the modern era, but keeping this around is more trouble than it is worth. Use these commands instead: samba-tool drs clone-dc-database --include-secrets samba-tool user getpassword administrator --attributes=virtualClearTextUTF8 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Nov 16 02:46:57 UTC 2023 on atb-devel-224
2023-11-16s4-scripting/devel: Fix str() vs bytes() issue in repl_cleartext_pwd.pyAndrew Bartlett1-3/+4
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-11-16s4-scripting/devel: Fix repl_cleartext_pwd to use built-in RC4Andrew Bartlett1-3/+3
This allows the usage test to pass on our CI hosts without python-crypto and not uxsuccess on hosts with it. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-08-14s4:scripting: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2022-07-08s4:scripting: Reformat shell scriptsAndreas Schneider7-54/+56
shfmt -f source4/scripting/ | xargs shfmt -w -p -i 0 -fn Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Pavel Filipenský <pfilipensky@samba.org>
2022-05-10python: Remove redundant assignmentsJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-05-10python: Remove unnecessary 'pass' statementsJoseph Sutton2-2/+0
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org>
2021-09-04python: Fix usage stringsJoseph Sutton2-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2021-04-28tests: Use ldbsearch '--scope instead of '-s'Andreas Schneider1-2/+2
We should use long options in tests to make clear what we are trying to do. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2021-04-28python: remove all 'from __future__ import print_function'Douglas Bagnall7-8/+0
This made Python 2's print behave like Python 3's print(). In some cases, where we had: from __future__ import print_function """Intended module documentation...""" this will have the side effect of making the intended module documentation work as the actual module documentation (i.e. becoming __doc__), because it is once again the first statement in the module. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-11-06Remove source4/scripting/devel/createtrust scriptIsaac Boukris1-125/+0
We now have the 'samba-tool domain trust' command. Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Isaac Boukris <iboukris@samba.org> Autobuild-Date(master): Fri Nov 6 11:25:02 UTC 2020 on sn-devel-184
2020-08-11python compat: remove text_typeDouglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2019-09-24pfm_verif: string concatenation efficiency cleanupBjörn Jacke1-3/+1
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2019-09-24scripting: avoid inefficient string redefinitionBjörn Jacke1-5/+4
Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Matthias Dieter Wallnöfer <mdw@samba.org>
2019-07-05s4/scripting/demodirsync: print usage if no host namedDouglas Bagnall1-0/+3
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-07-02s4/script/rodcdns: str type doesn't need decodingDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-12s4/scripting: Remove legacy selftest-vars.sh scriptTim Beale1-36/+0
This script was added in 2010 and has only been sporadically kept up-to-date since. It doesn't appear to work (I think that selftest and the testenvs have perhaps grown in complexity since 2010 and it's no longer possible to try to access a testenv from a different process-space, due to how we use the cwrap libraries). There's now an alternative (export_envvars_to_file()) in the selftest code to regenerate a similar file, if anyone actually needs it. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-12selftest: Remove unused SELFTEST_INTERFACESTim Beale1-1/+0
This doesn't appear to be used anywhere and dates back to 2008. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-03-12s4/scripting: MORE py3 compatible print functionsDouglas Bagnall3-11/+11
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2019-02-18selftest: Remove unused environment variablesTim Beale1-12/+0
We only really want generic environment variables. For 2+ DC environments, we have the $SERVER and $DC_SERVER (aka PDC) variables. However, lots of testenvs also export really specific environment variables, e.g. VAMPIRE_2000_DC_SERVER_IP (despite that testenv being only used for a single test case). Previously the <testenv>_SERVER variable was used for DRS tests, but we can avoid the need to do this now. The other variables are not used at all. The RODC and TRUST environment variables are still used by a few tests. SUBDOM_DC_SERVER is only used within Samba4.pm and not exported. Signed-off-by: Tim Beale <timbeale@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-12-14PY3: change shebang to python3 in source4/scripting dirJoe Guo12-12/+12
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-11-02s4/scripting/*: py3 compatible printDouglas Bagnall5-5/+5
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <noel.power@suse.com>
2018-11-01s4/scripting/pfm_verify: PY3: use compat.text_typeDouglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <noel.power@suse.com>
2018-10-25s4/scripting/demodirsync: fix syntax errorDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-10-25s4/scripting: py3 style 0o123 octal, not 0123Douglas Bagnall1-1/+1
this works with py2.6+ too. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-10-25s4/scripting/pfm_verify: remove duplicate importDouglas Bagnall1-1/+0
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2018-09-06PEP8: fix E122: continuation line missing indentation or outdentedJoe Guo1-2/+2
Signed-off-by: Joe Guo <joeg@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-08-24PEP8: fix E713: test for membership should be 'not in'Joe Guo2-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>
2018-08-24PEP8: fix E711: comparison to None should be 'if cond is not None:'Joe Guo2-3/+3
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>
2018-08-24PEP8: fix E703: statement ends with a semicolonJoe Guo1-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>
2018-08-24PEP8: fix E502: the backslash is redundant between bracketsJoe Guo1-5/+5
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>
2018-08-24PEP8: fix E305: expected 2 blank lines after class or function definition, ↵Joe Guo4-0/+4
found 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>
2018-08-24PEP8: fix E302: expected 2 blank lines, found 1Joe Guo4-0/+10
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>
2018-08-24PEP8: fix E265: block comment should start with '# 'Joe Guo1-8/+8
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>
2018-08-24PEP8: fix E231: missing whitespace after ','Joe Guo2-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>
2018-08-24PEP8: fix E226: missing whitespace around arithmetic operatorJoe Guo2-6/+6
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>
2018-08-24PEP8: fix E225: missing whitespace around operatorJoe Guo1-8/+8
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>
2018-08-24PEP8: fix E202: whitespace before ')'Joe Guo1-9/+9
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>
2018-08-24PEP8: fix E201: whitespace after '('Joe Guo1-9/+9
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>
2018-08-24PEP8: fix E127: continuation line over-indented for visual indentJoe Guo1-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>
2018-08-24PEP8: fix E111: indentation is not a multiple of fourJoe Guo2-31/+31
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>
2018-05-12s4/scripting/devel: py2/py3 compatability always decode result of b64encodeNoel Power2-7/+7
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-05-12devel: removing unused code from chgkrbtgtpassAaron Haslett1-4/+1
Signed-off-by: Aaron Haslett <aaronhaslett@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Sat May 12 12:05:31 CEST 2018 on sn-devel-144
2018-03-23s4/scripting: convert print func to be py2/py3 compatibleNoel Power4-51/+55
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-02-10getncchanges script: use library code, not copied functions.Douglas Bagnall1-75/+2
These functions were duplicates. To be exact, the diff -ub between what getncchanges had, and what drs_uitls now has is this: |@@ -1,4 +1,5 @@ |-def do_DsBind(drs): |+def drs_DsBind(drs): | '''make a DsBind call, returning the binding handle''' | bind_info = drsuapi.DsBindInfoCtr() | bind_info.length = 28 |@@ -32,7 +33,8 @@ | bind_info.info.supported_extensions |= drsuapi.DRSUAPI_SUPPORTED_EXTENSION_GETCHGREPLY_V7 | bind_info.info.supported_extensions |= drsuapi.DRSUAPI_SUPPORTED_EXTENSION_VERIFY_OBJECT | (info, handle) = drs.DsBind(misc.GUID(drsuapi.DRSUAPI_DS_BIND_GUID), bind_info) |- return handle |+ |+ return (handle, info.info.supported_extensions) | | | def drs_get_rodc_partial_attribute_set(samdb): |@@ -43,7 +45,7 @@ | attids = [] | | # the exact list of attids we send is quite critical. Note that |- # we do ask for the secret attributes, but set set SPECIAL_SECRET_PROCESSING |+ # we do ask for the secret attributes, but set SPECIAL_SECRET_PROCESSING | # to zero them out | schema_dn = samdb.get_schema_basedn() | res = samdb.search(base=schema_dn, scope=ldb.SCOPE_SUBTREE, |@@ -71,3 +73,4 @@ | partial_attribute_set.attids = attids | partial_attribute_set.num_attids = len(attids) | return partial_attribute_set while the drs_utils code has changed in moving drs_get_rodc_partial_attribute_set() out of the class. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-01-22param: Remove winbindd privileged socket directory optionAndrew Bartlett1-1/+0
This option is unused and has not been used since before Samba 4.3 when the source4/ winbindd code went away. The associated dynconfig parameters used for the default are also removed. BUG: https://bugzilla.samba.org/show_bug.cgi?id=10066 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2016-02-03s4:scripting/devel: make use of the generic arcfour_encrypt() and ↵Stefan Metzmacher1-15/+3
string_to_byte_array() functions BUG: https://bugzilla.samba.org/show_bug.cgi?id=11699 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-03-16selftest: rename env dc to ad_dc_ntvfsMichael Adam1-6/+6
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-02-25s4/scripting/devel: Add tool to roll over the krbtgt passwordAndrew Bartlett1-0/+63
This may be handy if this key is compromised, or along with chgtdcpass to isolate test copies of production domains in such a way that they cannot mix. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2014-11-22speedtest: Use samba.tests.subunitrun.Jelmer Vernooij1-14/+4
Change-Id: Id842c3f74aec24faeab68e975ff4d9e9a0dc337b Signed-off-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>