[Nut-upsuser] nut and megatec_usb

Anton Gorlov stalker at altlinux.ru
Fri Jul 31 13:53:05 UTC 2009


ut 2.4.1 works  with megatec_usb driver. It tries to interact with a 
device in /dev/bus/usb/X/Y, but there are root:root 664  access rights. 
  When I try to set  port  /dev/hiddev0  with write access in config 
file, in strace there are no records about accessing /dev/hiddev, but 
still only /dev/bus/usb/X/Y
How to explain such a behavior?

execve("./megatec_usb", ["./megatec_usb", "-a", "ups", "-u", "stalker", 
"-x", "port=/dev/hiddev0"], [/* 39 vars */]) = 0
brk(0)                                  = 0x610000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f0be9229000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) 
= 0x7f0be9228000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or 
directory)
...
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
getdents(4, /* 4 entries */, 4096)      = 96
close(4)                                = 0
open("/dev/bus/usb", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=80, ...}) = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
getdents(4, /* 4 entries */, 4096)      = 96
getdents(4, /* 0 entries */, 4096)      = 0
close(4)
open("/dev/bus/usb/002", O_RDONLY|O_NONBLOCK|O_DIRECTORY) = 4
fstat(4, {st_mode=S_IFDIR|0755, st_size=120, ...}) = 0
fcntl(4, F_SETFD, FD_CLOEXEC)           = 0
getdents(4, /* 6 entries */, 4096)      = 144
open("/dev/bus/usb/002/013", O_RDWR)    = -1 EACCES (Permission denied)
open("/dev/bus/usb/002/013", O_RDONLY)  = 5
ioctl(5, USBDEVFS_CONNECTINFO, 0x7ffff1226ac0) = -1 EPERM (Operation not 
permitted)
read(5, "\22\1\20\1\0\0\0\10e\6aQ\2\0\1\2\0\1"..., 18) = 18
read(5, "\t\2\"\0\1\1\3\200"..., 8)     = 8
read(5, "2\t\4\0\0\1\3\0\0\4\t!\0\1\0\1\"\33\0\7\5\201\3\10\0 "..., 26) = 26
close(5)                                = 0
open("/dev/bus/usb/002/004", O_RDWR)    = -1 EACCES (Permission denied)
....



More information about the Nut-upsuser mailing list