diff options
author | Jan Cholasta <jcholast@redhat.com> | 2015-09-03 08:46:59 +0200 |
---|---|---|
committer | Petr Vobornik <pvoborni@redhat.com> | 2015-09-17 14:55:54 +0200 |
commit | 5cf46b89364111b54172682283a6362bb82db9a6 (patch) | |
tree | 54c961d7ed87d409a20a5e55e9a346d5eb18d238 | |
parent | d396913e9c0578fa68847b84e44a4f0dd916fbfd (diff) | |
download | freeipa-5cf46b89364111b54172682283a6362bb82db9a6.tar.gz freeipa-5cf46b89364111b54172682283a6362bb82db9a6.tar.xz freeipa-5cf46b89364111b54172682283a6362bb82db9a6.zip |
vault: set owner to current user on container creation
This reverts commit 419754b1c11139435ae5b5082a51026da0d5e730.
https://fedorahosted.org/freeipa/ticket/5250
Reviewed-By: Petr Vobornik <pvoborni@redhat.com>
-rw-r--r-- | ipalib/plugins/vault.py | 21 |
1 files changed, 1 insertions, 20 deletions
diff --git a/ipalib/plugins/vault.py b/ipalib/plugins/vault.py index e916a0a43..a389e2dab 100644 --- a/ipalib/plugins/vault.py +++ b/ipalib/plugins/vault.py @@ -982,27 +982,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 |