X7ROOT File Manager
Current Path:
/usr/libexec/webmin/squid
usr
/
libexec
/
webmin
/
squid
/
📁
..
📄
CHANGELOG
(2.59 KB)
📄
acl.cgi
(10.91 KB)
📄
acl_save.cgi
(8.13 KB)
📄
acl_security.pl
(1.72 KB)
📄
always.cgi
(1.76 KB)
📄
always_save.cgi
(1.17 KB)
📄
backup_config.pl
(732 B)
📄
cachemgr.cgi
(1.03 KB)
📄
calamaris.cgi
(3.09 KB)
📄
cgi_args.pl
(2.23 KB)
📄
chown.cgi
(1.42 KB)
📄
clear.cgi
(2.87 KB)
📄
config-AlmaLinux-7.0-ALL
(439 B)
📄
config-Amazon-Linux-2-ALL
(398 B)
📄
config-CentOS-Linux-7.0-ALL
(398 B)
📄
config-CentOS-Stream-Linux-8.0-ALL
(439 B)
📄
config-Oracle-Linux-8.0-ALL
(439 B)
📄
config-Redhat-Enterprise-Linux-7.0-ALL
(439 B)
📄
config-Rocky-Linux-7.0-ALL
(439 B)
📄
config-Scientific-Linux-7.0-ALL
(398 B)
📄
config-Ubuntu-Linux-16.0-ALL
(447 B)
📄
config-aix
(365 B)
📄
config-cobalt-linux
(364 B)
📄
config-coherent-linux
(422 B)
📄
config-corel-linux
(338 B)
📄
config-debian-linux
(338 B)
📄
config-debian-linux-10.0-ALL
(447 B)
📄
config-debian-linux-3.0-4.9
(344 B)
📄
config-debian-linux-5.0-5.9
(454 B)
📄
config-debian-linux-6.0-6.9
(442 B)
📄
config-debian-linux-7.0-9.0
(449 B)
📄
config-freebsd
(395 B)
📄
config-freebsd-8-ALL
(484 B)
📄
config-generic-linux
(405 B)
📄
config-gentoo-linux
(412 B)
📄
config-hpux
(405 B)
📄
config-irix
(405 B)
📄
config-lfs-linux
(374 B)
📄
config-macos
(405 B)
📄
config-mandrake-linux
(409 B)
📄
config-mandrake-linux-8.0-ALL
(406 B)
📄
config-msc-linux
(422 B)
📄
config-netbsd
(360 B)
📄
config-open-linux
(429 B)
📄
config-open-linux-3.1e
(431 B)
📄
config-openbsd
(395 B)
📄
config-openmamba-linux
(347 B)
📄
config-openserver
(405 B)
📄
config-osf1
(405 B)
📄
config-pardus-linux
(416 B)
📄
config-redhat-linux
(341 B)
📄
config-redhat-linux-24.0-ALL
(439 B)
📄
config-redhat-linux-6.0
(427 B)
📄
config-redhat-linux-6.1-23.0
(420 B)
📄
config-slackware-linux
(405 B)
📄
config-sol-linux
(401 B)
📄
config-solaris
(405 B)
📄
config-solaris-11-ALL
(461 B)
📄
config-suse-linux
(332 B)
📄
config-suse-linux-8.0
(359 B)
📄
config-suse-linux-8.2-ALL
(435 B)
📄
config-trustix-linux
(412 B)
📄
config-turbo-linux
(341 B)
📄
config-united-linux
(435 B)
📄
config-unixware
(405 B)
📄
config.info
(1.16 KB)
📄
config.info.ca
(1.42 KB)
📄
config.info.cs
(924 B)
📄
config.info.de
(1.4 KB)
📄
config.info.es
(1.36 KB)
📄
config.info.fa
(1.57 KB)
📄
config.info.fr
(538 B)
📄
config.info.it
(570 B)
📄
config.info.ja
(1.34 KB)
📄
config.info.nl
(1.35 KB)
📄
config.info.no
(1.22 KB)
📄
config.info.pl
(737 B)
📄
config.info.pt_BR
(1.44 KB)
📄
config.info.ru
(1.39 KB)
📄
config.info.sv
(569 B)
📄
config.info.tr
(369 B)
📄
config.info.uk
(1.41 KB)
📄
config.info.zh
(450 B)
📄
config.info.zh_TW
(355 B)
📄
defaultacl
(228 B)
📄
delete_http_accesses.cgi
(848 B)
📄
delete_http_reply_accesses.cgi
(913 B)
📄
delete_https.cgi
(838 B)
📄
delete_icp_accesses.cgi
(836 B)
📄
delete_icps.cgi
(1.14 KB)
📄
delete_pools.cgi
(1.42 KB)
📄
delete_refreshes.cgi
(840 B)
📄
edit_acl.cgi
(6.99 KB)
📄
edit_admin.cgi
(2.44 KB)
📄
edit_authparam.cgi
(4.62 KB)
📄
edit_cache.cgi
(7.39 KB)
📄
edit_cache_host.cgi
(4.76 KB)
📄
edit_cachemgr.cgi
(1.82 KB)
📄
edit_delay.cgi
(2.86 KB)
📄
edit_ext.cgi
(1.53 KB)
📄
edit_headeracc.cgi
(1.96 KB)
📄
edit_icp.cgi
(5.28 KB)
📄
edit_iptables.cgi
(1.91 KB)
📄
edit_logs.cgi
(4.74 KB)
📄
edit_manual.cgi
(919 B)
📄
edit_mem.cgi
(2.48 KB)
📄
edit_misc.cgi
(3.92 KB)
📄
edit_nauth.cgi
(1.26 KB)
📄
edit_nuser.cgi
(1.46 KB)
📄
edit_pool.cgi
(4.18 KB)
📄
edit_ports.cgi
(3.28 KB)
📄
edit_progs.cgi
(3.06 KB)
📄
edit_refresh.cgi
(1.91 KB)
📁
help
📄
http_access.cgi
(2 KB)
📄
http_access_save.cgi
(1.37 KB)
📄
http_reply_access.cgi
(1.81 KB)
📄
http_reply_access_save.cgi
(1.25 KB)
📄
icp_access.cgi
(1.98 KB)
📄
icp_access_save.cgi
(1.35 KB)
📁
images
📄
index.cgi
(5.54 KB)
📄
init_cache.cgi
(3.03 KB)
📄
install_check.pl
(615 B)
📁
lang
📄
list_headeracc.cgi
(1.71 KB)
📄
list_refresh.cgi
(1.63 KB)
📄
log_parser.pl
(1.27 KB)
📄
module.info
(496 B)
📄
module.info.af
(0 B)
📄
module.info.af.auto
(122 B)
📄
module.info.ar
(0 B)
📄
module.info.ar.auto
(191 B)
📄
module.info.be
(0 B)
📄
module.info.be.auto
(231 B)
📄
module.info.bg
(0 B)
📄
module.info.bg.auto
(249 B)
📄
module.info.ca
(112 B)
📄
module.info.ca.auto
(16 B)
📄
module.info.cs
(27 B)
📄
module.info.cs.auto
(105 B)
📄
module.info.da
(0 B)
📄
module.info.da.auto
(134 B)
📄
module.info.de
(110 B)
📄
module.info.de.auto
(20 B)
📄
module.info.el
(0 B)
📄
module.info.el.auto
(230 B)
📄
module.info.es
(31 B)
📄
module.info.es.auto
(124 B)
📄
module.info.eu
(0 B)
📄
module.info.eu.auto
(138 B)
📄
module.info.fa
(0 B)
📄
module.info.fa.auto
(231 B)
📄
module.info.fi
(0 B)
📄
module.info.fi.auto
(159 B)
📄
module.info.fr
(28 B)
📄
module.info.fr.auto
(127 B)
📄
module.info.he
(0 B)
📄
module.info.he.auto
(194 B)
📄
module.info.hr
(0 B)
📄
module.info.hr.auto
(143 B)
📄
module.info.hu
(0 B)
📄
module.info.hu.auto
(170 B)
📄
module.info.it
(0 B)
📄
module.info.it.auto
(142 B)
📄
module.info.ja
(37 B)
📄
module.info.ja.auto
(147 B)
📄
module.info.ko
(31 B)
📄
module.info.ko.auto
(121 B)
📄
module.info.lt
(0 B)
📄
module.info.lt.auto
(151 B)
📄
module.info.lv
(0 B)
📄
module.info.lv.auto
(159 B)
📄
module.info.ms
(116 B)
📄
module.info.ms.auto
(15 B)
📄
module.info.mt
(0 B)
📄
module.info.mt.auto
(144 B)
📄
module.info.nl
(27 B)
📄
module.info.nl.auto
(98 B)
📄
module.info.no
(0 B)
📄
module.info.no.auto
(131 B)
📄
module.info.pl
(27 B)
📄
module.info.pl.auto
(115 B)
📄
module.info.pt
(29 B)
📄
module.info.pt.auto
(103 B)
📄
module.info.pt_BR
(32 B)
📄
module.info.pt_BR.auto
(109 B)
📄
module.info.ro
(0 B)
📄
module.info.ro.auto
(147 B)
📄
module.info.ru
(40 B)
📄
module.info.ru.auto
(171 B)
📄
module.info.sk
(0 B)
📄
module.info.sk.auto
(181 B)
📄
module.info.sl
(0 B)
📄
module.info.sl.auto
(146 B)
📄
module.info.sv
(26 B)
📄
module.info.sv.auto
(111 B)
📄
module.info.th
(0 B)
📄
module.info.th.auto
(231 B)
📄
module.info.tr
(29 B)
📄
module.info.tr.auto
(132 B)
📄
module.info.uk
(0 B)
📄
module.info.uk.auto
(243 B)
📄
module.info.ur
(0 B)
📄
module.info.ur.auto
(205 B)
📄
module.info.vi
(0 B)
📄
module.info.vi.auto
(147 B)
📄
module.info.zh
(30 B)
📄
module.info.zh.auto
(84 B)
📄
module.info.zh_TW
(33 B)
📄
module.info.zh_TW.auto
(90 B)
📄
move_always.cgi
(762 B)
📄
move_headeracc.cgi
(777 B)
📄
move_http.cgi
(748 B)
📄
move_http_reply.cgi
(797 B)
📄
move_icp.cgi
(736 B)
📄
move_never.cgi
(751 B)
📄
move_pool.cgi
(831 B)
📄
move_refresh.cgi
(822 B)
📄
nat
(34.84 KB)
📄
never.cgi
(1.75 KB)
📄
never_save.cgi
(1.15 KB)
📄
parser-lib.pl
(6.39 KB)
📄
pool_access.cgi
(1.82 KB)
📄
pool_access_save.cgi
(1.17 KB)
📄
purge.cgi
(1.11 KB)
📄
restart.cgi
(381 B)
📄
save_admin.cgi
(2.23 KB)
📄
save_authparam.cgi
(5.29 KB)
📄
save_cache.cgi
(6.03 KB)
📄
save_cache_host.cgi
(3.8 KB)
📄
save_cachemgr.cgi
(1.15 KB)
📄
save_delay.cgi
(656 B)
📄
save_ext.cgi
(2.32 KB)
📄
save_headeracc.cgi
(1.26 KB)
📄
save_icp.cgi
(1.18 KB)
📄
save_iptables.cgi
(2.9 KB)
📄
save_logs.cgi
(3.14 KB)
📄
save_manual.cgi
(493 B)
📄
save_mem.cgi
(1.72 KB)
📄
save_misc.cgi
(2.65 KB)
📄
save_nuser.cgi
(1.89 KB)
📄
save_pool.cgi
(3.19 KB)
📄
save_ports.cgi
(2.59 KB)
📄
save_progs.cgi
(2.55 KB)
📄
save_refresh.cgi
(1.46 KB)
📄
squid-auth.pl
(446 B)
📄
squid-lib.pl
(16.15 KB)
📄
start.cgi
(1.16 KB)
📄
stop.cgi
(881 B)
📄
syslog_logs.pl
(715 B)
📄
useradmin_update.pl
(2.8 KB)
Editing: parser-lib.pl
# parser-lib.pl # Functions for reading and writing the squid config file use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; our (@get_config_cache, %config); # get_config() # Parses squid.conf into an array of data structures sub get_config { if (!@get_config_cache) { my $fh = "CONF"; &open_readfile($fh, $config{'squid_conf'}) || return []; my $lnum = 0; while(my $line = <$fh>) { $line =~ s/\r|\n//g; # strip newlines and comments if ($line =~ /^\s*(\#?\s*|\#\s+TAG:\s+)(\S+)\s*(.*)$/) { my %dir; $dir{'name'} = $2; $dir{'value'} = $3; $dir{'enabled'} = !$1; $dir{'comment'} = $1; my $str = $3; while($str =~ /^\s*("[^"]*")(.*)$/ || $str =~ /^\s*(\S+)(.*)$/) { my $v = $1; $str = $2; if ($v !~ /^"/ && $v =~ /^(.*)#/ && !$dir{'comment'}) { # A comment .. end of values $v = $1; $dir{'postcomment'} = $str; $str = undef; last if ($v eq ''); } $dir{'values'} ||= [ ]; push(@{$dir{'values'}}, $v); } $dir{'line'} = $lnum; $dir{'index'} = scalar(@get_config_cache); if ($dir{'comment'} =~ /TAG/) { $dir{'tag'} = 1; } push(@get_config_cache, \%dir); } $lnum++; } close($fh); } return \@get_config_cache; } # find_config(name, &config, [disabled-mode]) # Returns the structure(s) with some name # disabled mode 0 = only enabled, 1 = both, 2 = only disabled, # 3 = disabled and tags sub find_config { my ($name, $conf, $mode) = @_; $mode ||= 0; my @rv; foreach my $c (@$conf) { if ($c->{'name'} eq $name) { push(@rv, $c); } } if ($mode == 0) { @rv = grep { $_->{'enabled'} && !$_->{'tag'} } @rv; } elsif ($mode == 1) { @rv = grep { !$_->{'tag'} } @rv; } elsif ($mode == 2) { @rv = grep { !$_->{'enabled'} && !$_->{'tag'} } @rv; } elsif ($mode == 3) { @rv = grep { !$_->{'enabled'} } @rv; } return @rv ? wantarray ? @rv : $rv[0] : wantarray ? () : undef; } # find_value(name, &config, [disabled-mode]) # Returns the value of some directive sub find_value { my ($name, $conf, $mode) = @_; my $rv = &find_config($name, $conf, $mode); return $rv ? $rv->{'value'} : undef; } # find_values(name, &config, [disabled-mode]) # Returns the value of some directive sub find_values { my ($name, $conf, $mode) = @_; my $rv = &find_config($name, $conf, $mode); return $rv ? $rv->{'values'} : undef; } # save_value(&config, name, value*) sub save_value { my ($conf, $name, @values) = @_; my @v = map { { 'name' => $name, 'values' => [ $_ ] } } @values; &save_directive($conf, $name, \@v); } # save_directive(&config, name, &values, [after], [before]) # Given a structure containing a directive name, type, values and members # add, update or remove that directive in config structure and data files. sub save_directive { my ($conf, $name, $values, $after, $before) = @_; my @oldv = &find_config($name, $conf); my @newv = map { my %n = %$_; \%n } @$values; my $lref = &read_file_lines($config{'squid_conf'}); my $change = undef; for(my $i=0; $i<@oldv || $i<@newv; $i++) { if ($i >= @oldv) { # a new directive is being added.. my $nl = &directive_line($newv[$i]); my @afterdirs = ref($after) ? ( $after ) : $after ? &find_config($after, $conf) : ( ); my $afterdir = @afterdirs ? $afterdirs[$#afterdirs] : undef; my @beforedirs = ref($before) ? ( $before ) : $before ? &find_config($before, $conf) : ( ); my $beforedir = @beforedirs ? $beforedirs[0] : undef; my @comment = &find_config($_[1], $_[0], 3); my $comment = @comment ? $comment[$#comment] : undef; if ($beforedir) { # put it before the specified type of directive my $blnum = $beforedir->{'line'}; &renumber($conf, $beforedir->{'line'}-1, 1); $newv[$i]->{'line'} = $blnum; splice(@$lref, $newv[$i]->{'line'}, 0, $nl); splice(@$conf, &indexof($beforedir, @$conf), 0, $newv[$i]); } elsif ($change && (!$afterdir || $afterdir->{'line'} < $change->{'line'})) { # put it after any directives of the same type $newv[$i]->{'line'} = $change->{'line'}+1; splice(@$lref, $newv[$i]->{'line'}, 0, $nl); &renumber($conf, $change->{'line'}, 1); splice(@$conf, &indexof($change, @$conf), 0, $newv[$i]); $change = $newv[$i]; } elsif ($comment) { # put it after commented line $newv[$i]->{'line'} = $comment->{'line'}+1; splice(@$lref, $newv[$i]->{'line'}, 0, $nl); &renumber($conf, $comment->{'line'}, 1); splice(@$conf, &indexof($comment, @$conf), 0, $newv[$i]); } else { # put it at the end of the file $newv[$i]->{'line'} = scalar(@$lref); push(@$lref, $nl); push(@$conf, $newv[$i]); } } elsif ($i >= @newv) { # a directive was deleted splice(@$lref, $oldv[$i]->{'line'}, 1); &renumber($conf, $oldv[$i]->{'line'}, -1); splice(@$conf, &indexof($oldv[$i], @$conf), 1); } else { # updating some directive $newv[$i]->{'postcomment'} = $oldv[$i]->{'postcomment'}; my $nl = &directive_line($newv[$i]); my @after = $change && $after ? ( $change ) : # After last one updated ref($after) ? ( $after ) : # After specific $after ? &find_config($after, $conf) : ( ); my $after = @after ? $after[$#after] : undef; if ($after && $oldv[$i]->{'line'} < $after->{'line'}) { # Need to move it after some directive splice(@$lref, $oldv[$i]->{'line'}, 1); splice(@$conf, &indexof($oldv[$i], @$conf), 1); &renumber($conf, $oldv[$i]->{'line'}, -1); splice(@$lref, $after->{'line'}+1, 0, $nl); $newv[$i]->{'line'} = $after->{'line'}+1; splice(@$conf, &indexof($after, @$conf)+1, 0, $newv[$i]); &renumber($conf, $newv[$i]->{'line'}, 1); $change = $newv[$i]; } else { # Can just update at the same line splice(@$lref, $oldv[$i]->{'line'}, 1, $nl); $newv[$i]->{'line'} = $oldv[$i]->{'line'}; $conf->[&indexof($oldv[$i], @$conf)] = $newv[$i]; $change = $newv[$i]; } } } } # directive_line(&details) # Returns the line of text for some directive sub directive_line { my ($d) = @_; my @v = @{$d->{'values'}}; return $d->{'name'}.(@v ? " ".join(' ',@v) : ""). ($d->{'postcomment'} ? " #".$d->{'postcomment'} : ""); } # renumber(&directives, line, count, [end]) # Runs through the given array of directives and increases the line numbers # of all those greater than some line by the given count sub renumber { my ($conf, $line, $count, $end) = @_; foreach my $d (@$conf) { if ($d->{'line'} > $line && (!$end || $d->{'line'} < $end)) { $d->{'line'} += $count; } } } 1;
Upload File
Create Folder