diff --git a/scstadmin/scst-0.9.00/lib/SCST/SCST.pm b/scstadmin/scst-0.9.00/lib/SCST/SCST.pm index 1af06b8f9..d10c24a79 100644 --- a/scstadmin/scst-0.9.00/lib/SCST/SCST.pm +++ b/scstadmin/scst-0.9.00/lib/SCST/SCST.pm @@ -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) { diff --git a/scstadmin/scstadmin.sysfs b/scstadmin/scstadmin.sysfs index 29306b205..f1c71d10c 100755 --- a/scstadmin/scstadmin.sysfs +++ b/scstadmin/scstadmin.sysfs @@ -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; }