[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: phonet / capabilities
From: |
Raphaël Droz |
Subject: |
Re: phonet / capabilities |
Date: |
Mon, 29 Sep 2014 17:14:23 -0300 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Please excuse me, as I forget two things:
THe first one was to attach the config use:
> [phone_nokiausb2]
> model = series40
> port = 1
> connection = phonet
The second one was that I didn't set the capabilities to the strace
binary too and why I got confused.
So: setting cap_net_raw (for setsockopt()) and cap_sys_admin (for
socket()) is sufficient.
Then I hit:
$ 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)
## permission/capabilities problem solved
Reading through
http://lists.nongnu.org/archive/html/gnokii-users/2011-11/msg00007.html
it appears that the wiki (advising port = 1) is very misleading, thus I tried:
> [phone_nokiausb2]
> model = series40
> port = usbpn0
> connection = phonet
which seems far more better:
I now get:
> $ LANG=C strace gnokii --phone nokiausb3 --identify 2>&1|grep -i socket
> socket(0x23 /* PF_??? */, SOCK_DGRAM, 0) = 4
> setsockopt(4, SOL_SOCKET, SO_BINDTODEVICE, "usbpn0", 6) = 0
(as unpriviledged user).
Note that using:
port = 0 or port = usbpn1 both results in setsockopt returning ENODEV.
usbpn0 is thus a good bet.
## phonet port settings solved
But I know get:
> Serial device: opening device usbpn0
> Getting model...
> Message sent: 0x1b / 0x0006
> 00 01 00 07 01 00 |
> sendto: No route to host
and more exactly:
> sendto(4, "\0\7\1\0", 4, 0, {sa_family=0x23 /* AF_??? */,
> sa_data="\0\0\33\0\0\0\0\0\0\0\0\0\0\0"}, 16) = -1 EHOSTUNREACH (No route to
> host)
And I don't know how to troubleshoot that...
On Mon, Sep 29, 2014 at 04:42:18PM -0300, Raphaël Droz wrote:
> $ 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
--
GPG id: 0xD7F62B21