[Freeipa-devel] [PATCH] 0150: make sure SID is always returned as unicode from dcerpc.py

Alexander Bokovoy abokovoy at redhat.com
Wed Mar 12 15:56:50 UTC 2014


Hi,

Trusted domain SID could be obtained through different means. When it is
fetched from the AD DC via LDAP, it needs to be extracted from a default
context and explicitly converted to unicode.

https://fedorahosted.org/freeipa/ticket/4246

-- 
/ Alexander Bokovoy
-------------- next part --------------
>From 8fa83d284052de5e4bc66efbfe6096b5c5b00ccc Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy <abokovoy at redhat.com>
Date: Wed, 12 Mar 2014 17:51:43 +0200
Subject: [PATCH 2/2] ipaserver/dcerpc: make sure to always return unicode SID
 of the trust domain

Trusted domain SID could be obtained through different means. When it is
fetched from the AD DC via LDAP, it needs to be extracted from a default
context and explicitly converted to unicode.

https://fedorahosted.org/freeipa/ticket/4246
---
 ipaserver/dcerpc.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ipaserver/dcerpc.py b/ipaserver/dcerpc.py
index 9e03b34..3b89adc 100644
--- a/ipaserver/dcerpc.py
+++ b/ipaserver/dcerpc.py
@@ -750,7 +750,7 @@ class TrustDomainInstance(object):
 
     def parse_naming_context(self, context):
         naming_ref = re.compile('.*<SID=(S-.*)>.*')
-        return naming_ref.match(context).group(1)
+        return unicode(naming_ref.match(context).group(1))
 
     def retrieve(self, remote_host):
         self.init_lsa_pipe(remote_host)
-- 
1.8.3.1



More information about the Freeipa-devel mailing list