summaryrefslogtreecommitdiff
path: root/python/samba/netcmd
AgeCommit message (Collapse)AuthorFilesLines
2016-04-18rodc: Allow RODC preload to continue with invalid usersGarming Sam1-3/+35
Either the user may be missing from the database, or the user is not included in the RODC password replication group. Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2016-04-01Bug 11818 : obvious missing word When trying to demote a dc, ↵Rowland Penny1-1/+1
'remove_dc.remove_sysvol_references' is sent 'remote_samdb, dc_name' , it expects 'remote_samdb, logger, dc_name' BUG: https://bugzilla.samba.org/show_bug.cgi?id=11818 Signed-off-by: Rowland Penny <rpenny@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Fri Apr 1 22:54:22 CEST 2016 on sn-devel-144
2016-02-25samba-tool: Support preloading multiple usersAndrew Bartlett1-22/+37
Based on patches by Adrian Cochrane Signed-off-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): Thu Feb 25 07:58:55 CET 2016 on sn-devel-144
2016-02-25python: Allow optional multi-value arguements for samba-tool commandsAndrew Bartlett1-2/+3
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2016-02-03python:samba/netcmd/domain: make use of the generic arcfour_encrypt() and ↵Stefan Metzmacher1-18/+5
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-12-24samba-tool: add sites subnet subcommandsDouglas Bagnall1-2/+119
This allows you to add, remove, or shift subnets. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-12-24samba-tool sites: use -H to set URL with standard handlingDouglas Bagnall1-14/+19
samba-tool sites was defaulting to the local database, but we might want to use another URL. This allows that case while defaulting to the old behaviour. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-12-24sambatool sites: PEP8/flake8 improvementsDouglas Bagnall1-4/+5
We were nearly there, so lets make the jump. This involves removing some unused variables. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-12-24s4:samba-tool domain raise tool - make it aware of newer domain function levelsMatthias Dieter Wallnöfer1-8/+31
http://msdn.microsoft.com/en-us/library/Cc223742.aspx Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Matthias Dieter Wallnöfer <mdw@samba.org> Autobuild-Date(master): Thu Dec 24 04:08:04 CET 2015 on sn-devel-144
2015-12-24s4:samba-tool domain raise tool - handle Windows 2000 mode AD domains correctlyMatthias Dieter Wallnöfer1-16/+23
Considering http://msdn.microsoft.com/en-us/library/cc220262.aspx they do not provide any "msDS-Behavior-Version" attributes. gulikoza <gulikoza@users.sourceforge.net> noticed this correctly. Signed-off-by: Matthias Dieter Wallnöfer <mdw@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-12-07samba-tool: user create examples show 'add' instead of 'create'Rowland Penny1-4/+4
Signed-off-by: Rowland Penny <repenny241155@gmail.com> Reviewed-by: Michael Adam <obnox@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-12-06samba-tool: fsmo.py throws an uncaught exception if noRowland Penny1-1/+2
fSMORoleOwner attribute This will fix bug 11613 where a user got the uncaught exception when trying to seize an FSMO role that didn't have the required attribute. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11613 Signed-off-by: Rowland Penny <repenny241155@gmail.com> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Sun Dec 6 00:33:10 CET 2015 on sn-devel-104
2015-11-23samba-tool: replace use of os.popenUri Simchoni1-3/+11
The netcmd/domain.py module uses os.popen() on user-supplied parameters. This opens up the way to code injection. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11601 Signed-off-by: Uri Simchoni <uri@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Mon Nov 23 22:19:34 CET 2015 on sn-devel-104
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-10-26samba-tool domain demote: Add support for removing by NTDS GUIDAndrew Bartlett1-1/+2
This would help remove a DC that is a conflict record, for example Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool domain demote: Add --verbose and --quiet optionsAndrew Bartlett1-2/+13
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool domain demote: Use dn.add_base/dn.add_childAndrew Bartlett1-2/+4
This is done primarilly to set the pattern that we should manipulate ldb.Dn values with the helper routines, not just by concatonation via format strings. We also restrict our exception hadling to only the expected errors, not all errors. Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool domain demote: Rework to allow cleanup of partial demotion, catch ↵Andrew Bartlett1-1/+4
more errors Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool domain demote: Allow to operate on an RODC and a subdomainAndrew Bartlett1-40/+53
On an RODC the local database cannot be modified, and the flags to remove are different, we need instead to remove UF_PARTIAL_SECRETS_ACCOUNT. If we are in a subdomain, then db.get_root_basedn() points to the forest root, not the root of our domain If the removeDsServer() fails with WERR_DS_DRA_NO_REPLICA this may be reasonably considered to be success in this case. Finally, the remove_dc.remove_sysvol_references() is reused for objects not under the computer account. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> domain demote Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool domain demote: Add --remove-other-dead-serverAndrew Bartlett1-6/+20
The new version of this tool now can remove another DC that is itself offline. The --remove-other-dead-server removes as many references to the DC as possible. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool drs clone-dc-database: Require --targetdirAndrew Bartlett1-1/+5
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool drs clone-dc: Add --include-secrets optionAndrew Bartlett1-2/+3
This allows the creation of domain clones that have no secrets, and so make it safer to examine databases that demonstrate issues Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool: Add new command 'samba-tool drs clone-dc-database'Andrew Bartlett1-0/+41
This command makes a clone of an existing AD Domain, but does not join the domain. This allows us to test if the join would work without adding objects to the target DC. The server password will need to be reset for the clone to be any use, see the source4/scripting/devel/chgtdcpass (Based on patches written with Garming Sam) Andrew Bartlett Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-26samba-tool: Remove vampire subcommand and now unused libnet_Vampire()Andrew Bartlett2-57/+0
This has been deprecated for a long time now Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz>
2015-10-23build: Enable NTVFS file server to be omittedAndrew Bartlett1-7/+30
We now only build it by default with --enable-sefltest, or otherwise if requested. The NTVFS file server still has features not present in the smbd file server, such as a CIFS/SMB proxy, and a radically different design, but it is also not undergoing any ongoing development so this keeps it in a safe state for care and maintaince, with less of a security risk if such an issue were to come up. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-20samba-tool dns: Trap on conneciton errors and give useful infoAndrew Bartlett1-1/+5
Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-16samba-tool --help: possessive pronoun "its" has no apostropheDouglas Bagnall1-1/+1
"it's" is reserved for the contraction of "it is". This *is* somewhat illogical, which is how you know its proper English. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2015-09-29samba-tool: add command to dump dosinfo xattr from a fileRalph Boehme1-1/+23
Add a new command "getdosinfo" to samba-tool to dump dosinfo xattr from a file. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue Sep 29 06:00:49 CEST 2015 on sn-devel-104
2015-07-08samba-tool: add 'domain trust *' commandsStefan Metzmacher1-0/+2206
Available subcommands: create - Create a domain or forest trust. delete - Delete a domain trust. list - List domain trusts. namespaces - Manage forest trust namespaces. show - Show trusted domain details. validate - Validate a domain trust. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-06-18samba-tool: make 'samba-tool fsmo *' aware of all 7 fsmo rolesRowland Penny1-78/+268
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10734 Signed-off-by: Rowland Penny <repenny241155@gmail.com> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Jose A. Rivera <jarrpa@samba.org> Autobuild-User(master): José A. Rivera <jarrpa@samba.org> Autobuild-Date(master): Thu Jun 18 10:24:48 CEST 2015 on sn-devel-104
2015-05-19Fix a typo in the name of the default domain levelMatthieu Patou1-1/+1
Change-Id: I2df44546a74f19ef2c6f1100d29b67fe7362070a Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Tue May 19 19:26:22 CEST 2015 on sn-devel-104
2015-03-16selftest: rename env plugin_s4_dc to ad_dcMichael Adam1-1/+1
This is the environment that represents our supported production setup of an active directory domain controller. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-16samba-tool drs: Ensure we do not replicate all secrets to an RODC, even with ↵Andrew Bartlett1-1/+4
--local Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-03-16s4.2/fsmo.py: fixed fsmo transfer exceptionSteve Howells1-1/+0
In transfer_role() there is an duplicate call to samdb.modify() inside the if statement where the type of role is being determined (specifically for the naming fsmo). This call is unnecessary as after the if statement their is a correct call, with a try/catch block, used by all fsmo transfers that will handle errors - such as the DC with the fsmo role being offline. The call to samdb.modify() inside the if statement for naming fsmo has been removed. Bug: https://bugzilla.samba.org/show_bug.cgi?id=10924 Signed-off-by: Steve Howells <steve.howells@moscowfirst.com> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-02-17group.py: Fix wrong example option, remove wrong comment lineMarc Muehlfeld1-2/+1
Replaced "--gid" with the correct "--gid-number" in Example 3. Additionally removed the first comment line in group.py, which was wrong in that file. Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2015-02-03samba-tool: Create NIS enabled users and unixHomeDirectory attributeMarc Muehlfeld1-2/+23
Allow to create NIS enabled user accounts via 'samba-tool user add'. To create NIS enabled accounts, the parameters --uid-number=, --login-shell=, --unix-home=, --gid-number= are mandatory. Because we didn't had a parameter to set unixHomeDirectory yet, this patch also adds this feature. 'unixUserPassword: ABCD!efgh12345$67890' is added by default, when you enable NIS on an account in ADUC. The same we do in samba-tool. See: https://bugzilla.samba.org/show_bug.cgi?id=10909 Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Marc Muehlfeld <mmuehlfeld@samba.org> Autobuild-Date(master): Tue Feb 3 17:18:32 CET 2015 on sn-devel-104
2014-12-02Minor spelling correction in samba-tool domainDaniel Cotton1-1/+1
Signed-Off-By: Daniel Cotton <danielcotton.patches at gmail.com> Reviewed-By: Michael Adam <obnox@samba.org> Reviewed-By: Jelmer Vernooij <jelmer@samba.org> Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org> Autobuild-Date(master): Tue Dec 2 01:18:53 CET 2014 on sn-devel-104
2014-11-26samba-tool: Fix the IP output of "samba-tool dns serverinfo <some_server>"Guenter Kukkukk1-5/+8
Avoid hardcoded IP-strings, use standard python IP functions to format IPv4 and IPv6 addresses correctly. I have removed the display of the port number. MS-DNSP 2.2.3.2.2.1 DNS_ADDR: (from May 15, 2014) Port Number (2bytes): Senders MUST set this to zero, and receivers MUST ignore it. Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-11-26samba-tool: Fix enum values in dns.pyGuenter Kukkukk1-1/+1
DNS_ZONE_UPDATE_SECURE was used twice, DNS_ZONE_UPDATE_UNSECURE was missing. Signed-off-by: Guenter Kukkukk <linux@kukkukk.com> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-10-23samba-tool group add: Add option --nis-domain and --gidMarc Muehlfeld1-2/+13
This allows creating RFC2307 enabled groups via samba-tool Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Thu Oct 23 18:19:35 CEST 2014 on sn-devel-104
2014-10-23Add missing parameters to drs_Replicate in rodc.pyMichael Brown1-1/+3
* rodc.py: destination_dsa_guid parameter was neglected in drs_Replicate call * rodc.py: cancel the local_samdb transaction on error Change-Id: I962315a26ec48dc8774bb41db760387a3469c919 Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Garming Sam <garming@samba.org> Autobuild-Date(master): Thu Oct 23 03:05:00 CEST 2014 on sn-devel-104
2014-09-30provision: Change the default functional level of new Samba domains to 2008R2.Andrew Bartlett1-2/+2
Windows 2003 is going out of support shortly, and we want users to have AES by default Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-08samba-tool: fix reply when zero day pwd expiry is setBjörn Jacke1-4/+4
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10318 Signed-off-by: Bjoern Jacke <bj@sernet.de> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Björn Jacke <bj@sernet.de> Autobuild-Date(master): Mon Sep 8 14:15:51 CEST 2014 on sn-devel-104
2014-09-02samba-tool/ldapcmp: update the list of non replicated attributesStefan Metzmacher1-13/+49
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10788 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Tue Sep 2 03:49:49 CEST 2014 on sn-devel-104
2014-09-01python: Use the security.dom_sid type for ctx.domsid in join.py and provisionAndrew Bartlett1-0/+4
Change-Id: I1266f77184d68aae6a39a73bac8a432fdd707b2e Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
2014-08-31samba.netcmd.domain: desactivating -> deactivating.Jelmer Vernooij1-1/+1
Change-Id: I463823589049e81bcd4032f3e7bc6b5f2fb0d28d Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-08-31samba.netcmd.domain: Fix incorrect variable names, causing NameErrors.Jelmer Vernooij1-4/+4
Change-Id: I1c78f07f942a8b03ac88de98b18ac636b7124e22 Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-08-31samba.netcmd.domain: Remove unused import.Jelmer Vernooij1-1/+0
Change-Id: I33f3ba55540be01fd15bfc3d75ebb73cbf5ead9e Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-08-31samba.netcmd.domain: Just catch ImportError, not any parsing errors in ↵Jelmer Vernooij1-2/+3
cmd_domain_export_keytab. Change-Id: If5710565c74e87fe218a83f31cddcf64605e522e Signed-Off-By: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-08-06Redescribe --userou usageMarc Muehlfeld1-2/+2
Signed-off-by: Marc Muehlfeld <mmuehlfeld@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org>