-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/20/2009 01:54 PM, Stephen Gallagher wrote:
>> [PATCH 6/6] upgrade_config fixes for SSSD 0.6 and later
>> > Incorporates changes we made to v2 after 0.6, or that were missed by the
>> > original upgrade script:
>> >  * removes magic_private_groups option
>> >  * removes libPath option
>> >  * changes provider=files to provider=proxy proxy_lib_name=files
> Nack.
> 
> Still missing the conversion from store-legacy-passwords to
> store_legacy_passwords. Otherwise fine.
> 

True, I forgot to add this one. New patch attached.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAksGmlQACgkQHsardTLnvCWlzACgsyKKO5n+w+Ddy13YvTYIciHp
PMUAnRwbEeTYztRRd6MyMP8bHfJZb0l6
=CKbA
-----END PGP SIGNATURE-----
>From c99058651babce4dfb43343f2bc7f125e673c57d Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <[email protected]>
Date: Thu, 19 Nov 2009 19:34:28 +0100
Subject: [PATCH 6/6] upgrade_config fixes for SSSD 0.6 and later

Incorporates changes we made to v2 after 0.6, or that were missed by the
original upgrade script:
 * removes magic_private_groups option
 * removes libPath option
 * changes provider=files to provider=proxy proxy_lib_name=files
 * changes store-legacy-passwords to store_legacy_passwords
---
 server/config/upgrade_config.py |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/server/config/upgrade_config.py b/server/config/upgrade_config.py
index 71af6da..0975821 100644
--- a/server/config/upgrade_config.py
+++ b/server/config/upgrade_config.py
@@ -69,6 +69,10 @@ class SSSDConfigFile(SSSDChangeConf):
             srvlist['value'] = ", ".join([srv for srv in services])
         self.delete_option('section', 'dp')
 
+        # remove magic_private_groups from all domains
+        for domain in [ s for s in self.sections() if s['name'].startswith("domain/") ]:
+            self.delete_option_subtree(domain['value'], 'option', 'magic_private_groups')
+
     def _update_option(self, to_section_name, from_section_name, opts):
         to_section = [ s for s in self.sections() if s['name'].strip() == to_section_name ]
         from_section = [ s for s in self.sections() if s['name'].strip() == from_section_name ]
@@ -120,6 +124,7 @@ class SSSDConfigFile(SSSDChangeConf):
                        'access_provider' : 'access-module',
                        'chpass_provider' : 'chpass-module',
                        'use_fully_qualified_names' : 'useFullyQualifiedNames',
+                       'store_legacy_passwords' : 'store-legacy-passwords',
                       }
         # Proxy options
         proxy_kw = { 'proxy_pam_target' : 'pam-target',
@@ -183,21 +188,34 @@ class SSSDConfigFile(SSSDChangeConf):
         self.rename_opts(domain['name'], ldap_kw)
         self.rename_opts(domain['name'], krb5_kw)
 
+        # remove obsolete libPath option
+        self.delete_option_subtree(domain['value'], 'option', 'libPath')
+
         # configuration files before 0.5.0 did not enforce provider= in local domains
         # it did special-case by domain name (LOCAL)
-        prv = self.findOpts(domain['value'], 'option', 'id_provider')[1]
+        prvindex, prv = self.findOpts(domain['value'], 'option', 'id_provider')
         if not prv and domain['name'] == 'domain/LOCAL':
             prv = { 'type'  : 'option',
                     'name'  : 'id_provider',
                     'value' : 'local',
                   }
             domain['value'].insert(0, prv)
+
         # if domain was local, update with parameters from [user_defaults]
         if prv['value'] == 'local':
             self._update_option(domain['name'], 'user_defaults', user_defaults_kw.values())
             self.delete_option('section', 'user_defaults')
             self.rename_opts(domain['name'], user_defaults_kw)
 
+        # if domain had provider = files, unroll that into provider=proxy, proxy_lib_name=files
+        if prv['value'] == 'files':
+            prv['value'] = 'proxy'
+            libkw = { 'type'  : 'option',
+                      'name'  : 'proxy_lib_name',
+                      'value' : 'files',
+                    }
+            domain['value'].insert(prvindex+1, libkw)
+
     def _migrate_domains(self):
         for domain in [ s for s in self.sections() if s['name'].startswith("domains/") ]:
             self._migrate_domain(domain)
-- 
1.6.2.5

_______________________________________________
sssd-devel mailing list
[email protected]
https://fedorahosted.org/mailman/listinfo/sssd-devel

Reply via email to