summaryrefslogtreecommitdiff
path: root/python/samba/netcmd
AgeCommit message (Collapse)AuthorFilesLines
2020-11-06Use the new CreateTrustedDomainRelax()Isaac Boukris1-44/+13
Signed-off-by: Isaac Boukris <iboukris@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-11-03samba-tool: add new "user unlock" commandBjörn Baumbach1-1/+73
Can be used to unlock a user when the badPwdCount has been reached. Introduces SamDB error classes, as suggested by Douglas Bagnall <douglas.bagnall@catalyst.net.nz> - thanks! This helps to handle expected failures. Tracebacks of really unexpected failures will not be hidden. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-22python: Create targetdir recursivelyAndreas Schneider1-1/+1
This fixes `make test` in a release tarball. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14542 Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-10-02python2 reduction: Merge remaining compat code into commonDavid Mulder6-7/+7
The remaining compat code (get_string, get_bytes, cmp) are useful helper routines which we should simply merge into common (especially since there is some duplication here). Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Autobuild-User(master): David Mulder <dmulder@samba.org> Autobuild-Date(master): Fri Oct 2 14:49:36 UTC 2020 on sn-devel-184
2020-10-01samba-tool contact: rename 'contact create' to 'contact add'Jule Anger1-10/+11
Keep 'contact create' for compatibility reasons. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool group: add 'group create' as synonym for 'group add'Jule Anger1-3/+4
Add 'group create' command for a symmetric set of samba-tool subcommands Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool computer: rename 'computer create' to 'computer add'Jule Anger1-13/+14
Keep 'computer create' for compatibility reasons. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool user: rename 'user create' to 'user add'Jule Anger1-29/+15
Keep 'user create' for compatibility reasons. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool ou: rename 'ou create' to 'ou add'Jule Anger1-8/+9
Keep 'ou create' for compatibility reasons. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool contact: add new contact 'rename' commandJule Anger1-0/+178
Usage: samba-tool contact rename <contactname> [options] Rename a contact and related attributes. This command allows to set the contact's name related attributes. Use an empty attribute value to remove the specified attribute. The contactname specified on the command is the CN. Example1: samba-tool contact rename "John Doe" --surname=Bloggs \\ --force-new-cn=John Example1 shows how to change the surname ('sn' attribute) of a contact 'John Doe' to 'Bloggs' and change the CN to 'John' on the local server. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool group: add new group 'rename' commandJule Anger1-0/+155
Usage: samba-tool group rename <groupname> [options] Rename a group and related attributes. This command allows to set the group's name related attributes. Use an empty attribute value to remove the specified attribute. The groupname specified on the command is the sAMAccountName. Example1: samba-tool group rename employees --samaccountname=staff Example1 shows how to change the sAMAaccountName of a group 'employees' to 'staff' on the local server. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-10-01samba-tool user: add new user 'rename' commandBjörn Baumbach1-0/+225
Usage: samba-tool user rename <username> [options] Rename a user and related attributes. This command allows to set the user's name related attributes. The user's CN will be renamed automatically. The user's new CN will be made up by combining the given-name, initials and surname. A dot ('.') will be appended to the initials automatically. Use the --force-new-cn option to specify the new CN manually. The username specified on the command is the sAMAccountName. Example1: samba-tool user rename johndoe --surname='Bloggs' Example1 shows how to change the surname of a user 'johndoe' to 'Bloggs' on the local server. The user's CN will be renamed automatically, based on the given name, initials and surname. Pair-Programmed-With: Jule Anger <ja@sernet.de> Signed-off-by: Björn Baumbach <bb@sernet.de> Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2020-09-04Fixed arrow keys typo to the computer move command utilityHezekiah1-1/+1
Signed-off-by: Hezekiah <hezekiahmaina3@gmail.com> Reviewed-by: Alexander Bokovoy <ab@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Alexander Bokovoy <ab@samba.org> Autobuild-Date(master): Fri Sep 4 16:57:30 UTC 2020 on sn-devel-184
2020-09-02samba-tool: Create unix user with modified template homedirDavid Mulder1-2/+3
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Jeremy Allison <jra@samba.org>
2020-08-19s3:client: Turn off smb signing for message opAndreas Schneider2-2/+2
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19python: Set smb signing via the creds APIAndreas Schneider2-1/+15
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-19python: Remove unused sign argument from smb_connection()Andreas Schneider1-5/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2020-08-11python compat: remove text_typeDouglas Bagnall2-5/+3
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-08-11python compat: remove binary_typeDouglas Bagnall1-2/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-07-17python: wrap 'import dckeytab' in an explanatory functionDouglas Bagnall1-1/+2
The samba.dckeytab module has magic effects on samba.net, but never appears to be used. That can be confusing, both to people and to linters. Here we wrap that confusion up into a well-commented function, so we never again have to wonder why the unused import is there. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>
2020-07-17samba-tool ntacl: remove unused imports and variablesDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: David Mulder <dmulder@samba.org>
2020-06-23samba-tool: add command for installing gpo samba admxDavid Mulder1-0/+72
Signed-off-by: David Mulder <dmulder@suse.com> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2020-06-11samba-tool dns query --help: Someone forgot 'PTR' from the list of record typesRowland Penny1-1/+2
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): Thu Jun 11 04:37:37 UTC 2020 on sn-devel-184
2020-04-29samba-tool: fetch "no such subcommand" error and print error messageBjörn Baumbach1-0/+3
This patch especially improves the case where extra arguments are used. Without this patch just the attributes are mentioned as invalid, if samba-tool is called with an invalid/unknown subcommand. Example without this patch: # samba-tool sites list --all Usage: samba-tool sites <subcommand> samba-tool sites: error: no such option: --all This can be deceptive for users. Is looks like the "list" command does not provide a "--all" option. Example with this patch: # samba-tool sites list --all samba-tool sites: no such subcommand: list Usage: samba-tool sites <subcommand> (...) Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Apr 29 08:08:21 UTC 2020 on sn-devel-184
2020-04-02samba-tool group show: only shows global security groups, this patch makes ↵Rowland Penny1-3/+2
it show all groups. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14335 Signed-off-by: Rowland Penny <rpenny@samba.org> Reviewed-by: Björn Baumbach <bb@samba.org> Autobuild-User(master): Björn Baumbach <bb@sernet.de> Autobuild-Date(master): Thu Apr 2 15:27:53 UTC 2020 on sn-devel-184
2020-03-27python/netcmd/dns: improve exception handling in cmd_add_record()Stefan Metzmacher1-1/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-03-27python/netcmd/dns: improve exception handling in cmd_delete_record()Stefan Metzmacher1-1/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2020-03-05python: Fix userPrincipalName in GetPasswordCommand.get_account_attributes()Jonathon Reinhart1-1/+1
Signed-off-by: Jonathon Reinhart <Jonathon.Reinhart@gmail.com> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Mar 5 16:27:50 UTC 2020 on sn-devel-184
2020-02-28samba-tool group edit: use binary encoded group nameBjörn Baumbach1-1/+2
Allows to edit groups with names like e.g. 'group1 (xy)'. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14296 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-28samba-tool group delete: use binary encoded group nameBjörn Baumbach1-1/+1
Allows to delete groups with names like e.g. 'group1 (xy)'. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14296 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-28samba-tool group move: use binary encoded group nameBjörn Baumbach1-1/+1
Allows to move groups with names like e.g. 'group1 (xy)'. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14296 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-28samba-tool group listmembers: use binary encoded group namesBjörn Baumbach1-1/+2
Allows to find groups with names like e.g. 'group1 (xy)'. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14296 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-28samba-tool group listmembers: find group members by groups SIDBjörn Baumbach1-5/+6
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14296 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-28samba-tool group listmembers: handle group-does-not-exist errorBjörn Baumbach1-9/+8
Return a error with a proper message instead of just do nothing when the target group does not exist. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14296 Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-28samba-tool group listmembers: hide python backtracke on command errorBjörn Baumbach1-1/+2
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2020-02-11samba-tool domain join: remove sub domain join codeGary Lockyer1-16/+10
Remove the unused sub domain join code, the option was removed by commit 5583208aed0e4647269e48aa1d3c5c48a73001ac. This commit completely removes the now unused code. Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Tue Feb 11 17:41:32 UTC 2020 on sn-devel-184
2020-02-07samba-tool gpo: tighter matching for ini namesDouglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org> Autobuild-User(master): Noel Power <npower@samba.org> Autobuild-Date(master): Fri Feb 7 12:03:34 UTC 2020 on sn-devel-184
2020-02-07python: use raw string for regex with escapeDouglas Bagnall4-14/+14
Python regards 'GPT\.INI$' as a string containing an invalid escape sequence '\.', which is ignored (i.e. treated as the literal sequence of those 2 characters), but only after Python has grumbled to itself, and to you if you enabled DeprecationWarnings. The proper thing to do here is use r-strings, like r'GPT\.INI$', which tell Python that all backslashes are literal. Alternatively (as we do once in this patch), the backslash can itself be escaped ('\\'). There are more problems of this nature in the build scripts. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
2020-01-21samba-tool group addmembers: avoid python traceback on member add failureBjörn Baumbach1-2/+2
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool group addmembers: add --member-base-dn option for group member searchBjörn Baumbach1-2/+20
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool group {add,remove}members: allow to use --member-dn in ↵Björn Baumbach1-11/+28
combination with listofmembers Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool group removemembers: adapt functionality to addmembers commandBjörn Baumbach1-6/+32
Adds --member-dn and --object-types options. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool group addmembers: add --member-dn optionBjörn Baumbach1-4/+12
The --member-dn option allows to specify an object by it's DN. This is required to select a specific object if there are more than one with the same name. Multiple contacts can exist with the same name in different OUs. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool group addmembers: add new option --object-typesBjörn Baumbach1-3/+20
With this option the admin can specify the object types of the group members which will be added to the group. The search filter for the objects will be created according to the types. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool: add -b/--base-dn option to OUs list commandJule Anger1-3/+16
With this option it's e.g. possible to list the OUs which are located under a different specific place in the AD. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool: add -b/--base-dn option to users list commandJule Anger1-2/+10
With this option it's e.g. possible to list the users of a specify OU or users which are located under a different specific place in the AD. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool: add -b/--base-dn option to contacts list commandJule Anger1-2/+9
With this option it's e.g. possible to list the contacts of a specify OU or contacts which are located under a different specific place in the AD. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool: add -b/--base-dn option to computer list commandJule Anger1-2/+10
With this option it's e.g. possible to list the computers of a specify OU or computers which are located under a different specific place in the AD. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool: add -b/--base-dn option to groups list commandJule Anger1-0/+6
With this option it's e.g. possible to list the groups of a specify OU or groups which are located under a different specific place in the AD. Signed-off-by: Jule Anger <ja@sernet.de> Pair-programmed-with: Björn Baumbach <bb@samba.org> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-01-21samba-tool: add --full-dn option for user getgroups commandBjörn Baumbach1-2/+17
Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>