summaryrefslogtreecommitdiff
path: root/python/samba
AgeCommit message (Collapse)AuthorFilesLines
2025-04-03python:tests/krb5: allow set_pac_sids() to take upn_dns_sidStefan Metzmacher1-2/+6
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-03python:tests/krb5: let check_device_info() allow an empty rid arrayStefan Metzmacher1-1/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-03python:tests/krb5: allow create_account_opts() to take ↵Stefan Metzmacher1-0/+27
selective_auth_allowed_sid This will add a GUID_DRS_ALLOWED_TO_AUTHENTICATE ace with CONTROL_ACCESS to the created account. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-03python:tests/krb5: allow tgs_exchange_dict() to take ↵Stefan Metzmacher1-0/+42
expected_[device_]duplicated_groups This allows us to expect duplicated sids in the PAC. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-03python:tests/krb5: let check_device_info() handle EXTRA_DOMAIN_SIDStefan Metzmacher1-8/+21
device info does not really have RESOURCE_SID, so we need to map RESOURCE_SID as well as EXTRA_SID (with a S-1-5-21- prefix) to EXTRA_DOMAIN_SID. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-03python:tests/krb5: create_account_opts() can't handle self.AccountType.TRUSTStefan Metzmacher1-0/+1
create_trust() is used for that... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-04-03python:tests/krb5: add KDC_ERR_PATH_NOT_ACCEPTEDStefan Metzmacher1-0/+1
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-29python:join: do not suppress unexpected DNS enum errorsDouglas Bagnall1-0/+3
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-29samba-tool backup restore: cope with no sysvolDouglas Bagnall1-2/+5
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15661 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Sat Mar 29 08:25:39 UTC 2025 on atb-devel-224
2025-03-29samba-tool testparm: avoid lowering debug levelDouglas Bagnall1-1/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-29samba-tool testparm: drop unsupported optionsDouglas Bagnall1-11/+1
These have been useless since 2011. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-29samba-tool gpo: use a real XML parser to check entity validityDouglas Bagnall1-20/+25
The expat parser comes with the Python standard library, so we can use it to check the entities work, rather than relying on a fragile regular expression. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-29samba-tool gpo: separate function for dtd header generationDouglas Bagnall1-6/+12
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-29pytest: source_tree_topdir() checks more thoroughlyDouglas Bagnall1-8/+12
We are more certain of how many ../ steps we are from top than we are that the existence of a thing called 'source4' is a definite sign that this is a full source tree. So we check fewer depths and more subdirectories. This also modernises the return type to be a pathlib.Path, which works without change for current callers. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-29python: make source_tree_topdir() test-onlyDouglas Bagnall5-14/+15
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-29python: remove unused in_source_tree() functionDouglas Bagnall1-9/+0
We don't use it and don't want non-tests changing their behaviour based on this kind of thing anyway. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-26samba-tool domain backup: add --no-sysvol optionThomas Karlsson1-9/+13
In some circumstances sysvol is not wanted in a backup. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15661 Signed-off-by: Thomas Karlsson <thomas.karlsson@relea.se> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-03-25python:gp_cert_auto_enrol: fix GUID stringificationDouglas Bagnall2-11/+8
We were using some broken ad-hoc unpacking to do what the ndr unpacker does perfectly well. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15839 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz> Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org> Autobuild-Date(master): Tue Mar 25 05:21:49 UTC 2025 on atb-devel-224
2025-03-25samba-tool gpo: better entities check copes with new linesDouglas Bagnall1-2/+2
Per https://www.w3.org/TR/xml/#sec-entity-decl (and MS references) there is always some whitespace between '<!ENTITY' and the name, and between the name and whatever is next. Also, it is valid XML to have newlines inside entity declarations, like this: <!ENTITY bubble "*S-1-5-113" > We used to create such files, so we should allow them. There is a kind of entity that has '%' before the name, and there are non-ascii names, which we continue not to support. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15829 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-03-25samba-tool gpo backup fix --generalizeDouglas Bagnall1-3/+5
This was broken with commit ce56d336f234febfd4cb3da11dd584842c24ce1d but we didn't notice because the test was already broken. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15829 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-03-25pytest: samba-tool gpo: fix has_difference(sortlines=True)Douglas Bagnall1-9/+15
We had file1 = open(path1).readlines() file1.sort() file2 = open(path1).readlines() file2.sort() which is opening path1 in both cases. This meant we were testing nothing because the assertions are all that the files are the same -- though the only affected check is one in test_backup_restore_generalize(). BUG: https://bugzilla.samba.org/show_bug.cgi?id=15829 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-03-25python:netcmd:gpo: fix crash when updating an MOTD GPOAndreas Hasenack1-2/+6
When the policy exists already, there is no exception and the code tries to use the "data" variable, but it doesn't exist because it was only defined in the exception handling. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15774 Signed-off-by: Andreas Hasenack <andreas.hasenack@canonical.com> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-03-25pytest: check we can set GPO more than onceDouglas Bagnall1-0/+36
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15774 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-03-25pytest: samba-tool gpo: close opened filesDouglas Bagnall1-6/+9
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-03-25samba-tool gpo: close opened filesDouglas Bagnall1-6/+10
It is almost certain that we are not going to run out of files, as they get garbage collected anyway, but in some circumstances these can fill your screen with "ResourceWarning: unclosed file" messages, which hides the real messages. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-03-19python:ntacls: pull allow list out of loopDouglas Bagnall1-13/+11
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14927 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Wed Mar 19 15:56:38 UTC 2025 on atb-devel-224
2025-03-19python/ntacls.py: only allow allow and deny ACEs in setntacl()Ralph Boehme1-9/+25
Commit 27dd0afb62d4f7427c966e984c7c8b01bc4d93b5 introduced a regression. Before that commit we included only SEC_ACE_TYPE_ACCESS_ALLOWED(0) as 'not type & SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT' filtered out SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT(5), but also SEC_ACE_TYPE_ACCESS_DENIED and SEC_ACE_TYPE_ACCESS_DENIED_OBJECT. After that commit we started to include SEC_ACE_TYPE_ACCESS_ALLOWED_OBJECT, which is wrong. It was also always wrong to exclude SEC_ACE_TYPE_ACCESS_DENIED(1). So now we make it explicit that we only include SEC_ACE_TYPE_ACCESS_ALLOWED and SEC_ACE_TYPE_ACCESS_DENIED. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14927 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-19python/provision: avoid SDDL conversion in set_dir_acl()Ralph Boehme1-1/+1
This is not needed and has the potential to loose information if the sddl code wouldn't have all features implemented. No intended change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14927 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-19python/policies.py: avoid SDDL conversion for dsacl2fsaclRalph Boehme1-2/+1
This is not needed and has the potential to loose information if the sddl code wouldn't have all features implemented. No intended change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14927 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-19python/gpo.py: avoid SDDL conversion for dsacl2fsaclRalph Boehme1-2/+1
This is not needed and has the potential to loose information if the sddl code wouldn't have all features implemented. No intended change in behaviour. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14927 Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Ralph Boehme <slow@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2025-03-19pytest:ntacls: test dsacl2fsacl() with a few stringsDouglas Bagnall1-1/+74
The fsacl should end up without object ACEs, and with some flags set and mask changes. We are so far only testing with allow, deny, and object ACEs. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14927 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-03-12pytests: samba_tool.help checks you updated the man pageDouglas Bagnall1-1/+33
It tries to help by printing something that is a little bit like the correct DocBook text to insert. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Rowland Penny <rpenny@samba.org>
2025-03-12pytest:samba-tool: .check_output() can set environmentDouglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Rowland Penny <rpenny@samba.org>
2025-03-12python:getopt: hack to generate docbook stubs from --helpDouglas Bagnall1-0/+52
We have many many samba-tool subcommands that are not documented in the manpage. Often the --help text is a good place to start, but doing it entirely manually is VERY tedious. This automates some of the process. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Rowland Penny <rpenny@samba.org>
2025-02-27python:tdb_util: "samba-tool domain backup offline" hangsAndrea Venturoli1-2/+3
GNU getopt(3) is by default non-POSIX compliant and accepts options after positional arguments (unless forced with POSIXLY_CORRECT). This is not portable, e..g., on FreeBSD. Put options first and then positional arguments. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15804 Signed-off-by: Andrea Venturoli <ml@netfence.it> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
2025-02-24python:tests/krb5: let create_trust() take {ingress,egress}_claims_tf_rulesStefan Metzmacher1-0/+99
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Mon Feb 24 10:28:02 UTC 2025 on atb-devel-224
2025-02-24python:tests/krb5: let create_trust() take forest_infoStefan Metzmacher1-0/+17
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: let modified_ticket() to take modify_{tkt,enc}_fnStefan Metzmacher1-9/+33
This makes it possible modify the public ticket part well as the enc part. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: add remove_pac_buffers()Stefan Metzmacher1-0/+13
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: set_pac_claims with claims=[] should be an empty blobStefan Metzmacher1-16/+21
Review with: git show -w Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: let set_pac_sids() replace the requester_sidStefan Metzmacher1-2/+4
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: add set_pac_names() to modify the names in a pacStefan Metzmacher1-0/+49
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: give KerberosTicketCreds a basic __str__() functionStefan Metzmacher1-0/+4
This makes debugging easier... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: let create_ccache[_with_ticket] use the correct crealmStefan Metzmacher1-3/+3
It can be different from the servers realm. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: allow get_service_ticket() to fail with expected_statusStefan Metzmacher1-2/+19
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24python:tests/krb5: add KerberosTicketCreds.set_srealm()Stefan Metzmacher1-0/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-24samba-tool/testparm: make it clear that 'client use krb5 netlogon' is ↵Stefan Metzmacher1-0/+10
experimental BUG: https://bugzilla.samba.org/show_bug.cgi?id=15815 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2025-02-20winbind:varlink: Set the disposition field in user recordsSamuel Cabrero1-0/+3
Set the disposition field in the user record, otherwise systemd could derive it from the uid based on its configured ranges. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-02-20pytests/varlink: Add varlink testsSamuel Cabrero4-0/+295
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2025-02-17python:lsa_utils: Fix fallback to OpenPolicy2Stefan Metzmacher4-99/+130
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15680 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Mon Feb 17 18:33:15 UTC 2025 on atb-devel-224