summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2005-01-05 10:48:43 +0000
committerPascal Rigaux <pixel@mandriva.com>2005-01-05 10:48:43 +0000
commit80c54d5ea9cdd5d1237adb563db70077b5d5f0ec (patch)
treea9205e6ed96eab4eae9a2b6e3b31c4acc465e570
parentab37fdcc5ebfe36dd23a591b4c62989869d9c705 (diff)
downloaddrakx-80c54d5ea9cdd5d1237adb563db70077b5d5f0ec.tar
drakx-80c54d5ea9cdd5d1237adb563db70077b5d5f0ec.tar.gz
drakx-80c54d5ea9cdd5d1237adb563db70077b5d5f0ec.tar.bz2
drakx-80c54d5ea9cdd5d1237adb563db70077b5d5f0ec.tar.xz
drakx-80c54d5ea9cdd5d1237adb563db70077b5d5f0ec.zip
handle spaces in username
-rw-r--r--perl-install/fs.pm6
-rw-r--r--perl-install/network/smb.pm4
2 files changed, 4 insertions, 6 deletions
diff --git a/perl-install/fs.pm b/perl-install/fs.pm
index a797977d6..0f757f888 100644
--- a/perl-install/fs.pm
+++ b/perl-install/fs.pm
@@ -69,8 +69,7 @@ sub read_fstab {
# prefering type "smbfs" over "smb"
$fs_type = 'smbfs';
}
- $mntpoint =~ s/\\040/ /g;
- $dev =~ s/\\040/ /g;
+ s/\\040/ /g foreach $mntpoint, $dev, $options;
my $h = {
mntpoint => $mntpoint, fs_type => $fs_type,
@@ -330,8 +329,7 @@ sub prepare_write_fstab {
my $fs_type = $_->{fs_type} || 'auto';
- $mntpoint =~ s/ /\\040/g;
- $device =~ s/ /\\040/g;
+ s/ /\\040/g foreach $mntpoint, $device, $options;
# handle bloody supermount special case
if ($options =~ /supermount/) {
diff --git a/perl-install/network/smb.pm b/perl-install/network/smb.pm
index af201fe68..ef98f6945 100644
--- a/perl-install/network/smb.pm
+++ b/perl-install/network/smb.pm
@@ -39,11 +39,11 @@ sub smbclient {
my ($server) = @_;
my $name = $server->{name} || $server->{ip};
my $ip = $server->{ip} ? "-I $server->{ip}" : '';
- my $group = $server->{group} ? " -W $server->{group}" : '';
+ my $group = $server->{group} ? qq( -W "$server->{group}") : '';
my $U = $server->{username} ? sprintf("%s/%s%%%s", @$server{'domain', 'username', 'password'}) : '%';
my %h;
- foreach (`smbclient -g -U $U -L $name $ip$group 2>/dev/null`) {
+ foreach (`smbclient -g -U "$U" -L "$name" $ip$group 2>/dev/null`) {
if (my ($type, $v1, $v2) = /(.*)\|(.*)\|(.*)/) {
push @{$h{$type}}, [ $v1, $v2 ];
} elsif (/^Error returning browse list/) {