From 5d7e059668562b510ef024953802bed66a08ef3e Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 8 Oct 2014 13:23:11 +0200 Subject: [PATCH] --password overrides --genpass Closes: #764143 Based on patch by Santiago Vila. --- bin/xen-create-image | 11 ++++++++--- debian/changelog | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index 12523b5..d6604cc 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -164,6 +164,7 @@ and EVMS EXAMPLE. --password=passphrase Set the root password for the new guest. + Note: This overrides --genpass --(no)passwd (Don't) ask for a root password interactively during setup. NOTE: This overrides --genpass --password. @@ -1287,7 +1288,7 @@ sub setupDefaultOptions # $CONFIG{ 'genpass' } = 1; $CONFIG{ 'genpass_len' } = 8; - $CONFIG{ 'password' } = ''; + $CONFIG{ 'password' } = undef; $CONFIG{ 'hash_method' } = 'sha256'; # @@ -3886,13 +3887,17 @@ sub setupRootPassword # # Generate a password, salt and use that to generating a hash # - if ( $CONFIG{ 'genpass' } ) + if ( defined( $CONFIG{ 'password' } ) ) + { + $PASSWORD = $CONFIG { 'password' }; + } + elsif ( $CONFIG{ 'genpass' } ) { $PASSWORD = generatePassword( $CONFIG{ 'genpass_len' } ); } else { - $PASSWORD = $CONFIG { 'password' }; + fail("oops... neither passwd nor password nor genpass are set, should not happen!"); } my $salt = generatePassword(8); diff --git a/debian/changelog b/debian/changelog index a34f964..7ec0669 100644 --- a/debian/changelog +++ b/debian/changelog @@ -20,6 +20,8 @@ xen-tools (4.4+dev-1) UNRELEASED; urgency=low + Fix missing quoting in shell function "assert" in hooks/common.sh. + Fix initial configuration summary in cases where pygrub is used. + Fix corner cases where not the latest kernel would have been checked. + + --password overrides --genpass. (Closes: #764143) Based on patch by + Santiago Vila. [ Santiago Vila ] + Fix unaligned maxmem output of xen-create-image. (Closes: #764126)