summaryrefslogtreecommitdiff
path: root/python
AgeCommit message (Collapse)AuthorFilesLines
2023-11-15netcmd: user: PEP8 E303 E305: fix too many or too little blank linesRob van der Linde2-2/+1
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-15netcmd: user: PEP8 E225: missing whitespace around operatorRob van der Linde1-1/+1
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-15netcmd: user: PEP8 E221: fix multiple spaces before operatorRob van der Linde2-35/+35
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-15netcmd: user: PEP8 E127: fix hanging indent not lining upRob van der Linde3-7/+7
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-15netcmd: user: PEP8 E502: backslash is redundant between bracketsRob van der Linde1-1/+1
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-15netcmd: user: PEP8 E117: code is overindentedRob van der Linde2-14/+14
Signed-off-by: Rob van der Linde <rob@catalyst.net.nz> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-15python/samba/tests: Add smbcacl tests for save/restoreNoel Power1-0/+205
Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-15pytests: sid_strings: do not fail if epoch ending has zerosDouglas Bagnall1-1/+1
To avoid collisions in random OID strings, we started using the epoch date modulus 100 million. The trouble is we did not strip out the leading zeros, so the field might be '00000123' when it should be '123', if the date happened not to correspond to an epoch with a zero in the eighth to last place. This has been the case for most of the last 1041 days, but fortunately the bug was only introduced earlier this year. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15520 Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Martin Schwenke <mschwenke@ddn.com>
2023-11-13CI/smb3unix: add test_delete_on_closeRalph Boehme1-0/+65
BUG:https://bugzilla.samba.org/show_bug.cgi?id=15517 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-11-13python: move clean_file() to samba/tests/libsmb.pyRalph Boehme2-10/+11
BUG:https://bugzilla.samba.org/show_bug.cgi?id=15517 Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-11-09netcmd: Disallow device‐specific attributes and operators for ↵Joseph Sutton1-2/+2
allowed‐to‐authenticate‐from fields Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Nov 9 09:01:25 UTC 2023 on atb-devel-224
2023-11-09netcmd: Add ‘allow_device_in_sddl’ parameter to SDDLField()Joseph Sutton1-3/+19
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-09netcmd:tests: Test authentication policies containing device‐specific ↵Joseph Sutton1-1/+102
attributes and operators Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-09tests/krb5: Test Kerberos principal names containing non–BMP Unicode ↵Joseph Sutton2-0/+63
characters Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-09tests/krb5: Add ‘expected_sname’ parameter to _fast_as_req()Joseph Sutton1-6/+11
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-09tests/krb5: Encode KerberosString objects as UTF‐8Joseph Sutton1-0/+74
Windows treats Kerberos strings as UTF‐8, but by default, pyasn1 encodes strings as ISO-8859-1. (There is a UTF8String type that gets encoded as UTF‐8, but it has a different ASN.1 encoding from GeneralString, and so can’t be used). asn1ate provides no way to override the encoding. Except… It turns out we can force UTF‐8 encoding by cunningly overriding KerberosString.__getattribute__(). Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-09tests/krb5: Move ‘rfc4120_pyasn1’ to ‘rfc4120_pyasn1_generated’Joseph Sutton3-2710/+2728
‘rfc4120_pyasn1_generated’ is not to be used directly. Its contents are now reexported from ‘rfc4120_pyasn1’, which becomes a simple wrapper. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-07tests/krb5: Add tests for AllowedToAuthenticateTo with SamLogonJoseph Sutton1-1/+230
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-07tests/krb5: Add test for an authentication policy that allows a specific accountJoseph Sutton1-0/+28
This is a counterpart to ‘test_conditional_ace_allowed_from_user_deny’. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-07tests/krb5: Correct authentication policy SDDLJoseph Sutton1-1/+3
There is no claim called ‘abc’, so the condition ‘(abc)’ is always going to fail. Replace this with a condition using ‘Member_of’. Furthermore, an ACL containing only Deny ACEs will only ever deny. Add a trailing Allow ACE so that the ACL might allow other principals. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-07tests/krb5: Remove unused parameter ‘expected_device_groups’Joseph Sutton1-6/+0
It was never passed in by any callers. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-07tests/krb5: Remove unused parameter ‘expected_device_groups’Joseph Sutton1-5/+0
It was never passed in by any callers. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-05CI: smb3unix.py: check more attributes of test files (and dirs) in ↵Ralph Boehme1-5/+27
test_posix_perm_files() Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sun Nov 5 19:35:51 UTC 2023 on atb-devel-224
2023-11-02tests/krb5: Fix commentsJoseph Sutton2-2/+2
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Thu Nov 2 20:13:50 UTC 2023 on atb-devel-224
2023-11-02tests/krb5: Test RODC‐issued TGTs that already contain device info/claimsJoseph Sutton1-13/+114
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Don’t reuse SID S-1-2-3-4Joseph Sutton1-3/+3
We’re already using it in ‘client_sids’ to work around a bug in Windows. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Test target authentication policies when the TGT already ↵Joseph Sutton1-8/+132
contains device info/claims Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Add tests for PACs containing extraneous buffersJoseph Sutton3-5/+71
Test that the KDC removes these buffers from RODC‐issued PACs. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Pass a list of PAC modification functionsJoseph Sutton1-9/+8
This is simpler than chaining functions together. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Test performing a FAST‐armored TGS‐REQ when the TGT already ↵Joseph Sutton1-0/+52
contains device info/claims Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Add support to test framework for existing device info or claims ↵Joseph Sutton1-8/+53
buffers Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Always expect client claimsJoseph Sutton1-1/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Ensure that device SIDs and claims are present only if we expect ↵Joseph Sutton1-2/+2
them to be Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: No longer pass two‐component form of TGS principalJoseph Sutton1-27/+2
Samba now handles one‐component TGS principals more correctly. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Remove unused importJoseph Sutton1-1/+0
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests: Convert the regression test for bug15505 to pythonVolker Lendecke1-0/+23
The shell version is flapping, but I can't really figure out why. Maybe this version is not flapping, and it also shows the failure if you revert 952d6c2cf48. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests: Make clean_file() handle directoriesVolker Lendecke1-1/+4
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests: Allow to specify share names in smb2symlink testsVolker Lendecke1-11/+14
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-02tests/krb5: Test conditional ACE expressions with empty composite literalsJoseph Sutton1-0/+9
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01pytest:samba-tool domain test policy: test SDDL diagnosticsDouglas Bagnall1-0/+42
The existing 'bad SDDL' test has SDDL so bad that the diagnostics are not exercised. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Wed Nov 1 21:12:33 UTC 2023 on atb-devel-224
2023-11-01pytest: samba_tool domain auth policy fix for SDDL err msgDouglas Bagnall1-2/+2
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01samba-tool: try to present diagnostics for SDDL errors.Douglas Bagnall1-0/+28
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01pytest:sddl: assert SDDLValueError values make senseDouglas Bagnall1-2/+13
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01s4/librpc/py_security: use SDDLValueError for better error messagesDouglas Bagnall2-2/+2
The aim is to allow samba-tool to tell users where their SDDL went wrong. Some tests would turn into errors (not knownfail-able failures) if they were not changed at the same time, so they are changed too. Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01pytest:sddl: handle SDDLValueErrorDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01pytest:security_descriptors: handle SDDLValueErrorDouglas Bagnall1-2/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01pytest: sid_strings: handle SDDLValueErrorDouglas Bagnall1-1/+1
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01tests/krb5: Test device info generated from RODC‐issued tickets without ↵Joseph Sutton1-0/+100
certain SIDs These tests crash Windows, but we can assume reasonable behaviour for Samba. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01tests/krb5: Rename ‘krbtgt_creds’ to ‘rodc_krbtgt_creds’Joseph Sutton1-4/+5
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-11-01tests/krb5: Don’t pass unnecessary parameterJoseph Sutton1-2/+1
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>