FS#22336 - [udev] bad usb key group

Attached to Project: Community Packages
Opened by Sébastien Luttringer (seblu) - Thursday, 06 January 2011, 01:20 GMT
Last edited by Ionut Biru (wonder) - Thursday, 06 January 2011, 01:45 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

If i understand right, every usb key should be right/write by group storage. cf: https://wiki.archlinux.org/index.php/Group.

One of my usb key, kingston data have the bad group.

$ ll /dev/disk/by-id
lrwxrwxrwx 1 root root 9 2011-01-06 01:50 usb-Kingston_DataTraveler_2.0_5B870F0000D4-0:0 -> ../../sdb
lrwxrwxrwx 1 root root 10 2011-01-06 01:50 usb-Kingston_DataTraveler_2.0_5B870F0000D4-0:0-part1 -> ../../sdb1
$ ll /dev/sdb*
brw-rw---- 1 root disk 8, 16 2011-01-06 01:50 /dev/sdb
brw-rw---- 1 root disk 8, 17 2011-01-06 01:50 /dev/sdb1

So, rights is set by udev rule file /lib/udev/rules.d/81-arch.rules which match on scsi_level to select usb key

$ grep 'GROUP="storage"' 81-arch.rules
KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="0", GROUP="storage"
KERNEL=="sd*", ATTRS{scsi_level}=="5", GROUP="storage"
KERNEL=="sd*", ATTRS{scsi_level}=="3", ATTRS{type}=="7", GROUP="storage"
KERNEL=="hd*", ENV{ID_TYPE}=="generic", GROUP="storage"

but this key seems to have scsi_level =0. has you can see with lssci or via sysfs.

$ lsscsi -l 12:0:0:0
[12:0:0:0] disk Kingston DataTraveler 2.0 PMAP /dev/sdb
state=running queue_depth=1 scsi_level=0 type=0 device_blocked=0 timeout=30

We need to patch this rule file to better match usb key. My first plan was to add my scsi_level in file but, i look how debian handle do and to be honnest, it's really more sexy. In debian usb key have group floppy.

$ grep 'GROUP="floppy"' /lib/udev/rules.d/*
91-permissions.rules:SUBSYSTEM=="block", ATTRS{removable}=="1", GROUP="floppy"
91-permissions.rules:SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy"
91-permissions.rules:KERNEL=="cbm", GROUP="floppy"

So, I propose to doing the same matching.
This task depends upon

Closed by  Ionut Biru (wonder)
Thursday, 06 January 2011, 01:45 GMT
Reason for closing:  Duplicate
Additional comments about closing:   FS#22337 
Comment by Sébastien Luttringer (seblu) - Thursday, 06 January 2011, 01:21 GMT
sorry i make a mistake, it's not a community package but a core package.
Comment by Ionut Biru (wonder) - Thursday, 06 January 2011, 01:45 GMT
please do not do that again. reports can be moved around

Loading...