summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-02-25 16:41:38 +0000
committerFrancois Pons <fpons@mandriva.com>2003-02-25 16:41:38 +0000
commit2a8bd94e17d10c6773d87b72dc1b717db7d741a4 (patch)
treeafee5f6f04bebd187f140b7f10e705d753dd0f6c
parent8e58a4d4d8d1066c345585beb5f97d6e9b5eb475 (diff)
downloaddrakx-backup-do-not-use-2a8bd94e17d10c6773d87b72dc1b717db7d741a4.tar
drakx-backup-do-not-use-2a8bd94e17d10c6773d87b72dc1b717db7d741a4.tar.gz
drakx-backup-do-not-use-2a8bd94e17d10c6773d87b72dc1b717db7d741a4.tar.bz2
drakx-backup-do-not-use-2a8bd94e17d10c6773d87b72dc1b717db7d741a4.tar.xz
drakx-backup-do-not-use-2a8bd94e17d10c6773d87b72dc1b717db7d741a4.zip
added login and passwd remember from /etc/ppp/peers/adsl /etc/ppp/options
/etc/ppp/pap-secrets /etc/ppp/chap-secrets file
-rw-r--r--perl-install/network/adsl.pm13
1 files changed, 12 insertions, 1 deletions
diff --git a/perl-install/network/adsl.pm b/perl-install/network/adsl.pm
index 92106940d..e712e24f7 100644
--- a/perl-install/network/adsl.pm
+++ b/perl-install/network/adsl.pm
@@ -73,10 +73,21 @@ sub adsl_ask_info {
my ($adsl, $netc, $_intf, $adsl_type) = @_;
my $pppoe_file = "/etc/ppp/pppoe.conf";
my $pppoe_conf = { getVarsFromSh($pppoe_file) } if $adsl_type =~ /pppoe/ && -f $pppoe_file;
+ my $login = $pppoe_conf->{USER};
+ foreach (qw(/etc/ppp/peers/adsl /etc/ppp/options)) {
+ next if $login && ! -r $_;
+ ($login) = map { if_(/^user\s+\"([^\"]+)\"/, $1) } cat_($_);
+ }
+ my $passwd = passwd_by_login($pppoe_conf->{USER});
+ foreach (qw(/etc/ppp/pap-secrets /etc/ppp/chap-secrets)) {
+ next if $passwd && ! -r $_;
+ my $qlogin = quotemeta $login;
+ ($passwd) = map { if_(/^(['"]?)$qlogin\1\s+\S+\s+(['"]?)(\S*)\2/, $3) } cat_($_);
+ }
$pppoe_conf->{DNS1} ||= '';
$pppoe_conf->{DNS2} ||= '';
add2hash($netc, { dnsServer2 => $pppoe_conf->{DNS1}, dnsServer3 => $pppoe_conf->{DNS2}, DOMAINNAME2 => '' });
- add2hash($adsl, { login => $pppoe_conf->{USER}, passwd => passwd_by_login($pppoe_conf->{USER}), passwd2 => '' });
+ add2hash($adsl, { login => $user, passwd => $passwd, passwd2 => '' });
ask_info2($adsl, $netc);
}