]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
python: add docstring for escaped_claim_id function
authorRob van der Linde <rob@catalyst.net.nz>
Thu, 26 Oct 2023 23:11:34 +0000 (12:11 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 26 Oct 2023 23:32:34 +0000 (23:32 +0000)
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>
python/samba/sd_utils.py

index 2bddfe518d2c1ecc9db1bea13fba318d362bdfeb..cabbd47b5911d5f39d0d7eb0b3ed15453a9871e8 100644 (file)
@@ -29,6 +29,14 @@ from samba.ntstatus import (
 
 
 def escaped_claim_id(claim_id):
+    """Encode claim attribute names according to [MS-DTYP] 2.5.1 ("attr-char2")
+
+    Some characters must be encoded as %hhhh, while others must not be.
+    Of the optional ones, we encode some control characters.
+
+    The \x00 byte is also encoded, which is useful for tests, but it
+    is forbidden in either form.
+    """
     escapes = '\x00\t\n\x0b\x0c\r !"%&()<=>|'
     return ''.join(c
                    if c not in escapes