[ Avaa Bypassed ]




Upload:

Command:

www-data@18.117.246.69: ~ $
#!/usr/bin/perl
# edit_tables.cgi
# Allow the selection of and display a NIS table for editing

require './nis-lib.pl';
&ui_print_header(undef, $text{'tables_title'}, "");
&ReadParse();

$mode = &get_server_mode();
if ($mode == 0 || !(&get_nis_support() & 2)) {
	print "<p>$text{'tables_emaster'}<p>\n";
	&ui_print_footer("", $text{'index'});
	exit;
	}
elsif ($mode == 2) {
	print "<p>$text{'tables_eslave'}<p>\n";
	&ui_print_footer("", $text{'index'});
	exit;
	}

@tables = &list_nis_tables();
@domains = &unique(map { $_->{'domain'} } @tables);
$in{'table'} = int($in{'table'});

print "<form action=edit_tables.cgi method=post>\n";
print "<input type=submit value='$text{'tables_switch'}'>\n";
print "<select name=table>\n";
foreach $t (@tables) {
	$t->{'desc'} = $text{"desc_".$t->{'table'}};
	$t->{'desc'} = $t->{'table'} if (!$t->{'desc'});
	$t->{'desc'} .= " ($t->{'domain'})" if (@domains > 1);
	printf "<option value=%d %s>%s</option>\n",
		$t->{'index'}, $in{'table'} eq $t->{'index'} ? 'selected' : '',
		$t->{'desc'};
	}
print "</select></form>\n";

$t = $tables[$in{'table'}];
$type = $in{'text'} ? undef : $t->{'type'};
print "<b>",&text('tables_header', $t->{'desc'},
		   "<tt>".join(" ", @{$t->{'files'}})."</tt>"),"</b><p>\n";
if ($type eq 'hosts') {
	&show_nis_table([ $text{'hosts_ip'},
			  $text{'hosts_name'} ],
			$t, '\s+', [ 0, 1 ]);
	}
elsif ($type eq 'networks') {
	&show_nis_table([ $text{'networks_name'},
			  $text{'networks_ip'} ],
			$t, '\s+', [ 0, 1 ]);
	}
elsif ($type eq 'group' || $type eq 'group_shadow') {
	&show_nis_table([ $text{'group_name'},
			  $text{'group_gid'},
			  $text{'group_members'} ],
			$t, ':', [ 0, 2, 3 ], "width=100%");
	}
elsif ($type eq 'passwd_shadow' || $type eq 'passwd_shadow_full' ||
       $type eq 'passwd') {
	&show_nis_table([ $text{'passwd_name'},
			  $text{'passwd_uid'},
			  $text{'passwd_real'},
			  $text{'passwd_home'},
			  $text{'passwd_shell'} ],
			$t, ':', [ 0, 2, 4, 5, 6 ], "width=100%");
	}
elsif ($type eq 'services') {
	&show_nis_table([ $text{'services_name'},
			  $text{'services_proto'},
			  $text{'services_port'} ],
			$t, '[\s/]+', [ 0, 2, 1 ]);
	}
elsif ($type eq 'services2') {
	&show_nis_table([ $text{'services_name'},
			  $text{'services_proto'},
			  $text{'services_port'} ],
			$t, '[\s/]+', [ 0, 1, 2 ]);
	}
elsif ($type eq 'protocols') {
	&show_nis_table([ $text{'protocols_name'},
			  $text{'protocols_number'},
			  $text{'protocols_aliases'} ],
			$t, '\s+', [ 0, 1, -2 ]);
	}
elsif ($type eq 'netgroup') {
	&show_nis_table([ $text{'netgroup_name'},
			  $text{'netgroup_members'} ],
			$t, '\s+', [ 0, -1 ]);
	}
elsif ($type eq 'ethers') {
	&show_nis_table([ $text{'ethers_mac'},
			  $text{'ethers_ip'} ],
			$t, '\s+', [ 0, 1 ]);
	}
elsif ($type eq 'rpc') {
	&show_nis_table([ $text{'rpc_name'},
			  $text{'rpc_number'},
			  $text{'rpc_aliases'} ],
			$t, '\s+', [ 0, 1, -2 ]);
	}
elsif ($type eq 'netmasks') {
	&show_nis_table([ $text{'netmasks_net'},
			  $text{'netmasks_mask'} ],
			$t, '\s+', [ 0, 1 ]);
	}
elsif ($type eq 'aliases') {
	&show_nis_table([ $text{'aliases_from'},
			  $text{'aliases_to'} ],
			$t, '[\s:]+', [ 0, 1 ]);
	}
else {
	# Allow editing of file directly
	print "<form method=post action=save_file.cgi enctype=multipart/form-data>\n";
	print "<input type=hidden name=table value='$in{'table'}'>\n";
	$fnum = 0;
	foreach $f (@{$t->{'files'}}) {
		print "<table border>\n";
		print "<tr $tb> <td><b>",&text('tables_file', "<tt>$f</tt>"),
		      "</b></td> </tr>\n";
		print "<tr $cb> <td><textarea name=data_$fnum rows=20 cols=80>";
		print &read_file_contents($f);
		print "</textarea></td></tr></table><br>\n";
		$fnum++;
		}
	print "<input type=submit value='$text{'tables_ok'}'></form>\n";
	}

if ($config{'manual_build'}) {
	print &ui_hr();
	print "<table width=100%><tr>\n";
	print "<form action=build.cgi>\n";
	print "<input type=hidden name=table value='$in{'table'}'>\n";
	print "<td><input type=submit value='$text{'tables_build'}'></td>\n";
	print "<td>$text{'tables_buildmsg'}</td>\n";
	print "</form></tr></table>\n";
	}

&ui_print_footer("", $text{'index_return'});

# show_nis_table(&headers, &table, splitter, &columns, params)
sub show_nis_table
{
local @f = @{$_[1]->{'files'}};
local $lines = 0;
open(FILE, "<$f[0]");
while(<FILE>) {
	s/\r|\n//g;
	s/^\s*#.*$//;
	push(@lines, $_);
	$lines++ if (/\S/);
	$empty = 0 if (/\S/);
	}
close(FILE);
if ($config{'max_size'} && $lines > $config{'max_size'}) {
	# Display a search form
	print "<form action=edit_tables.cgi>\n";
	print "<input type=hidden name=table value='$in{'table'}'>\n";
	local $sel = "<select name=field>\n";
	local $n = 0;
	foreach $f (@{$_[0]}) {
		$sel .= sprintf "<option value=%s %s>%s</option>\n",
			$n, $in{'field'} == $n ? 'selected' : '', $f;
		$n++;
		}
	$sel .= "</select>\n";
	print &text('tables_find', $t->{'desc'}, $sel,
		    "<input name=what size=15 value='$in{'what'}'>"),
		    "&nbsp;&nbsp;&nbsp;\n";
	print "<input type=submit value='$text{'tables_search'}'></form>\n";
	}
if ($lines && (defined($in{'field'}) || !$config{'max_size'} ||
	       $lines <= $config{'max_size'})) {
	# Show table records
	print "<a href='edit_$t->{'type'}.cgi?table=$in{'table'}'>",
	      "$text{'tables_add'}</a><br>\n";
	print "<table border $_[4]>\n";
	print "<tr $tb> ",(map { "<td><b>$_</b></td>" } @{$_[0]}),"</tr>\n";
	local ($c, @c) = @{$_[3]};
	local $lnum = 0;
	local $matches = 0;
	foreach $l (@lines) {
		local @r = split($_[2], $l);
		if ($l =~ /\S/ && (!defined($in{'field'}) ||
		    $r[$_[3]->[$in{'field'}]] =~ /$in{'what'}/i)) {
			print "<tr $cb><td><a href='edit_$t->{'type'}.cgi?",
			      "line=$lnum&table=$in{'table'}'>",
			      &html_escape($r[$c]),"</a></td>\n";
			foreach $i (@c) {
				if ($i < 0) {
					print "<td>",&html_escape(join(" ", @r[-$i .. $#r])),"<br></td>\n";
					}
				else {
					print "<td>",&html_escape($r[$i]),"<br></td>\n";
					}
				}
			$matches++;
			}
		$lnum++;
		}
	if (!$matches) {
		print "<tr $cb> <td colspan=",scalar(@{$_[3]}),">",
		      "$text{'tables_nomatch'}</td> </tr>\n";
		}
	print "</table>\n";
	}
else {
	print "<b>",&text('tables_none', $t->{'desc'}),"</b><p>\n";
	}
print "<a href='edit_$t->{'type'}.cgi?table=$in{'table'}'>",
      "$text{'tables_add'}</a>&nbsp;&nbsp;\n";
print "<a href='edit_tables.cgi?table=$in{'table'}&text=1'>",
      "$text{'tables_text'}</a><p>\n";
}


Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
CHANGELOG File 308 B 0644
aix-lib.pl File 9.79 KB 0755
backup_config.pl File 817 B 0755
build.cgi File 162 B 0755
coherent-linux-lib.pl File 10.4 KB 0755
config-aix File 181 B 0644
config-coherent-linux File 116 B 0644
config-debian-linux File 120 B 0644
config-generic-linux File 116 B 0644
config-mandrake-linux File 116 B 0644
config-msc-linux File 116 B 0644
config-open-linux File 117 B 0644
config-openSUSE-Linux-15.0-ALL File 116 B 0644
config-openmamba-linux File 116 B 0644
config-redhat-linux File 116 B 0644
config-slackware-linux File 116 B 0644
config-solaris File 167 B 0644
config-solaris-8-ALL File 199 B 0644
config-suse-linux File 116 B 0644
config-trustix-linux File 116 B 0644
config-united-linux File 116 B 0644
config.info File 282 B 0644
config.info.ca File 320 B 0644
config.info.cs File 321 B 0644
config.info.de File 321 B 0644
config.info.es File 277 B 0644
config.info.fr File 350 B 0644
config.info.hu File 0 B 0644
config.info.nl File 290 B 0644
config.info.no File 297 B 0644
config.info.pl File 309 B 0644
config.info.ru File 491 B 0644
config.info.sv File 132 B 0644
config.info.uk File 500 B 0644
debian-linux-lib.pl File 10.19 KB 0755
edit_aliases.cgi File 1.2 KB 0755
edit_client.cgi File 1.41 KB 0755
edit_ethers.cgi File 1.14 KB 0755
edit_group.cgi File 1.81 KB 0755
edit_group_shadow.cgi File 1.83 KB 0755
edit_hosts.cgi File 1.31 KB 0755
edit_netgroup.cgi File 2.01 KB 0755
edit_netmasks.cgi File 1.16 KB 0755
edit_networks.cgi File 1.35 KB 0755
edit_passwd.cgi File 4.8 KB 0755
edit_passwd_shadow.cgi File 4.8 KB 0755
edit_passwd_shadow_full.cgi File 4.8 KB 0755
edit_protocols.cgi File 1.35 KB 0755
edit_rpc.cgi File 1.3 KB 0755
edit_security.cgi File 1.92 KB 0755
edit_server.cgi File 607 B 0755
edit_services.cgi File 1.52 KB 0755
edit_services2.cgi File 1.53 KB 0755
edit_switch.cgi File 1.74 KB 0755
edit_tables.cgi File 6.24 KB 0755
feedback_files.pl File 157 B 0755
index.cgi File 776 B 0755
linux-lib.pl File 5.27 KB 0755
list_switches.cgi File 772 B 0755
mandrake-linux-lib.pl File 10.38 KB 0755
md5-lib.pl File 7.58 KB 0755
module.info File 346 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 167 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 195 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 287 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 250 B 0644
module.info.ca File 163 B 0644
module.info.ca.auto File 12 B 0644
module.info.cs File 28 B 0644
module.info.cs.auto File 145 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 154 B 0644
module.info.de File 136 B 0644
module.info.de.auto File 12 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 235 B 0644
module.info.es File 31 B 0644
module.info.es.auto File 138 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 164 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 248 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 158 B 0644
module.info.fr File 30 B 0644
module.info.fr.auto File 141 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 170 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 171 B 0644
module.info.hu File 34 B 0644
module.info.hu.auto File 147 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 152 B 0644
module.info.ja File 49 B 0644
module.info.ja.auto File 226 B 0644
module.info.ko File 39 B 0644
module.info.ko.auto File 154 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 169 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 169 B 0644
module.info.ms File 149 B 0644
module.info.ms.auto File 12 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 144 B 0644
module.info.nl File 30 B 0644
module.info.nl.auto File 130 B 0644
module.info.no File 29 B 0644
module.info.no.auto File 117 B 0644
module.info.pl File 107 B 0644
module.info.pl.auto File 12 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 164 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 173 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 156 B 0644
module.info.ru File 41 B 0644
module.info.ru.auto File 246 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 165 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 165 B 0644
module.info.sv File 31 B 0644
module.info.sv.auto File 123 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 347 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 169 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 247 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 244 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 217 B 0644
module.info.zh File 34 B 0644
module.info.zh.auto File 120 B 0644
module.info.zh_TW File 37 B 0644
module.info.zh_TW.auto File 126 B 0644
msc-linux-lib.pl File 10.38 KB 0755
nis-lib.pl File 6.02 KB 0755
nisupdate.conf File 1.94 KB 0644
old_edit_passwd_shadow.cgi File 4.62 KB 0755
old_edit_switch.cgi File 1.76 KB 0755
old_save_switch.cgi File 533 B 0755
open-linux-lib.pl File 7.89 KB 0755
openmamba-linux-lib.pl File 10.38 KB 0755
redhat-linux-lib.pl File 10.38 KB 0755
save_aliases.cgi File 749 B 0755
save_client.cgi File 661 B 0755
save_ethers.cgi File 793 B 0755
save_file.cgi File 588 B 0755
save_group.cgi File 945 B 0755
save_group_shadow.cgi File 1.04 KB 0755
save_hosts.cgi File 758 B 0755
save_netgroup.cgi File 1.04 KB 0755
save_netmasks.cgi File 753 B 0755
save_networks.cgi File 791 B 0755
save_passwd_shadow.cgi File 2.36 KB 0755
save_protocols.cgi File 806 B 0755
save_rpc.cgi File 746 B 0755
save_security.cgi File 996 B 0755
save_server.cgi File 184 B 0755
save_services.cgi File 775 B 0755
save_services2.cgi File 776 B 0755
save_switch.cgi File 932 B 0755
slackware-linux-lib.pl File 9.91 KB 0755
solaris-lib.pl File 10.45 KB 0755
suse-linux-8.2-lib.pl File 11.05 KB 0755
suse-linux-9.0-lib.pl File 11.05 KB 0755
suse-linux-lib.pl File 11.88 KB 0755
switch-lib.pl File 3.08 KB 0755
trustix-linux-lib.pl File 10.38 KB 0755
united-linux-lib.pl File 11.05 KB 0755