summaryrefslogtreecommitdiff
path: root/python
Commit message (Collapse)AuthorAgeFilesLines
* samba-tool group addmembers: avoid python traceback on member add failureBjörn Baumbach2020-01-211-2/+2
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool group addmembers: add --member-base-dn option for group member searchBjörn Baumbach2020-01-212-4/+25
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool group {add,remove}members: allow to use --member-dn in ↵Björn Baumbach2020-01-211-11/+28
| | | | | | | combination with listofmembers Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool group removemembers: adapt functionality to addmembers commandBjörn Baumbach2020-01-211-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>
* samba-tool group addmembers: add --member-dn optionBjörn Baumbach2020-01-212-30/+45
| | | | | | | | | | | 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>
* samba-tool group addmembers: add new option --object-typesBjörn Baumbach2020-01-211-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>
* python/samdb: validation of group member types for group member filterBjörn Baumbach2020-01-211-0/+6
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* python/samdb: add type "all" to search for all common types of group membersBjörn Baumbach2020-01-211-0/+10
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* python/samdb: adapt search filter for group object typeBjörn Baumbach2020-01-211-1/+3
| | | | | | | | | | Use a group search filter which is similar to the filter which is used by the basic MS Windows group membership management. The filter excludes the group type GROUP_TYPE_BUILTIN_LOCAL_GROUP. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* python/samdb: adapt search filter for user object typeBjörn Baumbach2020-01-211-2/+2
| | | | | | | | | | Use a user search filter which is similar to the filter which is used by the basic MS Windows group membership management. The filter filters for objects with the sAMAccountType ATYPE_NORMAL_ACCOUNT. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* python/samdb: add 'computer' to the default group member types for group ↵Björn Baumbach2020-01-211-1/+1
| | | | | | | | | | member filters Add the 'computer' type to the default member types, so that the next commit does not change the default behavior. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* python/samdb: fetch specific error if there are more than one search resultsBjörn Baumbach2020-01-211-0/+6
| | | | | | | There can be more than one contact with the same name. Signed-off-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* python/samdb: add more object types for adding/remove group membersBjörn Baumbach2020-01-211-0/+21
| | | | | | | | The filters are based on the MS Windows filter, which are used by the basic group member management dialog. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* python/samdb: add option to specify types of group membersBjörn Baumbach2020-01-211-3/+17
| | | | | | | | | The option can be used to specify the type of the object which have to be added to (or removed) from a 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>
* samba-tool tests: add test-case for 'ou list --base-dn'Jule Anger2020-01-211-0/+19
| | | | | | | | Check if the ou list --base-dn / -b command uses a specific base dn. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add -b/--base-dn option to OUs list commandJule Anger2020-01-211-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>
* samba-tool tests: add test-case for 'user list --base-dn'Jule Anger2020-01-211-0/+24
| | | | | | | | Check if the user list --base-dn / -b command uses a specific base dn. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add -b/--base-dn option to users list commandJule Anger2020-01-211-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>
* samba-tool tests: add test-case for 'contact list --base-dn'Jule Anger2020-01-211-0/+19
| | | | | | | | Check if the contact list --base-dn / -b command uses a specific base dn. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add -b/--base-dn option to contacts list commandJule Anger2020-01-211-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>
* samba-tool tests: add test-case for 'computer list --base-dn'Jule Anger2020-01-211-0/+20
| | | | | | | | Check if the computer list --base-dn / -b command uses a specific base dn. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add -b/--base-dn option to computer list commandJule Anger2020-01-211-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>
* samba-tool tests: add test-case for 'group list --base-dn'Jule Anger2020-01-211-0/+22
| | | | | | | | Check if the group list --base-dn / -b command uses a specific base dn. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add -b/--base-dn option to groups list commandJule Anger2020-01-211-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>
* samba-tool: add --full-dn option for user getgroups commandBjörn Baumbach2020-01-211-2/+17
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool tests: add test-case for 'group listmembers --full-dn'Jule Anger2020-01-211-0/+23
| | | | | | | | Check if the group listmembers --full-dn command displays DN instead of the sAMAccountName. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add --full-dn option to group listmembers commandJule Anger2020-01-211-1/+15
| | | | | | | | | With this option the command lists the groupmembers distinguished names instead of the sAMAccountName. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool tests: add test case for 'user list --full-dn'Jule Anger2020-01-211-0/+22
| | | | | | | | Check if the --full-dn option displays DN instead of the sAMAccountName. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add --full-dn option to user list commandJule Anger2020-01-211-1/+14
| | | | | | | | | With this option the command lists the users distringuished names instead of the sAMAccountNames. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool tests: add test case for 'computer list --full-dn'Jule Anger2020-01-211-0/+19
| | | | | | | | Check if the --full-dn option displays DN instead of the sAMAccountName. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add --full-dn option to computer list commandJule Anger2020-01-211-1/+14
| | | | | | | | | With this option the command lists the computers distringuished names instead of the sAMAccountNames. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool tests: Add test-case for 'group list --full-dn'Jule Anger2020-01-211-0/+21
| | | | | | | | Check if the --full-dn option displays DN instead of the sAMAccountName. Signed-off-by: Jule Anger <ja@sernet.de> Reviewed-by: Björn Baumbach <bb@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool: add --full-dn option to group list commandBjörn Baumbach2020-01-211-3/+15
| | | | | | | | With this option the command lists the groups distringuished names instead of the sAMAccountNames. Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Ralph Boehme <slow@samba.org>
* samba-tool gpo: improve UNC parsingDouglas Bagnall2020-01-161-9/+10
| | | | | | | | | | | | | The "UNC doesn't start with \\\\ or //" message was unreachable due to a logic error, and an UNC starting with \\ would have been split on / if there were enough /s in the string. The unreachable exception was first noticed by Gerhard Lausser in a github pull request (https://github.com/samba-team/samba/pull/123), but that patch no longer applies with this more thorough rewrite. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jeremy Allison <jra@samba.org>
* samba-tool: implement user getgroups commandStefan Metzmacher2020-01-151-0/+78
| | | | | | | | | samba-tool user getgroups command to list a users group memberships. Pair-programmed-with: Björn Baumbach <bb@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Andreas Schneider <asn@samba.org>
* samba-tool: implement user setprimary group command (set primaryGroupID)Björn Baumbach2020-01-151-0/+111
| | | | | | | | | Introduce an option to set the primaryGroupID attribute of a user account. Pair-programmed-with: Stefan Metzmacher <metze@samba.org> Signed-off-by: Björn Baumbach <bb@sernet.de> Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* tests/DNS: add MX/SRV record tests with multiple spacesBjörn Jacke2020-01-141-3/+5
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13788 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Björn Baumbach <bb@samba.org> Autobuild-User(master): Björn Baumbach <bb@sernet.de> Autobuild-Date(master): Tue Jan 14 11:58:20 UTC 2020 on sn-devel-184
* samba-tool: fix adding of dns SRV/MX/SOA recordsBjörn Jacke2020-01-141-3/+3
| | | | | | | | | | Thanks to Denis Cardon for finding BUG: https://bugzilla.samba.org/show_bug.cgi?id=13788 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Björn Baumbach <bb@samba.org>
* tests/DNS: \n.COM shouldn't be a valid DNS recordBjörn Jacke2020-01-141-1/+0
| | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=13788 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: Björn Baumbach <bb@samba.org>
* tests: Fix a typoVolker Lendecke2020-01-061-1/+1
| | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
* python/loadparm: check for AD DC required VFS modulesBjörn Jacke2020-01-031-5/+13
| | | | | | | | | | | | same as the previous commit, just for python's testparm code Bug: https://bugzilla.samba.org/show_bug.cgi?id=10560 Signed-off-by: Bjoern Jacke <bjacke@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Björn Jacke <bjacke@samba.org> Autobuild-Date(master): Fri Jan 3 22:19:47 UTC 2020 on sn-devel-184
* pysmbd: add "session_info" arg tp py_smbd_create_file()Ralph Boehme2019-12-202-3/+3
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pysmbd: add "session_info" arg to py_smbd_mkdir()Ralph Boehme2019-12-202-3/+3
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pysmbd: add "session_info" arg to py_smbd_get_sys_acl()Ralph Boehme2019-12-201-8/+8
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pysmbd: make "session_info" arg to py_smbd_get_nt_acl() mandatoryRalph Boehme2019-12-206-40/+43
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pysmbd: make "session_info" arg to py_smbd_set_nt_acl() mandatoryRalph Boehme2019-12-206-57/+75
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pysmbd: add "session_info" arg to py_smbd_unlink()Ralph Boehme2019-12-202-2/+3
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pysmbd: add "session_info" arg to py_smbd_chown()Ralph Boehme2019-12-202-2/+2
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* pysmbd: add "session_info" arg to py_smbd_set_simple_acl()Ralph Boehme2019-12-202-11/+12
| | | | | Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* python/tests: use a system session_info in posixacl.pyRalph Boehme2019-12-201-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously posixacl.py passed None as session_info object from get_session_info(). That meant that the if/else branch referring to session_info: if nwrap_winbind_active or session_info: self.assertEquals(posix_acl.acl[1].a_perm, 7) else: self.assertEquals(posix_acl.acl[1].a_perm, 6) must be tweaked to take into account that session info is now either * a system session_info in which case we must continue to use the if branch in the code, or * a user session_info in which case we must continue to go through the else branch Using is_user_session = not session_info.security_token.is_system() in place of just "session_info" does the trick. Cf the classes SessionedPosixAclMappingTests and UnixSessionedPosixAclMappingTests in posixacl.py, those are the ones that trigger test execution with a user session. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>