# list_services() # Returns a list of services from the services file, each being an array of # line name port protocol aliases index sub list_services { local(@rv, $l); $l = 0; system("$config{'get_services_command'}") if ($config{'get_services_command'}); open(SERVICES, "<".$config{services_file}); while(<SERVICES>) { chop; s/#.*$//g; if (/^(\S+)\s+([0-9]+)\/(\S+)\s*(.*)$/) { push(@rv, [ $l, $1, $2, $3, $4, scalar(@rv) ]); if ($config{'ipv6'}) { push(@rv, [ $l, $1, $2, $3.'6', $4, scalar(@rv) ]); } } $l++; } close(SERVICES); return @rv; } # create_service(name, port, proto, aliases) # Add a new service to the list sub create_service { local $p = $_[2]; if ($config{'ipv6'} && $p =~ /^(\S+)6$/) { # don't add the service if it is already there foreach $s (&list_services()) { return if ($s->[1] eq $_[0] && $s->[2] == $_[1] && $s->[3] eq $1); } $p =~ s/6$//; } &open_tempfile(SERVICES, ">> $config{services_file}"); &print_tempfile(SERVICES, "$_[0]\t$_[1]/$p",$_[3] ? "\t$_[3]\n" : "\n"); &close_tempfile(SERVICES); system("$config{'put_services_command'}") if ($config{'put_services_command'}); } # modify_service(line, name, port, proto, aliases) # Change an existing service sub modify_service { local(@serv); open(SERVICES, "<".$config{services_file}); @serv = <SERVICES>; close(SERVICES); $serv[$_[0]] = "$_[1]\t$_[2]/$_[3]".($_[4] ? "\t$_[4]\n" : "\n"); &open_tempfile(SERVICES, "> $config{services_file}"); &print_tempfile(SERVICES, @serv); &close_tempfile(SERVICES); system("$config{'put_services_command'}") if ($config{'put_services_command'}); } # delete_service(line) sub delete_service { local(@serv); open(SERVICES, "<".$config{services_file}); @serv = <SERVICES>; close(SERVICES); splice(@serv, $_[0], 1); &open_tempfile(SERVICES, "> $config{services_file}"); &print_tempfile(SERVICES, @serv); &close_tempfile(SERVICES); system("$config{'put_services_command'}") if ($config{'put_services_command'}); } # list_protocols() # Returns a list of supported protocols on this system sub list_protocols { local(@rv); open(PROT, "<".$config{protocols_file}); while(<PROT>) { chop; s/#.*$//g; if (!/\S/) { next; } /^(\S+)\s+/; push(@rv, $1); if ($config{'ipv6'}) { if ($1 eq 'tcp') { push(@rv, 'tcp6'); } elsif ($1 eq 'udp') { push(@rv, 'udp6'); } } } close(PROT); return &unique(@rv); } # list_inets() # Returns a list of service details handled by inetd. RPC services # will have a name like foo/1 or bar/1-3, where the thing after the / is # the version or versions supported. For each service, the list contains # line active? rpc? name type protocol wait user path|internal args file sub list_inets { # build list of inetd files local (@files, @rv, $l); @files = ( $config{'inetd_conf_file'} ); opendir(DIR, $config{'inetd_dir'}); foreach $f (readdir(DIR)) { next if ($f =~ /^\./); push(@files, "$config{'inetd_dir'}/$f"); } closedir(DIR); # parse each file foreach $f (@files) { $l = 0; open(INET, "<".$f); while(<INET>) { chop; if (/^(#+|#<off>#)?\s*(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\??\/\S+|internal)\s*(.*)$/) { push(@rv, [ $l, !$1, 0, $2, $3, $4, $5, $6, $7, $8, $f ]); $rv[$#rv]->[2] = ($2 =~ /\//); } $l++; } close(INET); } return @rv; } # create_inet(enabled, name, type, protocol, wait, user, program, args) # Add a new service to the main inetd config file sub create_inet { &open_tempfile(INET, ">> $config{inetd_conf_file}"); &print_tempfile(INET, ($_[0] ? "" : "#")."$_[1]\t$_[2]\t$_[3]\t$_[4]\t$_[5]\t$_[6]". ($_[7] ? "\t$_[7]\n" : "\n")); &close_tempfile(INET); } # modify_inet(line, enabled, name, type, protocol, # wait, user, program, args, file) # Modify an existing inetd service sub modify_inet { local(@inet); open(INET, "<".$_[9]); @inet = <INET>; close(INET); $inet[$_[0]] = ($_[1] ? "" : "#")."$_[2]\t$_[3]\t$_[4]\t$_[5]\t$_[6]\t$_[7]". ($_[8] ? "\t$_[8]\n" : "\n"); &open_tempfile(INET, ">$_[9]"); &print_tempfile(INET, @inet); &close_tempfile(INET); } # delete_inet(line, file) # Delete an internet service at some line sub delete_inet { local(@inet); open(INET, "<".$_[1]); @inet = <INET>; close(INET); splice(@inet, $_[0], 1); &open_tempfile(INET, ">$_[1]"); &print_tempfile(INET, @inet); &close_tempfile(INET); } %prot_name = ("ip", "Internet Protocol", "tcp", "Transmission Control Protocol", "udp", "User Datagram Protocol", "tcp6", "Transmission Control Protocol IPv6", "udp6", "User Datagram Protocol IPv6"); 1;
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
help | Folder | 0755 |
|
|
images | Folder | 0755 |
|
|
lang | Folder | 0755 |
|
|
CHANGELOG | File | 173 B | 0644 |
|
backup_config.pl | File | 754 B | 0755 |
|
cgi_args.pl | File | 145 B | 0755 |
|
config-aix | File | 302 B | 0644 |
|
config-cobalt-linux | File | 331 B | 0644 |
|
config-coherent-linux | File | 362 B | 0644 |
|
config-corel-linux | File | 331 B | 0644 |
|
config-debian-linux | File | 331 B | 0644 |
|
config-freebsd | File | 252 B | 0644 |
|
config-freebsd-2.1-2.2 | File | 252 B | 0644 |
|
config-freebsd-8-ALL | File | 262 B | 0644 |
|
config-generic-linux | File | 277 B | 0644 |
|
config-hpux | File | 242 B | 0644 |
|
config-irix | File | 252 B | 0644 |
|
config-lfs-linux | File | 331 B | 0644 |
|
config-macos | File | 469 B | 0644 |
|
config-macos-1.5-ALL | File | 352 B | 0644 |
|
config-mandrake-linux | File | 353 B | 0644 |
|
config-msc-linux | File | 357 B | 0644 |
|
config-netbsd | File | 252 B | 0644 |
|
config-open-linux | File | 331 B | 0644 |
|
config-open-linux-3.1e | File | 353 B | 0644 |
|
config-openSUSE-Linux-15.0-ALL | File | 331 B | 0644 |
|
config-openbsd | File | 235 B | 0644 |
|
config-openmamba-linux | File | 362 B | 0644 |
|
config-openserver | File | 323 B | 0644 |
|
config-osf1 | File | 302 B | 0644 |
|
config-pardus-linux | File | 332 B | 0644 |
|
config-redhat-linux | File | 362 B | 0644 |
|
config-slackware-linux | File | 282 B | 0644 |
|
config-sol-linux | File | 277 B | 0644 |
|
config-solaris | File | 353 B | 0644 |
|
config-solaris-10-ALL | File | 335 B | 0644 |
|
config-solaris-8-9 | File | 353 B | 0644 |
|
config-suse-linux | File | 331 B | 0644 |
|
config-suse-linux-6.3-8.0 | File | 331 B | 0644 |
|
config-turbo-linux | File | 331 B | 0644 |
|
config-united-linux | File | 358 B | 0644 |
|
config-unixware | File | 323 B | 0644 |
|
config-windows | File | 145 B | 0644 |
|
config.info | File | 797 B | 0644 |
|
config.info.ca | File | 879 B | 0644 |
|
config.info.cs | File | 874 B | 0644 |
|
config.info.de | File | 944 B | 0644 |
|
config.info.es | File | 759 B | 0644 |
|
config.info.fr | File | 867 B | 0644 |
|
config.info.hu | File | 668 B | 0644 |
|
config.info.nl | File | 818 B | 0644 |
|
config.info.no | File | 852 B | 0644 |
|
config.info.pl | File | 723 B | 0644 |
|
config.info.ru | File | 767 B | 0644 |
|
config.info.sv | File | 691 B | 0644 |
|
config.info.tr | File | 620 B | 0644 |
|
config.info.uk | File | 788 B | 0644 |
|
config.info.zh | File | 545 B | 0644 |
|
config.info.zh_TW | File | 513 B | 0644 |
|
delete_rpc.cgi | File | 568 B | 0755 |
|
delete_serv.cgi | File | 610 B | 0755 |
|
edit_rpc.cgi | File | 4.19 KB | 0755 |
|
edit_serv.cgi | File | 4.63 KB | 0755 |
|
index.cgi | File | 4.03 KB | 0755 |
|
inetd-generic-lib.pl | File | 4.43 KB | 0755 |
|
inetd-lib.pl | File | 2.02 KB | 0755 |
|
inetd-solaris-10-lib.pl | File | 8.45 KB | 0755 |
|
install_check.pl | File | 336 B | 0755 |
|
log_parser.pl | File | 892 B | 0755 |
|
module.info | File | 239 B | 0644 |
|
module.info.af | File | 0 B | 0644 |
|
module.info.af.auto | File | 111 B | 0644 |
|
module.info.ar | File | 0 B | 0644 |
|
module.info.ar.auto | File | 146 B | 0644 |
|
module.info.be | File | 0 B | 0644 |
|
module.info.be.auto | File | 159 B | 0644 |
|
module.info.bg | File | 0 B | 0644 |
|
module.info.bg.auto | File | 158 B | 0644 |
|
module.info.ca | File | 0 B | 0644 |
|
module.info.ca.auto | File | 112 B | 0644 |
|
module.info.cs | File | 0 B | 0644 |
|
module.info.cs.auto | File | 111 B | 0644 |
|
module.info.da | File | 0 B | 0644 |
|
module.info.da.auto | File | 119 B | 0644 |
|
module.info.de | File | 0 B | 0644 |
|
module.info.de.auto | File | 126 B | 0644 |
|
module.info.el | File | 0 B | 0644 |
|
module.info.el.auto | File | 190 B | 0644 |
|
module.info.es | File | 0 B | 0644 |
|
module.info.es.auto | File | 116 B | 0644 |
|
module.info.eu | File | 0 B | 0644 |
|
module.info.eu.auto | File | 118 B | 0644 |
|
module.info.fa | File | 0 B | 0644 |
|
module.info.fa.auto | File | 136 B | 0644 |
|
module.info.fi | File | 0 B | 0644 |
|
module.info.fi.auto | File | 113 B | 0644 |
|
module.info.fr | File | 0 B | 0644 |
|
module.info.fr.auto | File | 122 B | 0644 |
|
module.info.he | File | 0 B | 0644 |
|
module.info.he.auto | File | 136 B | 0644 |
|
module.info.hr | File | 0 B | 0644 |
|
module.info.hr.auto | File | 111 B | 0644 |
|
module.info.hu | File | 0 B | 0644 |
|
module.info.hu.auto | File | 143 B | 0644 |
|
module.info.it | File | 0 B | 0644 |
|
module.info.it.auto | File | 114 B | 0644 |
|
module.info.ja | File | 0 B | 0644 |
|
module.info.ja.auto | File | 140 B | 0644 |
|
module.info.ko | File | 0 B | 0644 |
|
module.info.ko.auto | File | 154 B | 0644 |
|
module.info.lt | File | 0 B | 0644 |
|
module.info.lt.auto | File | 115 B | 0644 |
|
module.info.lv | File | 0 B | 0644 |
|
module.info.lv.auto | File | 122 B | 0644 |
|
module.info.ms | File | 0 B | 0644 |
|
module.info.ms.auto | File | 122 B | 0644 |
|
module.info.mt | File | 0 B | 0644 |
|
module.info.mt.auto | File | 119 B | 0644 |
|
module.info.nl | File | 0 B | 0644 |
|
module.info.nl.auto | File | 116 B | 0644 |
|
module.info.no | File | 0 B | 0644 |
|
module.info.no.auto | File | 118 B | 0644 |
|
module.info.pl | File | 0 B | 0644 |
|
module.info.pl.auto | File | 124 B | 0644 |
|
module.info.pt | File | 0 B | 0644 |
|
module.info.pt.auto | File | 113 B | 0644 |
|
module.info.pt_BR | File | 0 B | 0644 |
|
module.info.pt_BR.auto | File | 119 B | 0644 |
|
module.info.ro | File | 0 B | 0644 |
|
module.info.ro.auto | File | 123 B | 0644 |
|
module.info.ru | File | 0 B | 0644 |
|
module.info.ru.auto | File | 161 B | 0644 |
|
module.info.sk | File | 0 B | 0644 |
|
module.info.sk.auto | File | 111 B | 0644 |
|
module.info.sl | File | 0 B | 0644 |
|
module.info.sl.auto | File | 115 B | 0644 |
|
module.info.sv | File | 0 B | 0644 |
|
module.info.sv.auto | File | 119 B | 0644 |
|
module.info.th | File | 0 B | 0644 |
|
module.info.th.auto | File | 190 B | 0644 |
|
module.info.tr | File | 0 B | 0644 |
|
module.info.tr.auto | File | 119 B | 0644 |
|
module.info.uk | File | 0 B | 0644 |
|
module.info.uk.auto | File | 157 B | 0644 |
|
module.info.ur | File | 0 B | 0644 |
|
module.info.ur.auto | File | 191 B | 0644 |
|
module.info.vi | File | 0 B | 0644 |
|
module.info.vi.auto | File | 137 B | 0644 |
|
module.info.zh | File | 0 B | 0644 |
|
module.info.zh.auto | File | 110 B | 0644 |
|
module.info.zh_TW | File | 0 B | 0644 |
|
module.info.zh_TW.auto | File | 116 B | 0644 |
|
prefs.info | File | 29 B | 0644 |
|
restart_inetd.cgi | File | 296 B | 0755 |
|
save_rpc.cgi | File | 3.82 KB | 0755 |
|
save_serv.cgi | File | 5.31 KB | 0755 |
|