summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2009-06-01 19:04:01 +0200
committerRob Crittenden <rcritten@redhat.com>2009-06-02 16:20:48 -0400
commit83f45cc541cb7efce4d9e9c6d12dadcaf35a0700 (patch)
treebf47e3fe19cc4028f2a32cc9528a40c7df7693fd /ipalib
parent90cc00feab0b7a4be40d945b55c326ef1acecb40 (diff)
downloadfreeipa-83f45cc541cb7efce4d9e9c6d12dadcaf35a0700.tar.gz
freeipa-83f45cc541cb7efce4d9e9c6d12dadcaf35a0700.tar.xz
freeipa-83f45cc541cb7efce4d9e9c6d12dadcaf35a0700.zip
Fix DS ACI parsing.
Diffstat (limited to 'ipalib')
-rwxr-xr-xipalib/aci.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/ipalib/aci.py b/ipalib/aci.py
index a9219f8dc..926334c35 100755
--- a/ipalib/aci.py
+++ b/ipalib/aci.py
@@ -24,13 +24,13 @@ import ldap
# The Python re module doesn't do nested parenthesis
# Break the ACI into 3 pieces: target, name, permissions/bind_rules
-ACIPat = re.compile(r'\s*(\(.*\)+)\s*\(version\s+3.0\s*;\s*acl\s+\"(.*)\"\s*;\s*(.*);\)')
+ACIPat = re.compile(r'\s*(\([^\)]*\)+)\s*\(version\s+3.0\s*;\s*acl\s+\"([^\"]*)\"\s*;\s*([^;]*);\s*\)', re.UNICODE)
# Break the permissions/bind_rules out
-PermPat = re.compile(r'(\w+)\s*\((.*)\)\s+(.*)')
+PermPat = re.compile(r'(\w+)\s*\((.*)\)\s+(.*)', re.UNICODE)
# Break the bind rule out
-BindPat = re.compile(r'([a-zA-Z0-9;\.]+)\s*(\!?=)\s*(.*)')
+BindPat = re.compile(r'([a-zA-Z0-9;\.]+)\s*(\!?=)\s*(.*)', re.UNICODE)
# Don't allow arbitrary attributes to be set in our __setattr__ implementation.
OBJECTATTRS = ["name", "orig_acistr", "target", "action", "permissions",
@@ -96,7 +96,7 @@ class ACI:
return s
def _parse_target(self, aci):
- lexer = shlex.shlex(aci)
+ lexer = shlex.shlex(aci.encode('utf-8'))
lexer.wordchars = lexer.wordchars + "."
l = []
@@ -212,7 +212,7 @@ class ACI:
returns True if equal, False if not.
"""
try:
- if self.name != b.name:
+ if self.name.lower() != b.name.lower():
return False
if set(self.permissions) != set(b.permissions):