1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
samba-mirror/python/samba
Douglas Bagnall 6347b0c373 pytest: simplify and fix HEXDUMP_FILTER used in hexdumps
The old test

   x if ((len(repr(chr(x))) == 3) and (x < 127)) else ord('.')

went through some contortions to see if the character was printable, and
it got it slightly wrong. The idea was that `repr(chr(97)` is "'a'",
while `repr(chr(167)` is "'\xa7'", which we can distinguish using the
length. But that miscategorised the backslash character, which is
represented as "'\\'", a string of length 4, so it was show as '.'
instead.

Instead we notice that the characters we want to print in a hexdump
are exactly those between 32 and 126, inclusive.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2024-06-12 08:14:34 +00:00
..
domain python: models: add get_primary_group method to User model 2024-05-10 00:26:35 +00:00
emulate py:emulate: remove py2 str/bytes workaround in traffic_packets 2024-06-12 08:14:34 +00:00
gp python: Fix NtVer check for site_dn_for_machine() 2024-04-17 19:32:11 +00:00
gp_parse python: use python3 style super statements 2023-12-15 02:54:34 +00:00
kcc python: pep257: docstring should use double quotes 2023-12-15 02:54:34 +00:00
netcmd samba-tool domain trust: avoid useless use of string_to_byte_array 2024-06-12 08:14:34 +00:00
provision provision: Match Windows 2022 and set msDS-ExpirePasswordsOnSmartCardOnlyAccounts by default 2024-06-10 04:27:31 +00:00
samba3 python:samba:samba3: Fix code spelling 2023-06-23 13:44:31 +00:00
subunit python: use python3 style super statements 2023-12-15 02:54:34 +00:00
tests pytest: simplify and fix HEXDUMP_FILTER used in hexdumps 2024-06-12 08:14:34 +00:00
__init__.py python: Add aead_aes_256_cbc_hmac_sha512() 2024-04-09 22:52:37 +00:00
auth_util.py
colour.py python:colour: Fix exception message 2023-10-13 03:50:31 +00:00
common.py python/common: remove verbiage about old python versions 2024-05-31 00:25:33 +00:00
dbchecker.py python/samba/samdb: Only do caching of well known DNs in dbcheck 2024-02-27 01:11:37 +00:00
descriptor.py CVE-2018-14628: python:descriptor: let samba-tool dbcheck fix the nTSecurityDescriptor on CN=Deleted Objects containers 2023-10-16 14:39:33 +00:00
dnsresolver.py
dnsserver.py python: use python3 style super statements 2023-12-15 02:54:34 +00:00
domain_update.py provision: Match Windows 2022 and set msDS-ExpirePasswordsOnSmartCardOnlyAccounts by default 2024-06-10 04:27:31 +00:00
drs_utils.py python: use python3 style super statements 2023-12-15 02:54:34 +00:00
forest_update.py python: Remove unused imports 2023-08-30 02:15:29 +00:00
functional_level.py python: Remove unnecessary f‐strings 2023-10-25 22:23:37 +00:00
getopt.py python/samba/getopt: don't prompt for a password for --use-krb5-ccache=... 2024-04-23 14:17:32 +00:00
gkdi.py python:gkdi: Add helper methods returning previous and next GKIDs 2024-04-24 05:16:29 +00:00
graph.py python: Fix invalid escape sequences 2023-08-30 02:15:29 +00:00
hostconfig.py
idmap.py python: use python3 style super statements 2023-12-15 02:54:34 +00:00
join.py python:join: avoid useless use of py2-compat string_to_byte_array 2024-06-12 08:14:34 +00:00
logger.py python: use python3 style super statements 2023-12-15 02:54:34 +00:00
lsa_utils.py python:lsa_utils: avoid useless use of py2-compat string_to_byte_array 2024-06-12 08:14:34 +00:00
mdb_util.py python: Remove unused imports 2023-08-30 02:15:29 +00:00
ms_display_specifiers.py python/samba: Avoid resource leak 2023-03-03 01:07:36 +00:00
ms_forest_updates_markdown.py python:samba: Fix code spelling 2023-06-23 14:51:14 +00:00
ms_schema_markdown.py python/samba: adapt ms_schema[_markdown].py to the latest schema definitions 2023-03-22 22:10:32 +00:00
ms_schema.py python/samba: adapt ms_schema[_markdown].py to the latest schema definitions 2023-03-22 22:10:32 +00:00
ndr.py python/samba/ndr: add ndr_deepcopy() helper 2023-03-22 15:01:32 +00:00
nt_time.py python: Reformat code 2024-04-21 22:10:36 +00:00
ntacls.py python: pep257: docstring should use double quotes 2023-12-15 02:54:34 +00:00
policies.py python: pep257: docstring should use double quotes 2023-12-15 02:54:34 +00:00
remove_dc.py python: Fix spelling 2023-08-30 02:15:29 +00:00
safe_tarfile.py python: Remove unused imports 2023-08-30 02:15:29 +00:00
samdb.py python: Move get_admin_sid() to SamDB 2024-04-24 05:16:29 +00:00
schema.py setup/ad-schema: add the latest v1803 and v1903 schema files from Microsoft 2023-03-22 22:10:32 +00:00
sd_utils.py python: sd_utils: pep8 import sorting 2024-03-01 04:45:36 +00:00
sites.py python: Handle LdbError thrown from functions operating on DNs 2022-10-05 04:23:32 +00:00
subnets.py python: Handle LdbError thrown from functions operating on DNs 2022-10-05 04:23:32 +00:00
tdb_util.py samba-tool domain provision: better message if tdbbackup missing 2022-09-06 21:12:36 +00:00
upgrade.py python:upgrade/upgradeprovision: use dn.copy to align ldbs 2024-04-10 05:13:32 +00:00
upgradehelpers.py python:upgrade/upgradeprovision: use dn.copy to align ldbs 2024-04-10 05:13:32 +00:00
uptodateness.py py/uptodateness: more details in missing dn report 2022-07-28 06:18:43 +00:00
xattr.py python/xattr: Properly process system.posix_acl_access 2022-05-10 05:19:34 +00:00