summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}