mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 02:31:27 +00:00
- If target-oriented access control mode is used, Default_ groups will first be created
as temporary groups and later renamed. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1133 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -4,6 +4,8 @@ Changes for 1.0.9
|
||||
of deleting from one and adding to another the same user.
|
||||
- Replace a device on a given LUN when applying the configuration instead of removing
|
||||
the old device and assigning the new one.
|
||||
- If target-oriented access control mode is used, Default_ groups will first be created
|
||||
as temporary groups and later renamed.
|
||||
- Add the ability to specify options (ie: READ_ONLY) in assignments in scst.conf.
|
||||
- Remove unused references to handler IOs that don't exist and cleanup the write
|
||||
configuration function to only write vdisk and vcdrom devices. All other devices
|
||||
|
||||
@@ -123,6 +123,9 @@ my $_FC_CLASS_ = '/sys/class/fc_host';
|
||||
my $_SCSI_ISP_ = '/proc/scsi/isp';
|
||||
my $_SCSITGT_QLAISP_ = '/proc/scsi_tgt/qla_isp';
|
||||
|
||||
my $_TGT_DEF_PREFIX_ = 'Default_';
|
||||
my $_TGT_TMP_PREFIX_ = 'TMP_GRP';
|
||||
|
||||
my $SCST;
|
||||
my $DEVICES;
|
||||
my $TARGETS;
|
||||
@@ -647,6 +650,8 @@ sub applyConfiguration {
|
||||
|
||||
my %seen_users;
|
||||
|
||||
my %rename_group;
|
||||
|
||||
# Cache device/handler configuration
|
||||
foreach my $entry (keys %{$$config{'HANDLER'}}) {
|
||||
foreach my $device (@{$$config{'HANDLER'}->{$entry}->{'DEVICE'}}) {
|
||||
@@ -899,6 +904,17 @@ sub applyConfiguration {
|
||||
# Create new groups and add users..
|
||||
foreach my $group (keys %used_users) {
|
||||
if (!defined($USERS{$group})) {
|
||||
if ($group =~ /^$_TGT_DEF_PREFIX_/) {
|
||||
my $rnd_id = randomGroupId();
|
||||
my $tmp_group = $_TGT_TMP_PREFIX_.$rnd_id;
|
||||
|
||||
print "\t-> Using temporary group '$tmp_group' for group '$group'.\n";
|
||||
|
||||
$rename_group{$tmp_group} = $group;
|
||||
$used_users{$tmp_group} = $used_users{$group};
|
||||
$group = $tmp_group;
|
||||
}
|
||||
|
||||
if ($check) {
|
||||
print "\t-> New group definition '$group.'\n";
|
||||
$GROUPS{$group}++;
|
||||
@@ -991,6 +1007,13 @@ sub applyConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $tmp_group (keys %rename_group) {
|
||||
my $group = $rename_group{$tmp_group};
|
||||
print "\t-> Processing temporary group '$tmp_group'.\n";
|
||||
|
||||
renameGroup($tmp_group, $group);
|
||||
}
|
||||
|
||||
# Enable/Disable configured targets
|
||||
foreach my $type (keys %{$$config{'TARGETS'}}) {
|
||||
my $enable;
|
||||
@@ -1807,6 +1830,10 @@ sub validHandlerTypes {
|
||||
return $buffer;
|
||||
}
|
||||
|
||||
sub randomGroupId {
|
||||
return int(rand(10000));
|
||||
}
|
||||
|
||||
# If we have an unread error from SCST, exit immediately
|
||||
sub immediateExit {
|
||||
my $error = shift;
|
||||
|
||||
Reference in New Issue
Block a user