[ Avaa Bypassed ]




Upload:

Command:

www-data@3.14.251.87: ~ $
#!/usr/bin/perl
# Create, update or delete an extent

use strict;
use warnings;
no warnings 'redefine';
no warnings 'uninitialized';
require './iscsi-server-lib.pl';
our (%text, %in, %config);
&lock_file($config{'targets_file'});
my $conf = &get_iscsi_config();
&ReadParse();
&error_setup($in{'delete'} ? $text{'extent_derr'} : $text{'extent_err'});

my ($extent, $old_extent);
if (!$in{'new'}) {
	# Get the existing extent
	$extent = &find($conf, "extent", $in{'num'});
        $extent || &text('extent_egone', $in{'num'});
	$old_extent = $extent;
	}
else {
	# Creating a new one
	$extent = { 'num' => &find_free_num($conf, 'extent'),
		    'type' => 'extent' };
	}

if ($in{'delete'}) {
	# Check if in use before deleting
	my @users = &find_extent_users($conf, $extent);
	if (@users) {
		&error(&text('extent_einuse',
			join(", ", map { &describe_object($_) } @users)));
		}

	# Delete, after asking for confirmation
	if ($in{'confirm'}) {
		# Delete it
		&save_directive($conf, $extent, undef);
		}
	else {
		# Ask first
		&ui_print_header(undef, $text{'extent_edit'}, "");

		print &ui_confirmation_form(
			"save_extent.cgi",
			&text('extent_rusure',
			      &mount::device_name($extent->{'device'})),
			[ [ 'num', $in{'num'} ],
			  [ 'delete', 1 ] ],
			[ [ 'confirm', $text{'extent_sure'} ] ],
			);

		&ui_print_footer("list_extents.cgi", $text{'extents_return'});
		return;
		}
	}
else {
	# Validate and store inputs
	if ($in{'mode'} eq 'part') {
		$extent->{'device'} = $in{'part'};
		}
	elsif ($in{'mode'} eq 'raid') {
		$extent->{'device'} = $in{'raid'};
		}
	elsif ($in{'mode'} eq 'lvm') {
		$extent->{'device'} = $in{'lvm'};
		}
	else {
		-f $in{'other'} || &error($text{'extent_eother'});
		$extent->{'device'} = $in{'other'};
		}

	$in{'start'} =~ /^\d+$/ || &error($text{'extent_estart'});
	$extent->{'start'} = $in{'start'}*$in{'start_units'};

	my $maxsize = &get_device_size($extent->{'device'}, $in{'mode'});
	if ($in{'size_def'}) {
		$extent->{'size'} = $maxsize;
		}
	else {
		$in{'size'} =~ /^\d+$/ && $in{'size'} > 0 ||
			&error($text{'extent_esize'});
		$extent->{'size'} = $in{'size'}*$in{'size_units'};
		}
	$extent->{'start'} + $extent->{'size'} <= $maxsize ||
		&error(&text('extent_esizemax', &nice_size($maxsize)));

	# Write out the config
	&save_directive($conf, $old_extent, $extent);
	}

&unlock_file($config{'targets_file'});
&webmin_log($in{'new'} ? 'create' : $in{'delete'} ? 'delete' : 'modify',
	    'extent', $extent->{'device'});
&redirect("list_extents.cgi");

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