mirror of
https://github.com/samba-team/samba.git
synced 2025-12-13 16:23:50 +03:00
python: move method escaped_claim_id from test to samba.sd_utils
This is so that it can be used in other places too without the need to import or extend the test base class 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>
This commit is contained in:
committed by
Andrew Bartlett
parent
47f5bc78b8
commit
16d52aa559
@@ -28,6 +28,14 @@ from samba.ntstatus import (
|
||||
)
|
||||
|
||||
|
||||
def escaped_claim_id(claim_id):
|
||||
escapes = '\x00\t\n\x0b\x0c\r !"%&()<=>|'
|
||||
return ''.join(c
|
||||
if c not in escapes
|
||||
else f'%{ord(c):04x}'
|
||||
for c in claim_id)
|
||||
|
||||
|
||||
class SDUtils(object):
|
||||
"""Some utilities for manipulation of security descriptors on objects."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user