3 # Save helper program options
5 require './squid-lib.pl';
6 $access{'hprogs'} || &error($text{'eprogs_ecannot'});
8 &lock_file($config{'squid_conf'});
10 $whatfailed = $text{'sprog_ftshpo'};
12 if ($squid_version < 2) {
13 &save_opt("ftpget_program", \&check_prog, $conf);
14 &save_opt("ftpget_options", \&check_opts, $conf);
17 &save_opt("ftp_list_width", \&check_width, $conf);
19 &save_opt("ftp_user", \&check_ftpuser, $conf);
20 &save_opt("cache_dns_program", \&check_prog, $conf);
21 &save_opt("dns_children", \&check_children, $conf);
22 &save_choice("dns_defnames", "off", $conf);
23 if ($squid_version >= 2) {
24 &save_opt("dns_nameservers", \&check_dnsservers, $conf);
26 &save_opt("unlinkd_program", \&check_prog, $conf);
27 &save_opt("pinger_program", \&check_prog, $conf);
28 if ($squid_version >= 2.6) {
29 &save_opt("url_rewrite_program", \&check_prog, $conf);
30 &save_opt("url_rewrite_children", \&check_children, $conf);
33 &save_opt("redirect_program", \&check_prog, $conf);
34 &save_opt("redirect_children", \&check_children, $conf);
38 &unlock_file($config{'squid_conf'});
39 &webmin_log("progs", undef, undef, \%in);
44 return $_[0] =~ /\S/ ? undef : $text{'sprog_emsg1'};
49 $_[0] =~ /^(\/\S+)/ || return &text('sprog_emsg2', $_[0]);
50 return -x $1 ? undef : &text('sprog_emsg3',$_[0]);
55 return $_[0] =~ /^\S+@\S*$/ ? undef : &text('sprog_emsg4',$_[0]);
60 return $_[0] =~ /^\d+$/ ? undef : &text('sprog_emsg5',$_[0]);
65 return $_[0] =~ /^\d+$/ ? undef : &text('sprog_emsg6',$_[0]);
71 local @dns = split(/\s+/, $_[0]);
72 return $text{'sprog_emsg7'} if (!@dns);
74 &check_ipaddress($dns) || return &text('sprog_emsg8',$dns);