The Identity, Policy and Audit system
CentOS Sources
2016-11-03 403b09ab980c02ef36095973349a13e0181c794a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
From 321bd7bf56109c546a92298d54bcaccfe1289800 Mon Sep 17 00:00:00 2001
From: David Kupka <dkupka@redhat.com>
Date: Thu, 25 Aug 2016 11:53:39 +0200
Subject: [PATCH] otptoken, permission: Convert custom type parameters on
 server
 
Force client to send the value of ipatokenotpkey and ipapermlocation as
entered by user.
 
https://fedorahosted.org/freeipa/ticket/6247
 
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
---
 ipaserver/plugins/otptoken.py   | 2 ++
 ipaserver/plugins/permission.py | 2 ++
 2 files changed, 4 insertions(+)
 
diff --git a/ipaserver/plugins/otptoken.py b/ipaserver/plugins/otptoken.py
index 39012e2f9106c33c520e19f14331fc440333015a..0b4250043618b4f434d2f8b337b88ee396c312ce 100644
--- a/ipaserver/plugins/otptoken.py
+++ b/ipaserver/plugins/otptoken.py
@@ -214,6 +214,8 @@ class otptoken(LDAPObject):
             doc=_('Token secret (Base32; default: random)'),
             default_from=lambda: os.urandom(KEY_LENGTH),
             autofill=True,
+            # force server-side conversion
+            normalizer=lambda x: x,
             flags=('no_display', 'no_update', 'no_search'),
         ),
         StrEnum('ipatokenotpalgorithm?',
diff --git a/ipaserver/plugins/permission.py b/ipaserver/plugins/permission.py
index 830773ae7a09f0197da702e4ec31b0b58f1214dd..0c040ce874534dc4716e700493e547df5b97ea99 100644
--- a/ipaserver/plugins/permission.py
+++ b/ipaserver/plugins/permission.py
@@ -283,6 +283,8 @@ class permission(baseldap.LDAPObject):
             cli_name='subtree',
             label=_('Subtree'),
             doc=_('Subtree to apply permissions to'),
+            # force server-side conversion
+            normalizer=lambda x: x,
             flags={'ask_create'},
         ),
         Str(
-- 
2.7.4