summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2013-01-31 11:56:00 +0100
committerMartin Kosek <mkosek@redhat.com>2013-03-01 16:59:46 +0100
commit8f46ca5dd20f2e69595dfb3bf9ab11d6f978dfbd (patch)
tree2a5771240b2e3f057009a98baa7fdb4dc1fb5224 /ipalib
parentbb36683c8480a68d54ef632daa0a4d6df9802187 (diff)
downloadfreeipa-8f46ca5dd20f2e69595dfb3bf9ab11d6f978dfbd.tar.gz
freeipa-8f46ca5dd20f2e69595dfb3bf9ab11d6f978dfbd.tar.xz
freeipa-8f46ca5dd20f2e69595dfb3bf9ab11d6f978dfbd.zip
Preserve case of attribute names in LDAPEntry.
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/plugins/baseldap.py5
-rw-r--r--ipalib/plugins/cert.py8
-rw-r--r--ipalib/plugins/pwpolicy.py6
3 files changed, 11 insertions, 8 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index da89ad6f3..20ae1cbee 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -230,7 +230,10 @@ def entry_from_entry(entry, newentry):
entry[e] = newentry[e]
def entry_to_dict(entry, **options):
- result = dict(entry)
+ if options.get('raw', False):
+ result = dict(entry)
+ else:
+ result = dict((k.lower(), v) for (k, v) in entry.iteritems())
if options.get('all', False):
result['dn'] = entry.dn
return result
diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py
index 6b84c7235..a441a92ae 100644
--- a/ipalib/plugins/cert.py
+++ b/ipalib/plugins/cert.py
@@ -346,11 +346,11 @@ class cert_request(VirtualCommand):
# going to add it
try:
if not principal.startswith('host/'):
- service = api.Command['service_show'](principal, all=True, raw=True)['result']
+ service = api.Command['service_show'](principal, all=True)['result']
dn = service['dn']
else:
hostname = get_host_from_principal(principal)
- service = api.Command['host_show'](hostname, all=True, raw=True)['result']
+ service = api.Command['host_show'](hostname, all=True)['result']
dn = service['dn']
except errors.NotFound, e:
if not add:
@@ -375,7 +375,7 @@ class cert_request(VirtualCommand):
for name in subjectaltname:
name = unicode(name)
try:
- hostentry = api.Command['host_show'](name, all=True, raw=True)['result']
+ hostentry = api.Command['host_show'](name, all=True)['result']
hostdn = hostentry['dn']
except errors.NotFound:
# We don't want to issue any certificates referencing
@@ -385,7 +385,7 @@ class cert_request(VirtualCommand):
'subject alt name %s in certificate request') % name)
authprincipal = getattr(context, 'principal')
if authprincipal.startswith("host/"):
- if not hostdn in service.get('managedby', []):
+ if not hostdn in service.get('managedby_host', []):
raise errors.ACIError(info=_(
"Insufficient privilege to create a certificate "
"with subject alt name '%s'.") % name)
diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py
index 5ae07c40d..6c8ad8dbf 100644
--- a/ipalib/plugins/pwpolicy.py
+++ b/ipalib/plugins/pwpolicy.py
@@ -305,12 +305,12 @@ class pwpolicy(LDAPObject):
existing_entry = {}
if not add: # then read existing entry
existing_entry = self.api.Command.pwpolicy_show(keys[-1],
- all=True, raw=True,
+ all=True,
)['result']
if minlife is None and 'krbminpwdlife' in existing_entry:
- minlife = int(existing_entry['krbminpwdlife'][0])
+ minlife = int(existing_entry['krbminpwdlife'][0]) * 3600
if maxlife is None and 'krbmaxpwdlife' in existing_entry:
- maxlife = int(existing_entry['krbmaxpwdlife'][0])
+ maxlife = int(existing_entry['krbmaxpwdlife'][0]) * 86400
if maxlife is not None and minlife is not None:
if minlife > maxlife: