X-Git-Url: http://git.ipfire.org/?p=people%2Fpmueller%2Fipfire-2.x.git;a=blobdiff_plain;f=html%2Fcgi-bin%2Fpppsetup.cgi;fp=html%2Fcgi-bin%2Fpppsetup.cgi;h=519a062bc555344a3b0a400038b6b2f4ed501373;hp=7597bfbc79f34f9392d3df84fcaef51d2696ddd1;hb=46443100e0eaa2bd7a23badc8eaeff9d3a1eca5d;hpb=fa7f2e219a4601e9d72b347afff8b21d34f789c2 diff --git a/html/cgi-bin/pppsetup.cgi b/html/cgi-bin/pppsetup.cgi index 7597bfbc79..519a062bc5 100644 --- a/html/cgi-bin/pppsetup.cgi +++ b/html/cgi-bin/pppsetup.cgi @@ -39,6 +39,8 @@ my %checked=(); my @profilenames=(); my $errormessage = ''; my $maxprofiles = 5; + +# This call is safe, because no user input will be processed. my $kernel=`/bin/uname -r | /usr/bin/tr -d '\012'`; my %color = (); @@ -177,7 +179,12 @@ elsif ($pppsettings{'ACTION'} eq $Lang::tr{'save'}) $errormessage = $Lang::tr{'invalid input'}; goto ERROR; } - if( $pppsettings{'RECONNECTION'} eq 'dialondemand' && `/bin/cat ${General::swroot}/ddns/config` =~ /,on$/m ) { + # Read-in ddns config file, to check if at least one provider is enabled. + open(FILE, "${General::swroot}/ddns/config)"; + my @ddns_config = + close(FILE); + + if( $pppsettings{'RECONNECTION'} eq 'dialondemand' && grep(/on/, @ddns_config) ) { $errormessage = $Lang::tr{'dod not compatible with ddns'}; goto ERROR; } @@ -520,7 +527,12 @@ print </dev/null | grep 0`; +# Read-in atm devices from proc. +open(PROC, "/proc/net/atm/devices"); +my @patm_devices = ; +close(PROC); + +my $atmdev = grep(/0/, @atm_devices); chomp ($atmdev); if ($atmdev ne '') { print </${General::swroot}/ppp/updatesettings"); + close(FILE); } sub writesecrets