[Pkg-libvirt-commits] [libguestfs] 09/24: customize: fix locking accounts with passwords

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:41:02 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to branch master
in repository libguestfs.

commit 8ef3efeceeac79a715bab657c515e4fb63898462
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Thu Sep 4 13:42:20 2014 +0200

    customize: fix locking accounts with passwords
    
    When setting the password for a locked account, make sure to still write
    the password after the "!!" marker, otherwise the account will have no
    password.
    
    (cherry picked from commit ba65af34357eb79e37480758416cdc4e184689aa)
---
 customize/password.ml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/customize/password.ml b/customize/password.ml
index d76ebea..84af0c3 100644
--- a/customize/password.ml
+++ b/customize/password.ml
@@ -109,13 +109,13 @@ let rec set_linux_passwords ~prog ?password_crypto g root passwords =
             match selector with
             | { pw_locked = locked;
                 pw_password = Password password } ->
-              if locked then "!!" else "" ^ encrypt password crypto
+              (if locked then "!!" else "") ^ encrypt password crypto
             | { pw_locked = locked;
                 pw_password = Random_password } ->
               let password = make_random_password () in
               printf (f_"Setting random password of %s to %s\n%!")
                 user password;
-              if locked then "!!" else "" ^ encrypt password crypto
+              (if locked then "!!" else "") ^ encrypt password crypto
             | { pw_locked = true; pw_password = Disabled_password } -> "!!*"
             | { pw_locked = false; pw_password = Disabled_password } -> "*" in
           user ^ ":" ^ pwfield ^ rest

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list