X7ROOT File Manager
Current Path:
/usr/libexec/webmin/iscsi-tgtd
usr
/
libexec
/
webmin
/
iscsi-tgtd
/
📁
..
📄
CHANGELOG
(127 B)
📄
atboot.cgi
(711 B)
📄
config
(70 B)
📄
config-AlmaLinux-7.0-ALL
(184 B)
📄
config-Amazon-Linux-2-ALL
(184 B)
📄
config-CentOS-Linux-7.0-ALL
(184 B)
📄
config-CentOS-Stream-Linux-8.0-ALL
(184 B)
📄
config-Oracle-Linux-8.0-ALL
(184 B)
📄
config-Redhat-Enterprise-Linux-7.0-ALL
(184 B)
📄
config-Rocky-Linux-7.0-ALL
(184 B)
📄
config-Scientific-Linux-7.0-ALL
(184 B)
📄
config-debian-linux
(92 B)
📄
config-redhat-linux
(128 B)
📄
config-syno-linux
(70 B)
📄
config.info
(421 B)
📄
config.info.ca
(492 B)
📄
config.info.de
(496 B)
📄
config.info.no
(445 B)
📄
delete_targets.cgi
(980 B)
📄
edit_manual.cgi
(1.05 KB)
📄
edit_target.cgi
(5.41 KB)
📁
images
📄
index.cgi
(2.75 KB)
📄
install_check.pl
(346 B)
📄
iscsi-tgtd-lib.pl
(11.66 KB)
📁
lang
📄
log_parser.pl
(457 B)
📄
module.info
(196 B)
📄
module.info.af
(0 B)
📄
module.info.af.auto
(121 B)
📄
module.info.ar
(0 B)
📄
module.info.ar.auto
(146 B)
📄
module.info.be
(0 B)
📄
module.info.be.auto
(190 B)
📄
module.info.bg
(0 B)
📄
module.info.bg.auto
(175 B)
📄
module.info.ca
(137 B)
📄
module.info.cs
(0 B)
📄
module.info.cs.auto
(113 B)
📄
module.info.da
(0 B)
📄
module.info.da.auto
(112 B)
📄
module.info.de
(115 B)
📄
module.info.el
(0 B)
📄
module.info.el.auto
(216 B)
📄
module.info.es
(0 B)
📄
module.info.es.auto
(133 B)
📄
module.info.eu
(0 B)
📄
module.info.eu.auto
(102 B)
📄
module.info.fa
(0 B)
📄
module.info.fa.auto
(175 B)
📄
module.info.fi
(0 B)
📄
module.info.fi.auto
(108 B)
📄
module.info.fr
(0 B)
📄
module.info.fr.auto
(136 B)
📄
module.info.he
(0 B)
📄
module.info.he.auto
(138 B)
📄
module.info.hr
(0 B)
📄
module.info.hr.auto
(114 B)
📄
module.info.hu
(0 B)
📄
module.info.hu.auto
(142 B)
📄
module.info.it
(0 B)
📄
module.info.it.auto
(135 B)
📄
module.info.ja
(0 B)
📄
module.info.ja.auto
(164 B)
📄
module.info.ko
(0 B)
📄
module.info.ko.auto
(150 B)
📄
module.info.lt
(0 B)
📄
module.info.lt.auto
(129 B)
📄
module.info.lv
(0 B)
📄
module.info.lv.auto
(119 B)
📄
module.info.ms
(0 B)
📄
module.info.ms.auto
(119 B)
📄
module.info.mt
(0 B)
📄
module.info.mt.auto
(119 B)
📄
module.info.nl
(0 B)
📄
module.info.nl.auto
(123 B)
📄
module.info.no
(0 B)
📄
module.info.no.auto
(111 B)
📄
module.info.pl
(0 B)
📄
module.info.pl.auto
(117 B)
📄
module.info.pt
(0 B)
📄
module.info.pt.auto
(119 B)
📄
module.info.pt_BR
(0 B)
📄
module.info.pt_BR.auto
(125 B)
📄
module.info.ro
(0 B)
📄
module.info.ro.auto
(120 B)
📄
module.info.ru
(0 B)
📄
module.info.ru.auto
(208 B)
📄
module.info.sk
(0 B)
📄
module.info.sk.auto
(111 B)
📄
module.info.sl
(0 B)
📄
module.info.sl.auto
(102 B)
📄
module.info.sv
(0 B)
📄
module.info.sv.auto
(105 B)
📄
module.info.th
(0 B)
📄
module.info.th.auto
(224 B)
📄
module.info.tr
(0 B)
📄
module.info.tr.auto
(123 B)
📄
module.info.uk
(0 B)
📄
module.info.uk.auto
(177 B)
📄
module.info.ur
(0 B)
📄
module.info.ur.auto
(243 B)
📄
module.info.vi
(0 B)
📄
module.info.vi.auto
(120 B)
📄
module.info.zh
(0 B)
📄
module.info.zh.auto
(104 B)
📄
module.info.zh_TW
(0 B)
📄
module.info.zh_TW.auto
(110 B)
📄
restart.cgi
(351 B)
📄
save_manual.cgi
(684 B)
📄
save_target.cgi
(4.47 KB)
📄
start.cgi
(328 B)
📄
stop.cgi
(303 B)
Editing: save_target.cgi
#!/usr/bin/perl # Create, update or delete a target use strict; use warnings; no warnings 'redefine'; no warnings 'uninitialized'; require './iscsi-tgtd-lib.pl'; our (%text, %in, %config); &ReadParse(); &error_setup($text{'target_err'}); my $conf = &get_tgtd_config(); # Get the target my $target; my $addfile; if ($in{'new'}) { $target = { 'name' => 'target', 'type' => 1, 'members' => [ ] }; if (-d $config{'add_file'}) { $addfile = $config{'add_file'}."/".$in{'name'}.".conf"; } elsif ($config{'add_file'}) { $addfile = $config{'add_file'}; } } else { ($target) = grep { $_->{'value'} eq $in{'oldname'} } &find($conf, "Target"); $target || &error($text{'target_egone'}); } my $lockfile = $target->{'file'} || $addfile; &lock_file($lockfile); if ($in{'delete'}) { # Delete the target &save_directive($conf, $target, undef); &delete_if_empty($target->{'file'}); } else { # Validate and save directives, starting with target name my $host; if ($in{'new'}) { $host = &find_host_name($conf) || &generate_host_name(); } else { ($host) = split(/:/, $target->{'value'}); } $in{'name'} =~ /^[a-z0-9\.\_\-]+$/i || &error($text{'target_ename'}); $target->{'value'} = $host.":".$in{'name'}; # Validate logical units my @luns = (&find($target->{'members'}, "backing-store"), &find($target->{'members'}, "direct-store")); @luns = sort { $a->{'file'} <=> $b->{'file'} } @luns; my (@backluns, @directluns); for(my $i=0; defined($in{"mode".$i}); $i++) { my $path; if ($in{"mode".$i} eq "none") { # Nothing to do next; } elsif ($in{"mode".$i} eq "part") { # Regular partition $path = $in{"part".$i}; } elsif ($in{"mode".$i} eq "raid") { # RAID device $path = $in{"raid".$i}; } elsif ($in{"mode".$i} eq "lvm") { # LVM logical volume $path = $in{"lvm".$i}; } elsif ($in{"mode".$i} eq "other") { # Some other file $in{"other".$i} =~ /^\/\S+$/ && -r $in{"other".$i} || &error(&text('target_eother', $i+1)); $path = $in{"other".$i}; } my $newlun = $i >= @luns ? { } : $luns[$i]; $newlun->{'name'} = $in{"type".$i}; $newlun->{'value'} = $path; my $cache = $in{"cache".$i} ? { 'name' => 'write-cache', 'value' => $in{"cache".$i} } : undef; &save_directive($conf, "write-cache", $cache, $newlun); if ($newlun->{'name'} eq "backing-store") { push(@backluns, $newlun); } else { push(@directluns, $newlun); } } &save_multiple_directives($conf, "backing-store", \@backluns, $target); &save_multiple_directives($conf, "direct-store", \@directluns,$target); # Validate incoming user(s) my @iusers; if (!$in{"iuser_def"}) { for(my $i=0; defined($in{"uname_$i"}); $i++) { next if (!$in{"uname_$i"}); $in{"uname_$i"} =~ /^\S+$/ || &error(&text('target_eiuser', $i+1)); $in{"upass_$i"} =~ /^\S+$/ || &error(&text('target_eipass', $i+1)); push(@iusers, { 'name' => 'incominguser', 'value' => $in{"uname_$i"}." ".$in{"upass_$i"} }); } @iusers || &error($text{'target_eiusernone'}); } &save_multiple_directives($conf, "incominguser", \@iusers, $target); # Validate outgoing user(s) if (!$in{"ouser_def"}) { $in{"ouser"} =~ /^\S+$/ || &error($text{'target_eouser'}); $in{"opass"} =~ /^\S+$/ || &error($text{'target_eopass'}); my $ouser = { 'name' => "outgoinguser", 'value' => $in{"ouser"}." ".$in{"opass"} }; &save_directive($conf, "outgoinguser", $ouser, $target); } else { &save_directive($conf, "outgoinguser", undef, $target); } # Save allowed IPs my @addrs; if (!$in{"iaddress_def"}) { foreach my $a (split(/\s+/, $in{"iaddress"})) { &check_ipaddress($a) || &error($text{'target_eaddr'}); push(@addrs, { 'name' => "initiator-address", 'value' => $a }); } } &save_multiple_directives($conf, "initiator-address", \@addrs, $target); # Save allowed initiators my @names; if (!$in{"iname_def"}) { foreach my $a (split(/\s+/, $in{"iname"})) { $a =~ /^[:a-z0-9\.\_\-]+$/i || &error($text{'target_eaname'}); push(@names, { 'name' => "initiator-name", 'value' => $a }); } } &save_multiple_directives($conf, "initiator-name", \@names, $target); # Save the target if ($in{'new'}) { &save_directive($conf, undef, $target, undef, $addfile); } else { &save_directive($conf, $target, $target); } } &flush_file_lines(); &unlock_file($lockfile); &webmin_log($in{'delete'} ? 'delete' : $in{'new'} ? 'create' : 'modify', 'target', $target->{'value'}); &redirect("");
Upload File
Create Folder