s3_upgrade: Do not add administrator and root accounts from s3 to s4
authorAmitay Isaacs <amitay@gmail.com>
Fri, 19 Aug 2011 02:33:15 +0000 (12:33 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 19 Aug 2011 06:35:10 +0000 (16:35 +1000)
Need to copy the password from s3 for administrator/root to s4.

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
source4/scripting/python/samba/upgrade.py

index 62266818304fa64ba201e905eb4bbe7b9baf2aee..ed13d101e99d6be1f585fc80392fce4200875dbd 100644 (file)
@@ -637,6 +637,8 @@ def upgrade_from_samba3(samba3, logger, session_info, smbconf, targetdir):
     # Export users to samba4 backend
     logger.info("Importing users")
     for username in userdata:
     # Export users to samba4 backend
     logger.info("Importing users")
     for username in userdata:
+        if username.lower() == 'administrator' or username.lower() == 'root':
+            continue
         new_passdb.add_sam_account(userdata[username])
         if username in uids:
             add_idmap_entry(result.idmap, userdata[username].user_sid, uids[username], "UID", logger)
         new_passdb.add_sam_account(userdata[username])
         if username in uids:
             add_idmap_entry(result.idmap, userdata[username].user_sid, uids[username], "UID", logger)