summaryrefslogtreecommitdiffstats
path: root/MDK
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2004-12-23 18:18:11 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2004-12-23 18:18:11 +0000
commitf47a0464fb91d87249b43b7232889a57b3249980 (patch)
treed4811145d01cfc5dffa6e0ebb39bda9f064537d8 /MDK
parentb15661de47693aef78d96e2c9d67ae907e3ffed9 (diff)
downloadperl-MDK-Common-f47a0464fb91d87249b43b7232889a57b3249980.tar
perl-MDK-Common-f47a0464fb91d87249b43b7232889a57b3249980.tar.gz
perl-MDK-Common-f47a0464fb91d87249b43b7232889a57b3249980.tar.bz2
perl-MDK-Common-f47a0464fb91d87249b43b7232889a57b3249980.tar.xz
perl-MDK-Common-f47a0464fb91d87249b43b7232889a57b3249980.zip
(setVarsInShMode) consider all files in /home as insecured and use
secured_output() on them
Diffstat (limited to 'MDK')
-rw-r--r--MDK/Common/System.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/MDK/Common/System.pm b/MDK/Common/System.pm
index 235a530..2a03ff7 100644
--- a/MDK/Common/System.pm
+++ b/MDK/Common/System.pm
@@ -339,8 +339,7 @@ sub setVarsInSh {
sub setVarsInShMode {
my ($file, $mod, $l, @fields) = @_;
@fields = keys %$l unless @fields;
-
- MDK::Common::File::output($file,
+ my $string = join('',
map {
my $val = $l->{$_};
if ($val =~ /["`\$]/) {
@@ -353,6 +352,12 @@ sub setVarsInShMode {
"$_=$val\n";
} grep { $l->{$_} } @fields
);
+ if ($file =~ m!^/home/!) {
+ MDK::Common::File::secured_output($file, $string);
+ } else {
+ MDK::Common::File::output($file, $string);
+ }
+
chmod $mod, $file;
}