From 48eb74c3d2e93715b0ac483a3e1f638c674ceca0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 29 Jul 2002 10:55:31 +0000 Subject: - use $::prefix for reading/writing (it was missing for writing) - use output_p so that /etc/samba directory is created if needed (fix bug reported by David Eastcott) --- perl-install/fs.pm | 2 +- perl-install/network/smb.pm | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/perl-install/fs.pm b/perl-install/fs.pm index a8789c6f3..00c3f0e65 100644 --- a/perl-install/fs.pm +++ b/perl-install/fs.pm @@ -91,7 +91,7 @@ sub read_fstab { #- the other way is done in fstab_to_string my ($options, $unknown) = mount_options_unpack($h); my $file = delete $options->{'credentials='}; - my $credentials = network::smb::read_credentials_raw("$prefix$file"); + my $credentials = network::smb::read_credentials_raw($file); if ($credentials->{username}) { $options->{"$_="} = $credentials->{$_} foreach qw(username password domain); mount_options_pack($h, $options, $unknown); diff --git a/perl-install/network/smb.pm b/perl-install/network/smb.pm index d212f5122..abf742800 100644 --- a/perl-install/network/smb.pm +++ b/perl-install/network/smb.pm @@ -131,14 +131,14 @@ sub remove_bad_credentials { sub save_credentials { my ($credentials) = @_; my $file = $credentials->{file}; - output($file, map { "$_ = $credentials->{$_}\n" } qw(username domain password)); - chmod(0640, $file); + output_p($file, map { "$_ = $credentials->{$_}\n" } qw(username domain password)); + chmod(0640, "$::prefix$file"); } sub read_credentials_raw { my ($file) = @_; - my %h = map { /(.*?)\s*=\s*(.*)/ } cat_($file); + my %h = map { /(.*?)\s*=\s*(.*)/ } cat_("$::prefix$file"); \%h; } -- cgit v1.2.1