[ Avaa Bypassed ]




Upload:

Command:

www-data@52.15.123.168: ~ $
#!/usr/bin/perl
# save_vgetty.cgi
# Save, create or delete a serial port configuration

require './vgetty-lib.pl';
&foreign_require("inittab", "inittab-lib.pl");
&ReadParse();
@inittab = &inittab::parse_inittab();
@vgt = &vgetty_inittabs();
if (!$in{'new'}) {
	($init) = grep { $_->{'id'} eq $in{'id'} } @vgt;
	$oldtty = $init->{'tty'};
	$oldtty = "/dev/$oldtty" if ($oldtty !~ /^\//);
	}
@conf = &get_config();
$rings = &find_value("rings", \@conf);
$ans = &find_value("answer_mode", \@conf);

&lock_file($inittab::config{'inittab_file'});
if ($in{'delete'}) {
	# Just deleting an inittab entry
	&inittab::delete_inittab($init);
	if (defined($in{'rings_def'})) {
		local $tf = &tty_opt_file($ans, $oldtty);
		&lock_file($tf);
		unlink($tf);
		&unlock_file($tf);
		}
	if (defined($in{'ans_def'})) {
		$tf = &tty_opt_file($rings, $oldtty);
		&lock_file($tf);
		unlink($tf);
		&unlock_file($tf);
		}
	}
else {
	# Validate and store inputs
	&error_setup($text{'vgetty_err'});
	$cmd = $in{'new'} ? &has_command("vgetty") : $init->{'vgetty'};
	if ($init->{'args'}) {
		$init->{'args'} =~ s/^\s+//;
		$cmd .= " $init->{'args'}";
		}
	if ($in{'tty'}) {
		$cmd .= " $in{'tty'}";
		$init->{'tty'} = $in{'tty'};
		}
	else {
		-r $in{'other'} || &error($text{'vgetty_etty'});
		$cmd .= " $in{'other'}";
		$init->{'tty'} = $in{'other'};
		}
	$newtty = $init->{'tty'};
	$newtty = "/dev/$newtty" if ($newtty !~ /^\//);
	if ($in{'new'} || $newtty ne $oldtty) {
		# Check for tty clash
		foreach $v (&vgetty_inittabs()) {
			local $vtty = $v->{'tty'};
			$vtty = "/dev/$vtty" if ($vtty !~ /^\//);
			&error(&text('vgetty_eclash', "<tt>$vtty</tt>"))
				if ($vtty eq $newtty);
			}
		}
	$init->{'process'} = $cmd;

	if (defined($in{'rings_def'})) {
		$tf = &tty_opt_file($rings, $init->{'tty'});
		&lock_file($tf);
		if (!$in{'new'} && $oldtty ne $newtty) {
			unlink(&tty_opt_file($rings, $oldtty));
			}
		if ($in{'rings_def'}) {
			unlink($tf);
			}
		else {
			$in{'rings'} =~ /^\d+$/ ||
				&error($text{'vgetty_erings'});
			$in{'rings'} >= 2 || &error($text{'vgetty_erings2'});
			&open_tempfile(TF, ">$tf");
			&print_tempfile(TF, $in{'rings'},"\n");
			&close_tempfile(TF);
			}
		&unlock_file($tf);
		}

	if (defined($in{'ans_def'})) {
		$tf = &tty_opt_file($ans, $init->{'tty'});
		&lock_file($tf);
		if (!$in{'new'} && $oldtty ne $newtty) {
			unlink(&tty_opt_file($ans, $oldtty));
			}
		if ($in{'ans_def'}) {
			unlink($tf);
			}
		else {
			$mode = &parse_answer_mode("ans");
			$mode || &error($text{'vgetty_eans'});
			&open_tempfile(TF, ">$tf");
			&print_tempfile(TF, $mode,"\n");
			&close_tempfile(TF);
			}
		&unlock_file($tf);
		}
	
	if ($in{'new'}) {
		$maxid = 1;
		foreach $i (@inittab) {
			$maxid = $i->{'id'} if ($i->{'id'} =~ /^\d+$/ &&
						$i->{'id'} > $maxid);
			}
		$init->{'id'} = $maxid + 1;
		$init->{'levels'} = [ 2, 3, 4, 5 ];
		$init->{'action'} = "respawn";
		&inittab::create_inittab($init);
		}
	else {
		&inittab::modify_inittab($init);
		}
	}
&unlock_file($inittab::config{'inittab_file'});
&webmin_log($in{'delete'} ? "delete" : $in{'new'} ? "create" : "modify",
	    "vgetty", $init->{'tty'}, $init);

&redirect("list_vgetty.cgi");


Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
backup_config.pl File 923 B 0755
config File 63 B 0644
config.info File 109 B 0644
config.info.ca File 131 B 0644
config.info.cs File 124 B 0644
config.info.de File 119 B 0644
config.info.es File 131 B 0644
config.info.hu File 127 B 0644
config.info.ms File 111 B 0644
config.info.nl File 113 B 0644
config.info.no File 108 B 0644
config.info.pl File 133 B 0644
config.info.ru File 169 B 0644
config.info.uk File 172 B 0644
delete.cgi File 1.32 KB 0755
edit_options.cgi File 4.86 KB 0755
edit_vgetty.cgi File 2.78 KB 0755
email.pl File 1018 B 0755
index.cgi File 1.41 KB 0755
install_check.pl File 387 B 0755
list_messages.cgi File 2.49 KB 0755
list_received.cgi File 1.87 KB 0755
list_vgetty.cgi File 1.18 KB 0755
listen.cgi File 511 B 0755
log_parser.pl File 749 B 0755
module.info File 172 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 113 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 187 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 192 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 199 B 0644
module.info.ca File 116 B 0644
module.info.ca.auto File 15 B 0644
module.info.cs File 25 B 0644
module.info.cs.auto File 82 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 112 B 0644
module.info.de File 91 B 0644
module.info.de.auto File 15 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 225 B 0644
module.info.es File 41 B 0644
module.info.es.auto File 95 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 122 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 182 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 117 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 127 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 133 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 116 B 0644
module.info.hu File 28 B 0644
module.info.hu.auto File 100 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 118 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 145 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 119 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 122 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 125 B 0644
module.info.ms File 120 B 0644
module.info.ms.auto File 15 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 115 B 0644
module.info.nl File 25 B 0644
module.info.nl.auto File 78 B 0644
module.info.no File 25 B 0644
module.info.no.auto File 86 B 0644
module.info.pl File 32 B 0644
module.info.pl.auto File 95 B 0644
module.info.pt File 0 B 0644
module.info.pt.auto File 131 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 140 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 124 B 0644
module.info.ru File 51 B 0644
module.info.ru.auto File 142 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 108 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 100 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 112 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 260 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 116 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 185 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 211 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 140 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 97 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 106 B 0644
save_options.cgi File 3.9 KB 0755
save_vgetty.cgi File 3.09 KB 0755
upload.cgi File 1.79 KB 0755
vgetty-lib.pl File 4.31 KB 0755
vgetty_apply.cgi File 228 B 0755