1
0
mirror of synced 2026-04-13 23:23:41 +00:00

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.
This commit is contained in:
Axel Beckert
2013-03-13 23:29:52 +01:00
parent 5342b04ac7
commit 76d9d59510
4 changed files with 16 additions and 4 deletions

View File

@@ -3529,6 +3529,7 @@ sub exportEnvironment
foreach my $key ( keys %CONFIG )
{
$key =~ s/-/_/g;
if ( defined( $CONFIG{ $key } ) )
{
$ENV{ $key } = $CONFIG{ $key };

View File

@@ -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
{

8
debian/NEWS vendored
View File

@@ -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 <abe@debian.org> 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

3
debian/changelog vendored
View File

@@ -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: