phonet / capabilities

RaphaĆ«l Droz <[email protected]> Mon, 29 Sep 2014 16:42:18 -0300
Newsgroups gmane.linux.drivers.gnokii
Message-ID <20140929194218.GA8609@deeebian>
$ sudo getcap /usr/bin/gnokii
> /usr/bin/gnokii = cap_net_raw,cap_sys_admin+ep

# as unpriviledged user:

$ LANG=C strace gnokii --phone nokiausb2 --identify 2>&1|grep -i socket
> socket(0x23 /* PF_??? */, SOCK_DGRAM, 0) = -1 EPERM (Operation not permitted)
> write(2, "socket: Operation not permitted\n", 32socket: Operation not permitted

# as root

# LANG=C strace gnokii --phone nokiausb2  --identify 2>&1|grep -i socket
> socket(0x23 /* PF_??? */, SOCK_DGRAM, 0) = 4
> setsockopt(4, SOL_SOCKET, SO_BINDTODEVICE, "1", 1) = -1 ENODEV (No such device)


Question 1:
Granted here that as root, it can't find the device:
I don't know how to check for whether or not the phonet module got a
device attached, how to ?

Question 2:
the setcap does not seem sufficient. Does phonet depends upon another
permission amongs those from man 7 capabilities ?



thanks


Additional infos:
> linux-image-686-pae                   3.13+56 
> gnokii                                0.6.30+dfsg-1

$ lsusb -d 0421:0264
> Bus 002 Device 002: ID 0421:0264 Nokia Mobile Phones

=> phone is plugged and is 0x0421

$ sudo modinfo cdc-phonet|grep alias
> alias:          usb:v0421p*d*dc*dsc*dp*ic02iscFEip*in*

=> phonet announce supporting this vendor id

$ lsmod|grep cdc
> cdc_phonet             12681  0 
> phonet                 27101  1 cdc_phonet
> usbcore               133957  6 uhci_hcd,uvcvideo,usb_storage,ehci_hcd,ehci_pci,cdc_phonet

=> no other cdc* modules were loaded