[ Avaa Bypassed ]




Upload:

Command:

www-data@3.144.235.50: ~ $
#!/usr/bin/perl
# raid_form.cgi
# Display a form for creating a raid device

require './raid-lib.pl';
&foreign_require("mount");
&foreign_require("lvm");
&ReadParse();
$conf = &get_raidtab();

# Create initial object
foreach $c (@$conf) {
	if ($c->{'value'} =~ /md(\d+)$/) {
		$taken{$1} = 1;
		}
	}
$max = 0;
while($taken{$max}) {
	$max++;
	}
$raid = { 'value' => "/dev/md$max",
	  'members' => [ { 'name' => 'raid-level',
			   'value' => $in{'level'} },
			 { 'name' => 'persistent-superblock',
			   'value' => 1 }
		       ] };

&ui_print_header(undef, $text{'create_title'}, "");

# Find available partitions
@disks = &find_free_partitions(undef, 1, 1);
if (!@disks) {
	print "<p><b>$text{'create_nodisks'}</b> <p>\n";
	&ui_print_footer("", $text{'index_return'});
	exit;
	}

print &ui_form_start("create_raid.cgi");
print &ui_hidden("idx", $in{'idx'});
print &ui_table_start($text{'create_header'}, undef, 2);

# Device name
print &ui_table_row($text{'create_device'}, "<tt>$raid->{'value'}</tt>");
print &ui_hidden("device", $raid->{'value'});

# RAID level
$lvl = &find_value('raid-level', $raid->{'members'});
print &ui_table_row($text{'create_level'},
	$lvl eq 'linear' ? $text{'linear'} : $text{"raid$lvl"});
print &ui_hidden("level", $lvl);

# Create superblock?
$super = &find_value('persistent-superblock', $raid->{'members'});
print &ui_table_row($text{'create_super'},
	&ui_yesno_radio("super", $super ? 1 : 0));

# Layout
if ($lvl == 5 || $lvl == 6) {
	$layout = &find_value('parity-algorithm', $raid->{'members'});
	print &ui_table_row($text{'create_parity'},
		&ui_select("layout", $layout,
			[ [ '', $text{'default'} ],
			  'left-asymmetric', 'right-asymmetric',
			  'left-symmetric', 'right-symmetric',
			  'parity-first', 'parity-last' ]));
	}

if ($lvl == 10) {
	$layout = &find_value('parity-algorithm', $raid->{'members'});
	print &ui_table_row($text{'create_parity'},
		&ui_select("layout", $layout,
			[ [ '', $text{'default'} ],
			  [ 'n2', $text{'create_n2_layout'} ],
			  [ 'f2', $text{'create_f2_layout'} ],
			  [ 'o2', $text{'create_o2_layout'} ],
			  [ 'n3', $text{'create_n3_layout'} ],
			  [ 'f3', $text{'create_f3_layout'} ],
			  [ 'o3', $text{'create_o3_layout'} ] ]));
	}

# Chunk size
$chunk = &find_value('chunk-size', $raid->{'members'});
push(@chunks, [ '', $text{'default'} ]);
for($i=4; $i<=4096; $i*=2) { push(@chunks, [ $i, $i." kB" ]); }
print &ui_table_row($text{'create_chunk'},
	&ui_select("chunk", $chunk, \@chunks));

# Display partitions in raid, spares and parity
print &ui_table_row($text{'create_disks'},
	&ui_select("disks", undef, \@disks, 4, 1));

if ($lvl == 1 || $lvl == 4 || $lvl == 5 || $lvl == 6 || $lvl == 10) {
	print &ui_table_row($text{'create_spares'},
		&ui_select("spares", undef, \@disks, 4, 1));
	}

if ($lvl == 4 && $raid_mode ne 'mdadm') {
	print &ui_table_row($text{'create_pdisk'},
		&ui_select("pdisk", '', [ [ '', $text{'create_auto'} ],
					  @disks ], 4, 1));
	}

# Missing disk option
if ($lvl == 1 && $raid_mode eq 'mdadm') {
	print &ui_table_row($text{'create_missing'},
		&ui_yesno_radio("missing", 0));
	}

# Spare-group name option
if ($raid_mode eq 'mdadm') {
	@opts = ( [ 0, $text{'create_nogroup'} ] );
	@groups = ( );
	foreach $c (@$conf) {
		$sg = &find_value("spare-group", $c->{'members'});
		push(@groups, $sg) if ($sg);
		}
	if (@groups) {
		push(@opts, [ 1, $text{'create_oldgroup'},
			      &ui_select("group", undef, \@groups) ]);
		}
	push(@opts, [ 2, $text{'create_newgroup'},
		      &ui_textbox("newgroup", undef, 30) ]);
	print &ui_table_row($text{'create_group'},
		&ui_radio_table("group_mode", 0, \@opts, 1));
	}

# Force creation
print &ui_table_row($text{'create_force'},
	&ui_yesno_radio("force", 0));

# Assume clean
if ($raid_mode eq 'mdadm') {
	print &ui_table_row($text{'create_assume'},
		&ui_yesno_radio("assume", 0));
	}

print &ui_table_end();
print &ui_form_end([ [ undef, $text{'create'} ] ]);

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


Filemanager

Name Type Size Permission Actions
images Folder 0755
lang Folder 0755
CHANGELOG File 2.21 KB 0644
backup_config.pl File 721 B 0755
cgi_args.pl File 243 B 0755
config File 63 B 0644
config-debian-linux-3.1-ALL File 69 B 0644
config.info File 219 B 0644
config.info.bg File 382 B 0644
config.info.ca File 243 B 0644
config.info.cs File 232 B 0644
config.info.de File 247 B 0644
config.info.es File 265 B 0644
config.info.fr File 271 B 0644
config.info.hu File 0 B 0644
config.info.nl File 222 B 0644
config.info.no File 227 B 0644
config.info.pl File 76 B 0644
config.info.ru File 147 B 0644
config.info.sv File 76 B 0644
config.info.tr File 78 B 0644
config.info.uk File 140 B 0644
config.info.zh File 62 B 0644
config.info.zh_TW File 72 B 0644
create_raid.cgi File 2.75 KB 0755
index.cgi File 3.82 KB 0755
install_check.pl File 428 B 0755
log_parser.pl File 1.52 KB 0755
mkfs.cgi File 957 B 0755
module.info File 180 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 115 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 152 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 144 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 148 B 0644
module.info.ca File 117 B 0644
module.info.ca.auto File 13 B 0644
module.info.cs File 19 B 0644
module.info.cs.auto File 103 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 114 B 0644
module.info.de File 107 B 0644
module.info.de.auto File 13 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 181 B 0644
module.info.es File 22 B 0644
module.info.es.auto File 100 B 0644
module.info.eu File 0 B 0644
module.info.eu.auto File 114 B 0644
module.info.fa File 0 B 0644
module.info.fa.auto File 173 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 119 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 131 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 142 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 115 B 0644
module.info.hu File 19 B 0644
module.info.hu.auto File 114 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 115 B 0644
module.info.ja File 20 B 0644
module.info.ja.auto File 127 B 0644
module.info.ko File 23 B 0644
module.info.ko.auto File 111 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 134 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 119 B 0644
module.info.ms File 98 B 0644
module.info.ms.auto File 13 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 111 B 0644
module.info.nl File 19 B 0644
module.info.nl.auto File 98 B 0644
module.info.no File 19 B 0644
module.info.no.auto File 103 B 0644
module.info.pl File 25 B 0644
module.info.pl.auto File 96 B 0644
module.info.pt File 22 B 0644
module.info.pt.auto File 103 B 0644
module.info.pt_BR File 0 B 0644
module.info.pt_BR.auto File 134 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 119 B 0644
module.info.ru File 19 B 0644
module.info.ru.auto File 129 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 117 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 114 B 0644
module.info.sv File 19 B 0644
module.info.sv.auto File 97 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 162 B 0644
module.info.tr File 19 B 0644
module.info.tr.auto File 99 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 146 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 150 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 135 B 0644
module.info.zh File 27 B 0644
module.info.zh.auto File 96 B 0644
module.info.zh_TW File 30 B 0644
module.info.zh_TW.auto File 102 B 0644
raid-lib.pl File 22.25 KB 0755
raid_form.cgi File 3.88 KB 0755
save_mdadm.cgi File 939 B 0755
save_raid.cgi File 4.15 KB 0755
view_raid.cgi File 7.15 KB 0755