From 8defa7ddd68ade04f71254fc86762ac235721cce Mon Sep 17 00:00:00 2001 From: Jan Cholasta Date: Thu, 3 Sep 2015 08:46:59 +0200 Subject: [PATCH] vault: set owner to current user on container creation This reverts commit 419754b1c11139435ae5b5082a51026da0d5e730. https://fedorahosted.org/freeipa/ticket/5250 Reviewed-By: Petr Vobornik --- ipalib/plugins/vault.py | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py index 733741dfc2c87995055599cc3816f321ec344496..d9551c2f0cfc16973131c61db45bc606d2844fb6 100644 --- a/ipalib/plugins/vault.py +++ b/ipalib/plugins/vault.py @@ -981,27 +981,8 @@ class vault_add_internal(LDAPCreate): parent_dn = DN(*dn[1:]) - container_dn = DN(self.api.Object.vault.container_dn, - self.api.env.basedn) - - services_dn = DN(('cn', 'services'), container_dn) - users_dn = DN(('cn', 'users'), container_dn) - - if dn.endswith(services_dn): - # service container should be owned by the service - service = parent_dn[0]['cn'] - parent_owner_dn = self.api.Object.service.get_dn(service) - - elif dn.endswith(users_dn): - # user container should be owned by the user - user = parent_dn[0]['cn'] - parent_owner_dn = self.api.Object.user.get_dn(user) - - else: - parent_owner_dn = owner_dn - try: - self.obj.create_container(parent_dn, parent_owner_dn) + self.obj.create_container(parent_dn, owner_dn) except errors.DuplicateEntry as e: pass -- 2.4.3