mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 20:21:30 +00:00
- Fix handling of /dev paths.
- Check for device paths which have a '/' in checkConfiuration(). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1817 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2592,11 +2592,6 @@ sub handlerAttributes {
|
||||
|
||||
my $path = mkpath(SCST_ROOT, SCST_HANDLERS, $handler, $attribute);
|
||||
|
||||
if ($attribute =~ /\//) { # Hack
|
||||
push @{$attributes{'devices'}->{'value'}}, $attribute;
|
||||
next;
|
||||
}
|
||||
|
||||
my $io = new IO::File $path, O_RDONLY;
|
||||
|
||||
if (!$io) {
|
||||
|
||||
@@ -1272,6 +1272,26 @@ sub checkConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
foreach my $handler (sort keys %{$$CONFIG{'HANDLER'}}) {
|
||||
foreach my $device (sort keys %{$$CONFIG{'HANDLER'}->{$handler}->{'DEVICE'}}) {
|
||||
# Since some people may get confused with how to open
|
||||
# a vcdrom, we'll support having '/dev/cdrom' instead of just 'cdrom'.
|
||||
if ($device =~ /^\/dev\//) {
|
||||
my $_device = $device;
|
||||
$_device =~ s/^\/dev\///o;
|
||||
my $tree = $$CONFIG{'HANDLER'}->{$handler}->{'DEVICE'}->{$device};
|
||||
print "\t-> WARNING: Device '$device' configured for handler '$handler' may ".
|
||||
"not contain the full /dev path, please change to '$_device'.\n";
|
||||
delete $$CONFIG{'HANDLER'}->{$handler}->{'DEVICE'}->{$device};
|
||||
$$CONFIG{'HANDLER'}->{$handler}->{'DEVICE'}->{$_device} = $tree;
|
||||
} elsif ($device =~ /\//) {
|
||||
print "\t-> FATAL: Device '$device' configured for handler '$handler' may not ".
|
||||
"contain character '/'.\n";
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user