question on SCSI-scanners

Dieter Jurzitza dieter.jurzitza at t-online.de
Mon Jan 5 00:35:16 PST 2009


Hi Kay,
ok, here you go. Two different scanners on two different computers. Both 
on "/dev/sg2". One comes with the correct scsi attribute "6" for being a 
scanner, one stems from HP and denotes itself as attribute "3" for being a 
processor. Both is anticipated in current hal, however, it does not work as 
is now.

Maybe you'll see something that allows to debug how to create an acl for the 
scanner. The current hal setup from 11.1 does not provide it as required 
(practical approach: the scanner does not work but for user root).

device-permission is set to 0660 root.root.

By the way: udevinfo-djunix stems from a 10.3 installation, udevinfo-djunix3 
from a 11.1 installation, probably there are some differences, 
udevinfo-djunix has been created with "udevinfo" udevinfo-djunix3 
with "udevadm info", just to let you know.

Thank you in advance,
take care




Dieter

-- 
-----------------------------------------------------------

                               |
                                \
                 /\_/\           |
                | ~x~ |/-----\   /
                 \   /-       \_/
  ^^__   _        /  _  ____   /
 <°°__ \- \_/     |  |/    |  |
  ||  ||         _| _|    _| _|

if you really want to see the pictures above - use some font
with constant spacing like courier! :-)
-----------------------------------------------------------Am Sonntag, 4. 
Januar 2009 22:36:45 schrieb Kay Sievers:
> On Sun, Jan 4, 2009 at 20:08, Dieter Jurzitza
>
> <dieter.jurzitza at t-online.de> wrote:
> > imagine I have a SCSI-scanner that is detected and listed by hald,
> > because to my current understanding the udev - event of generated
> > device-nodes is being passed to hald (?).
> >
> > Now, what steps would be neccessary to make this device accessible to a
> > regular user? Initially the permissions come up with
> >
> > /dev/sg2  root.root 0660
> >
> > what clearly excludes anyone except root from accessing this device. If I
> > understood correctly an acl-rule would be required?
> >
> > Is there any good reason to create the device like this (i.e. owner /
> > group root.root) in contrast what happens usually to usb-scanners
> > (root.lp / root.scanner)?
> >
> > Could some nice soul provide some hints how to dig into this xml-stuff
> > and to understand _what_ needs to happen in order to provide the user
> > access and how this is happening?
> >
> > Any pointer is highly appreciated. Most documentation refers to block
> > devices and mounting - but I have a character device here and the only
> > task that needs to be accomplished is to provide access to users besides
> > root.
> >
> > The latest opensuse distribution unfortunately does not provide any
> > access to a scsi-scanner but through the net-interface via localhost for
> > non-root users - what seems like "from one's back through the chest into
> > the eye" to stress a German saying - it is complicated and hard to
> > explain to anyone.
> >
> > By the way: I have tried to read David Zeuthen's article on hal (Desktop
> > And Hardware Configuration) that says pci, usb, block and net devices are
> > handled (but I'm talking about a character special device, right?), I've
> > been looking into "Making Hardware Just Work" by Havoc(?) and "HAL and
> > device management" from www.mythic-beasts.com/~mark/random/hal, but I
> > haven't got a clue so far on how to proceed here.
> >
> > The documentation within the hal-sources is difficult to understand,
> > basically I'd have to understand the source code.
> >
> > Any help, any suggestions are largely appreciated,
> > thank you for taking the time to read,
>
> Right, you need an ACL on the device node, and we need to find out
> that the SCSI device is a scanner. Let's take a look at the device,
> and se what we can match against. What does:
>   /sbin/udevadm info --attribute-walk --name=/dev/sg2
> print?
>
> Kay
> _______________________________________________
> hal mailing list
> hal at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/hal


-------------- next part --------------

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/class/scsi_generic/sg2':
    KERNEL=="sg2"
    SUBSYSTEM=="scsi_generic"
    DRIVER==""
    ATTR{dev}=="21:2"

  looking at parent device '/devices/pci0000:00/0000:00:0d.1/host3/target3:0:6/3:0:6:0':
    KERNELS=="3:0:6:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""
    ATTRS{modalias}=="scsi:t-0x06"
    ATTRS{ioerr_cnt}=="0x0"
    ATTRS{iodone_cnt}=="0xa"
    ATTRS{iorequest_cnt}=="0xa"
    ATTRS{iocounterbits}=="32"
    ATTRS{timeout}=="0"
    ATTRS{state}=="running"
    ATTRS{rev}=="2.02"
    ATTRS{model}=="                "
    ATTRS{vendor}=="SCANNER "
    ATTRS{scsi_level}=="2"
    ATTRS{type}=="6"
    ATTRS{queue_type}=="none"
    ATTRS{queue_depth}=="2"
    ATTRS{device_blocked}=="0"
    ATTRS{uevent}=="MODALIAS=scsi:t-0x06"

  looking at parent device '/devices/pci0000:00/0000:00:0d.1/host3/target3:0:6':
    KERNELS=="target3:0:6"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{uevent}==""

  looking at parent device '/devices/pci0000:00/0000:00:0d.1/host3':
    KERNELS=="host3"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{uevent}==""

  looking at parent device '/devices/pci0000:00/0000:00:0d.1':
    KERNELS=="0000:00:0d.1"
    SUBSYSTEMS=="pci"
    DRIVERS=="aic7xxx"
    ATTRS{msi_bus}==""
    ATTRS{broken_parity_status}=="0"
    ATTRS{enable}=="1"
    ATTRS{modalias}=="pci:v00009005d000000CFsv000010F1sd00002462bc01sc00i00"
    ATTRS{local_cpus}=="ffffffff"
    ATTRS{irq}=="17"
    ATTRS{class}=="0x010000"
    ATTRS{subsystem_device}=="0x2462"
    ATTRS{subsystem_vendor}=="0x10f1"
    ATTRS{device}=="0x00cf"
    ATTRS{vendor}=="0x9005"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""
    ATTRS{uevent}==""

-------------- next part --------------

Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/pci0000:00/0000:00:14.4/0000:03:05.0/host6/target6:0:6/6:0:6:0/scsi_generic/sg2':
    KERNEL=="sg2"
    SUBSYSTEM=="scsi_generic"
    DRIVER==""

  looking at parent device '/devices/pci0000:00/0000:00:14.4/0000:03:05.0/host6/target6:0:6/6:0:6:0':
    KERNELS=="6:0:6:0"
    SUBSYSTEMS=="scsi"
    DRIVERS==""
    ATTRS{device_blocked}=="0"
    ATTRS{type}=="3"
    ATTRS{scsi_level}=="3"
    ATTRS{vendor}=="HP      "
    ATTRS{model}=="C7670A          "
    ATTRS{rev}=="3925"
    ATTRS{tgps}=="0"
    ATTRS{state}=="running"
    ATTRS{timeout}=="0"
    ATTRS{iocounterbits}=="32"
    ATTRS{iorequest_cnt}=="0x5"
    ATTRS{iodone_cnt}=="0x5"
    ATTRS{ioerr_cnt}=="0x0"
    ATTRS{modalias}=="scsi:t-0x03"
    ATTRS{evt_media_change}=="0"
    ATTRS{queue_depth}=="2"
    ATTRS{queue_type}=="none"

  looking at parent device '/devices/pci0000:00/0000:00:14.4/0000:03:05.0/host6/target6:0:6':
    KERNELS=="target6:0:6"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:14.4/0000:03:05.0/host6':
    KERNELS=="host6"
    SUBSYSTEMS=="scsi"
    DRIVERS==""

  looking at parent device '/devices/pci0000:00/0000:00:14.4/0000:03:05.0':
    KERNELS=="0000:03:05.0"
    SUBSYSTEMS=="pci"
    DRIVERS=="aic7xxx"
    ATTRS{vendor}=="0x9004"
    ATTRS{device}=="0x8178"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{class}=="0x010000"
    ATTRS{irq}=="20"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003"
    ATTRS{local_cpulist}=="0-1"
    ATTRS{modalias}=="pci:v00009004d00008178sv00000000sd00000000bc01sc00i00"
    ATTRS{numa_node}=="0"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}==""

  looking at parent device '/devices/pci0000:00/0000:00:14.4':
    KERNELS=="0000:00:14.4"
    SUBSYSTEMS=="pci"
    DRIVERS==""
    ATTRS{vendor}=="0x1002"
    ATTRS{device}=="0x4384"
    ATTRS{subsystem_vendor}=="0x0000"
    ATTRS{subsystem_device}=="0x0000"
    ATTRS{class}=="0x060401"
    ATTRS{irq}=="0"
    ATTRS{local_cpus}=="00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000003"
    ATTRS{local_cpulist}=="0-1"
    ATTRS{modalias}=="pci:v00001002d00004384sv00000000sd00000000bc06sc04i01"
    ATTRS{numa_node}=="0"
    ATTRS{enable}=="1"
    ATTRS{broken_parity_status}=="0"
    ATTRS{msi_bus}=="1"

  looking at parent device '/devices/pci0000:00':
    KERNELS=="pci0000:00"
    SUBSYSTEMS==""
    DRIVERS==""



More information about the hal mailing list