summaryrefslogtreecommitdiff
path: root/python
Commit message (Collapse)AuthorAgeFilesLines
* samba-tool domain join: remove sub domain join codeGary Lockyer2020-02-112-72/+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
* samba-tool gpo: tighter matching for ini namesDouglas Bagnall2020-02-071-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
* python: use raw string for regex with escapeDouglas Bagnall2020-02-075-15/+15
| | | | | | | | | | | | | | | | 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>
* pytests: heed assertEquals deprecation warning en-masseDouglas Bagnall2020-02-0790-2678/+2678
| | | | | | | | | | | TestCase.assertEquals() is an alias for TestCase.assertEqual() and has been deprecated since Python 2.7. When we run our tests with in python developer mode (`PYTHONDEVMODE=1 make test`) we get 580 DeprecationWarnings about this. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Noel Power <npower@samba.org>
* librpc ndr: Heap-buffer-overflow in lzxpress_decompressGary Lockyer2020-02-071-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reproducer for oss-fuzz Issue 20083 Project: samba Fuzzing Engine: libFuzzer Fuzz Target: fuzz_ndr_drsuapi_TYPE_OUT Job Type: libfuzzer_asan_samba Platform Id: linux Crash Type: Heap-buffer-overflow READ 1 Crash Address: 0x6040000002fd Crash State: lzxpress_decompress ndr_pull_compression_xpress_chunk ndr_pull_compression_start Sanitizer: address (ASAN) Recommended Security Severity: Medium Credit to OSS-Fuzz REF: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=20083 BUG: https://bugzilla.samba.org/show_bug.cgi?id=14236 Signed-off-by: Gary Lockyer <gary@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
* selftest: Test behaviour of DNS scavenge with an existing dNSTombstoned valueAndrew Bartlett2020-02-061-0/+39
| | | | | | | | | | BUG: https://bugzilla.samba.org/show_bug.cgi?id=14258 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Thu Feb 6 16:24:25 UTC 2020 on sn-devel-184
* s3:auth_sam: map an empty domain or '.' to the local SAM nameStefan Metzmacher2020-02-051-2/+2
| | | | | | | | | | | | | When a domain member gets an empty domain name or '.', it should not forward the authentication to domain controllers of the primary domain. But we need to keep passing UPN account names with an empty domain to the DCs as a domain member. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14247 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* 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>