]> git.siccegge.de Git - forks/vmdebootstrap.git/blobdiff - vmdebootstrap
Fix copyright statements
[forks/vmdebootstrap.git] / vmdebootstrap
index c8fc426c1d8ec295fc150069beb63980a7cdac43..e129b215362b864c0a84ee0781a574f06855ad32 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/python
-# Copyright 2011  Lars Wirzenius
+# Copyright 2011, 2012  Lars Wirzenius
+# Copyright 2012  Codethink Limited
 # 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -237,7 +238,7 @@ class VmDebootstrap(cliapp.Application):
             self.runcmd(['chroot', rootdir, 'passwd', '-l', 'root'])
         else:
             self.message('Give root an empty password')
-            self.runcmd(['chroot', rootdir, 'passwd', '-d', 'root'])
+            self.delete_password(rootdir, 'root')
 
     def create_users(self, rootdir):
         def create_user(user):
@@ -253,11 +254,15 @@ class VmDebootstrap(cliapp.Application):
                 self.set_password(rootdir, user, password)
             else:
                 create_user(userpass)
+                self.delete_password(rootdir, userpass)
 
     def set_password(self, rootdir, user, password):
         encrypted = crypt.crypt(password, '..')
         self.runcmd(['chroot', rootdir, 'usermod', '-p', encrypted, user])
 
+    def delete_password(self, rootdir, user):
+        self.runcmd(['chroot', rootdir, 'passwd', '-d', user])
+
     def remove_udev_persistent_rules(self, rootdir):
         self.message('Removing udev persistent cd and net rules')
         for x in ['70-persistent-cd.rules', '70-persistent-net.rules']: