lkml.org 
[lkml]   [2001]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectQ: device(file) permissions for USB
Hi,

I have been playing with an USB camera. I've run into the following
problem:
The (default?) permissions for /proc/bus/usb/001/011 (and others) are
0644. This makes the ioctl (see attached trace to fail). So I have to:
either chmod the usb device file each time I unplug and replug the camera
OR make the pencam program SUID root, which is neither comfortable.
Is there a way to affect the default permissions for the USB devices?

regards
Kees
open("/proc/bus/usb/002/001", O_RDONLY) = 5
read(5, "\22\1\0\1\t\0\0\10\0\0\0\0\0\0\0\2\1\1", 18) = 18
close(5) = 0
ipc_subcall(0x4, 0x804e568, 0x400, 0) = 0
close(4) = 0
open("/proc/bus/usb/001/011", O_RDWR) = -1 EACCES (Permission denied)
open("/proc/bus/usb/001/011", O_RDONLY) = 4
ioctl(4, 0x80045505, 0xbfffeaf8) = -1 EPERM (Operation not permitted)
fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 7), ...}) = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x40017000
ioctl(1, TCGETS, {B9600 opost isig icanon echo ...}) = 0
write(1, "pencam_set_configuration error\n", 31) = 31
ioctl(4, 0xc0105500, 0xbfffeaac) = -1 EPERM (Operation not permitted)
ioctl(4, 0xc0105500, 0xbfffeaac) = -1 EPERM (Operation not permitted)
write(1, "Last error: 255, command = 0xff"..., 33) = 33
write(1, "Camera ping failed!! Check conne"..., 54) = 54
write(1, "Error initializing camera!!\n", 28) = 28
close(4) = 0
\
 
 \ /
  Last update: 2005-03-22 13:13    [W:0.024 / U:0.240 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site