pgreco / rpms / ipa

Forked from forks/areguera/rpms/ipa 4 years ago
Clone

Blame SOURCES/0124-vault-set-owner-to-current-user-on-container-creatio.patch

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