Hi,

the attached patch fixes <https://fedorahosted.org/freeipa/ticket/5361>.

Honza

--
Jan Cholasta
From b9a05d4123a419a56ffa6762b6a8f1a3a660a62e Mon Sep 17 00:00:00 2001
From: Jan Cholasta <jchol...@redhat.com>
Date: Tue, 13 Oct 2015 10:10:48 +0200
Subject: [PATCH] vault: fix service name normalization

https://fedorahosted.org/freeipa/ticket/5361
---
 ipalib/plugins/vault.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py
index b5bd50b..2a22a6b 100644
--- a/ipalib/plugins/vault.py
+++ b/ipalib/plugins/vault.py
@@ -236,6 +236,12 @@ def validated_read(argname, filename, mode='r', encoding=None):
     return data
 
 
+def normalize_service(principal):
+    principal = normalize_principal(principal)
+    service, realm = split_principal(principal)
+    return service
+
+
 register = Registry()
 
 MAX_VAULT_DATA_SIZE = 2**20  # = 1 MB
@@ -244,7 +250,7 @@ vault_options = (
     Str(
         'service?',
         doc=_('Service name of the service vault'),
-        normalizer=normalize_principal,
+        normalizer=normalize_service,
     ),
     Flag(
         'shared?',
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to