From 76d9d5951058f64fa5eff32676308e12fd4fe7a7 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 13 Mar 2013 23:29:52 +0100 Subject: [PATCH] Fix export of environment variables (dash vs underscore) Previously they could contain dashes and then were only accessible from within Perl, but not from within Bash. From now on potential dashes in environment variable names are converted to underscores ("_") before being exported. May affect some hook or role scripts. --- bin/xen-create-image | 1 + bin/xt-create-xen-config | 8 ++++---- debian/NEWS | 8 ++++++++ debian/changelog | 3 +++ 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/bin/xen-create-image b/bin/xen-create-image index df84fad..6417a5b 100755 --- a/bin/xen-create-image +++ b/bin/xen-create-image @@ -3529,6 +3529,7 @@ sub exportEnvironment foreach my $key ( keys %CONFIG ) { + $key =~ s/-/_/g; if ( defined( $CONFIG{ $key } ) ) { $ENV{ $key } = $CONFIG{ $key }; diff --git a/bin/xt-create-xen-config b/bin/xt-create-xen-config index 1c7e8dd..5e82a62 100755 --- a/bin/xt-create-xen-config +++ b/bin/xt-create-xen-config @@ -398,13 +398,13 @@ sub createXenConfig $ENV{ 'image_suffix' } = ''; importPartitionsFromEnvironment(); } - elsif ( $ENV{ 'image-dev' } ) + elsif ( $ENV{ 'image_dev' } ) { - $ENV{ 'image_vbd' } = "phy:$ENV{'image-dev'}"; + $ENV{ 'image_vbd' } = "phy:$ENV{'image_dev'}"; - if ( $ENV{ 'swap-dev' } ) + if ( $ENV{ 'swap_dev' } ) { - $ENV{ 'swap_vbd' } = "phy:$ENV{'swap-dev'}"; + $ENV{ 'swap_vbd' } = "phy:$ENV{'swap_dev'}"; } else { diff --git a/debian/NEWS b/debian/NEWS index 8106222..b080580 100644 --- a/debian/NEWS +++ b/debian/NEWS @@ -1,3 +1,11 @@ +xen-tools (4.4~dev-1) UNRELEASED; urgency=low + + * Exported environment variables no more contain dashes ("-"). Dashes in + environment variable names are from now on converted to underscores + ("_") before being exported. May affect some hook or role scripts. + + -- Axel Beckert Wed, 13 Mar 2013 23:22:20 +0100 + xen-tools (4.2~rc1-1) unstable; urgency=low By default, xen-create-image now generates a random root password and diff --git a/debian/changelog b/debian/changelog index bb7db7b..da998d3 100644 --- a/debian/changelog +++ b/debian/changelog @@ -38,6 +38,9 @@ xen-tools (4.4~dev-1) UNRELEASED; urgency=low - Fix filesystem tools installation in 91-install-fs-tools (which was broken since 4.3~rc1-1) by merging 91-install-fs-tools back into 90-make-fstab. Also supports RPM-based distributions now. + - Fix export of environment variables. Previously they could contain + dashes and then were only accessible from within Perl, but not from + within Bash. * Add debian/gbp.conf to be able to to build xen-tools with git-buildpackage. * Clean up debian/rules: