usb - operation not permitted

Hi.

I am currently developing a proyect with libusb which connects to a custom usb hardware.
The problem is that every time that i clic on run as a user i get “operation not permitted” and the software doesnt works, but if i run the software from the console as root, it does works.
I have had the same problem in ubuntu and fixed it from udev, but here there isnt any rule for udev, only one line in fstab, which i tryed to edit, but nothing changes:

#/sys/bus/usb/drivers  /proc/bus/usb usbfs  devmode=664,devgid=1001 0 0
/sys/bus/usb/drivers  /proc/bus/usb usbfs  devmode=666,devgid=1000 0 0

(user 1000 is myusergroup, user 1001 is vboxusers)

This is not an answer, but I do not think that /etc/fstab has anything to do with your problem. The fstab is only about storage devices (anything that can be seen as a disk). Now such a device may be attached to the system using USB (harddisks, sticks, etc.) but they are of type MASS STORAGE. Other USB devices are of another type (printers, sound cards, network devices, you-name -it) and the system will not try to mount them (and thus not look to /etc/fstab).

IMHO you must look another way and I hope someone more knowing about udev may tune in here.

Try to find ‘50-udev-default’ file under /etc/udev/rules.d or /lib/udev/rules.d
Search for ‘libusb’

libusb device nodes

SUBSYSTEM==“usb”, ENV{DEVTYPE}==“usb_device”, NAME=“bus/usb/$env{BUSNUM}/$env{DEVNUM}”, MODE=“0644”
Change the MODE to “0666”

in our system 50-udev-default’is in

/etc/udev/rules.d

with the comment at the beginning

do not edit this file, it will be overwritten on update

?

Hi and thanks but there is no such a file in /etc/udev/rules.d
The files listed are:

40-alsa.rules 56-sane-backends-autoconfig.rules
40-bluetooth.rules 60-pcmcia.rules
40-lomoco.rules 60-vboxdrv.rules
41-soundfont.rules 65-wacom.rules
45-isdn.rules 70-kpartx.rules
51-lirc.rules 70-persistent-cd.rules
51-packagekit-firmware.rules 70-persistent-net.rules
52-irda.rules 71-multipath.rules
52-usx2yaudio.rules 77-network.rules
55-hpmud.rules 81-mptctl.rules
55-libsane.rules 98-parport.rules
56-hpmud_support.rules 99-pcsc_lite.rules
56-idedma.rules

Then you’ll need to reinstall udev package. All the required rules are supplied by this package.

To illustrate (from my openSUSE 11 system):

linux:/home/dean # rpm -ql udev
/etc/init.d/boot.udev
/etc/init.d/boot.udev_retry
/etc/modprobe.d
/etc/modprobe.d/pnp-aliases
/etc/scsi_id.config
/etc/udev
/etc/udev/rules.d
/etc/udev/rules.d/40-suse.rules
/etc/udev/rules.d/40-zaptel.rules
/etc/udev/rules.d/50-udev-default.rules
/etc/udev/rules.d/60-cdrom_id.rules
/etc/udev/rules.d/60-persistent-input.rules
/etc/udev/rules.d/60-persistent-storage-tape.rules
/etc/udev/rules.d/60-persistent-storage.rules
/etc/udev/rules.d/61-persistent-storage-edd.rules
/etc/udev/rules.d/64-device-mapper.rules
/etc/udev/rules.d/64-md-raid.rules
/etc/udev/rules.d/75-cd-aliases-generator.rules
/etc/udev/rules.d/75-persistent-net-generator.rules
/etc/udev/rules.d/80-drivers.rules
/etc/udev/rules.d/95-udev-late.rules
/etc/udev/udev.conf
/lib/udev
/lib/udev/ata_id
/lib/udev/cdrom_id
/lib/udev/collect
/lib/udev/create_floppy_devices
/lib/udev/devices
/lib/udev/devices/console
/lib/udev/devices/core
/lib/udev/devices/fd
/lib/udev/devices/fwmonitor
/lib/udev/devices/kmsg
/lib/udev/devices/lp0
/lib/udev/devices/net
/lib/udev/devices/net/tun
/lib/udev/devices/null
/lib/udev/devices/ppp
/lib/udev/devices/ptmx
/lib/udev/devices/pts
/lib/udev/devices/route
/lib/udev/devices/shm
/lib/udev/devices/skip
/lib/udev/devices/stderr
/lib/udev/devices/stdin
/lib/udev/devices/stdout
/lib/udev/devices/tty
/lib/udev/devices/tty1
/lib/udev/devices/ttyS0
/lib/udev/devices/ttyS1
/lib/udev/devices/ttyS2
/lib/udev/devices/ttyS3
/lib/udev/devices/ttyS4
/lib/udev/devices/ttyS5
/lib/udev/devices/ttyS6
/lib/udev/devices/ttyS7
/lib/udev/devices/watchdog
/lib/udev/devices/zero
/lib/udev/edd_id
/lib/udev/firmware.sh
/lib/udev/path_id
/lib/udev/rule_generator.functions
/lib/udev/scsi_id
/lib/udev/usb_id
/lib/udev/vol_id
/lib/udev/write_cd_rules
/lib/udev/write_net_rules
/sbin/udevadm
/sbin/udevcontrol
/sbin/udevd
/sbin/udevsettle
/sbin/udevtrigger
/usr/bin/udevinfo
/usr/share/man/man7/udev.7.gz
/usr/share/man/man8/ata_id.8.gz
/usr/share/man/man8/cdrom_id.8.gz
/usr/share/man/man8/create_floppy_devices.8.gz
/usr/share/man/man8/edd_id.8.gz
/usr/share/man/man8/path_id.8.gz
/usr/share/man/man8/scsi_id.8.gz
/usr/share/man/man8/udevadm.8.gz
/usr/share/man/man8/udevd.8.gz
/usr/share/man/man8/vol_id.8.gz

Thanks.

My file was on another place
/lib/udev/rules.d/50-udev-default.rules
changing the mask to 0666 for usb in that file solved the problem.
Now, i dont know why do i have an /etc/udev/*
¿Is this folder being watched by udev?


diego@linux-8mmd:~> rpm -ql udev
/etc/init.d/boot.udev
/etc/init.d/boot.udev_retry
/etc/modprobe.d
/etc/modprobe.d/pnp-aliases
/etc/scsi_id.config
/etc/udev
/etc/udev/rules.d
/etc/udev/udev.conf
/lib/udev
/lib/udev/ata_id
/lib/udev/cdrom_id
/lib/udev/collect
/lib/udev/create_floppy_devices
/lib/udev/devices
/lib/udev/devices/console
/lib/udev/devices/core
/lib/udev/devices/fd
/lib/udev/devices/fwmonitor
/lib/udev/devices/kmsg
/lib/udev/devices/lp0
/lib/udev/devices/net
/lib/udev/devices/net/tun
/lib/udev/devices/null
/lib/udev/devices/ppp
/lib/udev/devices/ptmx
/lib/udev/devices/pts
/lib/udev/devices/route
/lib/udev/devices/shm
/lib/udev/devices/skip
/lib/udev/devices/stderr
/lib/udev/devices/stdin
/lib/udev/devices/stdout
/lib/udev/devices/tty
/lib/udev/devices/tty1
/lib/udev/devices/ttyS0
/lib/udev/devices/ttyS1
/lib/udev/devices/ttyS2
/lib/udev/devices/ttyS3
/lib/udev/devices/ttyS4
/lib/udev/devices/ttyS5
/lib/udev/devices/ttyS6
/lib/udev/devices/ttyS7
/lib/udev/devices/watchdog
/lib/udev/devices/zero
/lib/udev/edd_id
/lib/udev/firmware.sh
/lib/udev/fstab_import
/lib/udev/path_id
/lib/udev/rule_generator.functions
/lib/udev/rules.d
/lib/udev/rules.d/40-suse.rules
/lib/udev/rules.d/40-zaptel.rules
/lib/udev/rules.d/50-udev-default.rules
/lib/udev/rules.d/60-cdrom_id.rules
/lib/udev/rules.d/60-persistent-input.rules
/lib/udev/rules.d/60-persistent-storage-tape.rules
/lib/udev/rules.d/60-persistent-storage.rules
/lib/udev/rules.d/60-persistent-v4l.rules
/lib/udev/rules.d/61-persistent-storage-edd.rules
/lib/udev/rules.d/64-device-mapper.rules
/lib/udev/rules.d/64-md-raid.rules
/lib/udev/rules.d/75-cd-aliases-generator.rules
/lib/udev/rules.d/75-persistent-net-generator.rules
/lib/udev/rules.d/79-fstab_import.rules
/lib/udev/rules.d/80-drivers.rules
/lib/udev/rules.d/95-udev-late.rules
/lib/udev/scsi_id
/lib/udev/usb_id
/lib/udev/vol_id
/lib/udev/write_cd_rules
/lib/udev/write_net_rules
/sbin/udevadm
/sbin/udevd
/sbin/udevsettle
/usr/bin/udevinfo
/usr/share/doc/packages/udev
/usr/share/doc/packages/udev/writing_udev_rules
/usr/share/doc/packages/udev/writing_udev_rules/index.html
/usr/share/man/man7/udev.7.gz
/usr/share/man/man8/ata_id.8.gz
/usr/share/man/man8/cdrom_id.8.gz
/usr/share/man/man8/create_floppy_devices.8.gz
/usr/share/man/man8/edd_id.8.gz
/usr/share/man/man8/path_id.8.gz
/usr/share/man/man8/scsi_id.8.gz
/usr/share/man/man8/udevadm.8.gz
/usr/share/man/man8/udevd.8.gz
/usr/share/man/man8/vol_id.8.gz

As written previously try to find it under:
“/etc/udev/rules.d
or
/lib/udev/rules.d”
else use some find tool.
It will be overwritten on update, but you are going to overwrite it again !!! Else find a more elegant solution.