[ Avaa Bypassed ]




Upload:

Command:

www-data@3.148.202.164: ~ $
#!/usr/bin/perl
# Show a form to edit or create an extent

use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';
require './iscsi-server-lib.pl';
our (%text, %in);
my $conf = &get_iscsi_config();
&ReadParse();

# Get the extent, or create a new one
my $extent;
if ($in{'new'}) {
	&ui_print_header(undef, $text{'extent_create'}, "");
	$extent = { 'num' => &find_free_num($conf, 'extent'),
		    'type' => 'extent',
		    'start' => 0 };
	}
else {
	$extent = &find($conf, "extent", $in{'num'});
	$extent || &text('extent_egone', $in{'num'});
	&ui_print_header(undef, $text{'extent_edit'}, "");
	}

# Show editing form
print &ui_form_start("save_extent.cgi", "post");
print &ui_hidden("new", $in{'new'});
print &ui_hidden("num", $in{'num'});
print &ui_table_start($text{'extent_header'}, undef, 2);

# Extent name/number
print &ui_table_row($text{'extent_name'},
		    $extent->{'type'}.$extent->{'num'});

# Device to share, starting with disk partitions
my @opts;
my $part_found = 0;
my $sel = &fdisk::partition_select("part", $extent->{'device'}, 0,
				   \$part_found);
push(@opts, [ 'part', $text{'extent_part'}, $sel ]);

# Then add RAID devices
my $rconf = &raid::get_raidtab();
my @ropts;
my $raid_found = 0;
foreach my $c (@$rconf) {
	if ($c->{'active'}) {
		push(@ropts, [ $c->{'value'},
			       &text('extent_md',
				     substr($c->{'value'}, -1)) ]);
		$raid_found = 1 if ($extent->{'device'} eq $c->{'value'});
		}
	}
if (@ropts) {
	push(@opts, [ 'raid', $text{'extent_raid'},
		      &ui_select("raid", $extent->{'device'}, \@ropts) ]);
	}

# Then add LVM logical volumes
my @vgs = sort { $a->{'name'} cmp $b->{'name'} } &lvm::list_volume_groups();
my @lvs;
foreach my $v (@vgs) {
	push(@lvs, sort { $a->{'name'} cmp $b->{'name'} }
			&lvm::list_logical_volumes($v->{'name'}));
	}
my @lopts;
my $lvm_found = 0;
foreach my $l (@lvs) {
	push(@lopts, [ $l->{'device'},
		       &text('extent_lv', $l->{'vg'}, $l->{'name'}) ]);
	$lvm_found = 1 if (&same_file($extent->{'device'}, $l->{'device'}));
	}
if (@lopts) {
	push(@opts, [ 'lvm', $text{'extent_lvm'},
		      &ui_select("lvm", $extent->{'device'}, \@lopts) ]);
	}

# Then add other file mode
my $mode = $part_found ? 'part' :
	   $raid_found ? 'raid' :
	   $lvm_found ? 'lvm' : 'other';
push(@opts, [ 'other', $text{'extent_other'},
	      &ui_textbox("other",
			  $mode eq 'other' ? $extent->{'device'} : "", 50).
	      " ".&file_chooser_button("other") ]);

print &ui_table_row($text{'extent_device'},
	&ui_radio_table("mode", $mode, \@opts));

# Byte offset for start
print &ui_table_row($text{'extent_start'},
	&ui_bytesbox("start", $extent->{'start'}));

# Byte size to share
print &ui_table_row($text{'extent_size'},
	&ui_radio("size_def",
		  $in{'new'} ? 1 :
		  &get_device_size($extent->{'device'}, $mode) ==
		    $extent->{'size'} ? 1 : 0,
		  [ [ 1, $text{'extent_size_def1'} ],
		    [ 0, $text{'extent_size_def0'} ] ])." ".
	&ui_bytesbox("size", $extent->{'size'}));

print &ui_table_end();
if ($in{'new'}) {
	print &ui_form_end([ [ undef, $text{'create'} ] ]);
	}
else {
	print &ui_form_end([ [ undef, $text{'save'} ],
			     [ 'delete', $text{'delete'} ] ]);
	}

&ui_print_footer("list_extents.cgi", $text{'extents_return'});

Filemanager

Name Type Size Permission Actions
help Folder 0755
images Folder 0755
lang Folder 0755
CHANGELOG File 106 B 0644
atboot.cgi File 959 B 0755
backup_config.pl File 677 B 0755
config File 192 B 0644
config-freebsd File 179 B 0644
config.info File 238 B 0644
config.info.ca File 298 B 0644
config.info.de File 265 B 0644
config.info.no File 250 B 0644
delete_devices.cgi File 1.48 KB 0755
delete_extents.cgi File 1.48 KB 0755
delete_targets.cgi File 1.2 KB 0755
delete_users.cgi File 858 B 0755
edit_device.cgi File 1.84 KB 0755
edit_extent.cgi File 3.16 KB 0755
edit_manual.cgi File 654 B 0755
edit_opts.cgi File 1.03 KB 0755
edit_target.cgi File 2.15 KB 0755
edit_user.cgi File 1.33 KB 0755
index.cgi File 1.78 KB 0755
install_check.pl File 353 B 0755
iscsi-server-lib.pl File 12.27 KB 0644
list_devices.cgi File 1.31 KB 0755
list_extents.cgi File 1.21 KB 0755
list_targets.cgi File 1.46 KB 0755
list_users.cgi File 1.02 KB 0755
log_parser.pl File 682 B 0755
module.info File 214 B 0644
module.info.af File 0 B 0644
module.info.af.auto File 133 B 0644
module.info.ar File 0 B 0644
module.info.ar.auto File 179 B 0644
module.info.be File 0 B 0644
module.info.be.auto File 206 B 0644
module.info.bg File 0 B 0644
module.info.bg.auto File 191 B 0644
module.info.ca File 149 B 0644
module.info.cs File 0 B 0644
module.info.cs.auto File 123 B 0644
module.info.da File 0 B 0644
module.info.da.auto File 122 B 0644
module.info.de File 126 B 0644
module.info.el File 0 B 0644
module.info.el.auto File 226 B 0644
module.info.es File 0 B 0644
module.info.es.auto File 145 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 188 B 0644
module.info.fi File 0 B 0644
module.info.fi.auto File 120 B 0644
module.info.fr File 0 B 0644
module.info.fr.auto File 147 B 0644
module.info.he File 0 B 0644
module.info.he.auto File 148 B 0644
module.info.hr File 0 B 0644
module.info.hr.auto File 128 B 0644
module.info.hu File 0 B 0644
module.info.hu.auto File 152 B 0644
module.info.it File 0 B 0644
module.info.it.auto File 140 B 0644
module.info.ja File 0 B 0644
module.info.ja.auto File 179 B 0644
module.info.ko File 0 B 0644
module.info.ko.auto File 160 B 0644
module.info.lt File 0 B 0644
module.info.lt.auto File 139 B 0644
module.info.lv File 0 B 0644
module.info.lv.auto File 130 B 0644
module.info.ms File 144 B 0644
module.info.mt File 0 B 0644
module.info.mt.auto File 126 B 0644
module.info.nl File 0 B 0644
module.info.nl.auto File 133 B 0644
module.info.no File 122 B 0644
module.info.pl File 0 B 0644
module.info.pl.auto File 127 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 137 B 0644
module.info.ro File 0 B 0644
module.info.ro.auto File 130 B 0644
module.info.ru File 0 B 0644
module.info.ru.auto File 218 B 0644
module.info.sk File 0 B 0644
module.info.sk.auto File 121 B 0644
module.info.sl File 0 B 0644
module.info.sl.auto File 112 B 0644
module.info.sv File 0 B 0644
module.info.sv.auto File 115 B 0644
module.info.th File 0 B 0644
module.info.th.auto File 261 B 0644
module.info.tr File 0 B 0644
module.info.tr.auto File 135 B 0644
module.info.uk File 0 B 0644
module.info.uk.auto File 202 B 0644
module.info.ur File 0 B 0644
module.info.ur.auto File 227 B 0644
module.info.vi File 0 B 0644
module.info.vi.auto File 134 B 0644
module.info.zh File 0 B 0644
module.info.zh.auto File 116 B 0644
module.info.zh_TW File 0 B 0644
module.info.zh_TW.auto File 122 B 0644
restart.cgi File 355 B 0755
save_device.cgi File 1.96 KB 0755
save_extent.cgi File 2.45 KB 0755
save_manual.cgi File 456 B 0755
save_opts.cgi File 1.14 KB 0755
save_target.cgi File 1.85 KB 0755
save_user.cgi File 1.06 KB 0755
start.cgi File 332 B 0755
stop.cgi File 307 B 0755