summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-27 16:06:18 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-27 16:06:18 +0000
commitcfa6ec26232bc10d83e96f32833e24d0c8d8478d (patch)
treeeee5fba2786dbc16e6b88435d4f1445f6e15c559
parentca60d227ae2946b191b4df07c5f572bee87ec656 (diff)
downloadurpmi-cfa6ec26232bc10d83e96f32833e24d0c8d8478d.tar
urpmi-cfa6ec26232bc10d83e96f32833e24d0c8d8478d.tar.gz
urpmi-cfa6ec26232bc10d83e96f32833e24d0c8d8478d.tar.bz2
urpmi-cfa6ec26232bc10d83e96f32833e24d0c8d8478d.tar.xz
urpmi-cfa6ec26232bc10d83e96f32833e24d0c8d8478d.zip
- urpmi.update, urpmi.addmedia:
o do not restrict read on /etc/urpmi/proxy.cfg if it doesn't contain passwords (#39434)
-rw-r--r--NEWS3
-rw-r--r--urpm/download.pm11
2 files changed, 11 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 93edb1cf..752391d4 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@
o nice error message when hal daemon is not running and is needed (#39327)
- urpmf, urpmq:
o display an error message when /etc/urpmi/proxy.cfg can't be read
+- urpmi.update, urpmi.addmedia:
+ o do not restrict read on /etc/urpmi/proxy.cfg if it doesn't contain
+ passwords (#39434)
Version 5.16 - 25 March 2008, by Pascal "Pixel" Rigaux
diff --git a/urpm/download.pm b/urpm/download.pm
index 801fc980..27f03f98 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -65,22 +65,27 @@ sub load_proxy_config () {
sub dump_proxy_config () {
$proxy_config or return 0; #- hasn't been read yet
+ my $has_password;
+
open my $f, '>', $PROXY_CFG or return 0;
foreach ('', sort grep { !/^(|cmd_line)$/ } keys %$proxy_config) {
my $m = $_ eq '' ? '' : "$_:";
my $p = $proxy_config->{$_};
foreach (qw(http_proxy ftp_proxy)) {
- defined $p->{$_} && $p->{$_} ne ''
- and print $f "$m$_=$p->{$_}\n";
+ if (defined $p->{$_} && $p->{$_} ne '') {
+ print $f "$m$_=$p->{$_}\n";
+ $has_password ||= hide_password($p->{$_}) ne $p->{$_};
+ }
}
if ($p->{ask}) {
print $f "${m}proxy_user_ask\n";
} elsif (defined $p->{user} && $p->{user} ne '') {
print $f "${m}proxy_user=$p->{user}:$p->{pwd}\n";
+ $has_password ||= $p->{pwd};
}
}
close $f;
- chmod 0600, $PROXY_CFG; #- may contain passwords
+ chmod 0600, $PROXY_CFG if $has_password;
return 1;
}