Problem to connect hci as non-root
Hello,
I am trying to write an application that can be used to add or remove paired devices. But when I try to connect to the remote device (to add it to the paired devices), I get an error EPERM (when I try it as root, there is no problem). I can not suid root my application.
Is there a way to connect to a device as user, and to be able to do authentication ?
Regards
Fred
Signature · 19 lines
----------------------------------------------- It is not by improving the oil lamp that one invents the electric bulb! ----------------------------------------------- Danis Frederic PalmSource Europe Software engineer Mail : mailto:[email protected] ----------------------------------------------- ------------------------------------------------------- This SF.Net email is sponsored by Yahoo. Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005 _______________________________________________ Bluez-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Fred,
Quoted 7 lines
I am trying to write an application that can be used to add or remove paired devices. But when I try to connect to the remote device (to add it to the paired devices), I get an error EPERM (when I try it as root, there is no problem).
I can not suid root my application.
Is there a way to connect to a device as user, and to be able to do authentication ?
why don't you connect a L2CAP channel (for example SDP)?
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
OK, I thought about this but I don't know how to start the authentication from an L2CAP socket. Is it possible ?
Is it possible to acces to hci command from the L2CAP socket ?
Regards
Fred
-----------------------------------------------
It is not by improving the oil lamp that one invents the electric bulb!
-----------------------------------------------
Danis Frederic PalmSource Europe
Software engineer
Mail : mailto:[email protected]
-----------------------------------------------
Quoted 19 lines · Marcel Holtmann
Hi Fred,
Quoted 5 lines
I am trying to write an application that can be used to add or remove paired devices. But when I try to connect to the remote device (to add it to the paired devices), I get an error EPERM (when I try it as root, there is no problem). I can not suid root my application.
Is there a way to connect to a device as user, and to be able to do authentication ?why don't you connect a L2CAP channel (for example SDP)?
Regards
Marcel
Quoted 11 lines
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Fred,
Quoted 4 lines
OK, I thought about this but I don't know how to start the authentication from an L2CAP socket.
Is it possible ?
Is it possible to acces to hci command from the L2CAP socket ?
you can get the ACL handle through getsockopt() and then open an HCI raw socket and send the command. But I think the Authentication_Requested command will also fail due to limited permissions.
For some time I thought to add the possibility to do authentication and enable encryption through the socket interface or L2CAP and RFCOMM. At the moment I haven't decided if I wanna do that with setsockopt() or with ioctl(). Feel free to suggest something.
Do you think a pairing/bonding application is needed for Linux? If one side requests the authentication we will handle it through PIN helper and the rest is handled inside hcid. Deleting the link key is the only job we might need an application for.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
I agree with you that Linux should not need a pairing/bonding application. But we got one and want to keep it when porting our applications to Linux. I do not know differences between setsockopt() and ioctl() enough to give you an advice, sorry.
Is there any way to force the authentication (encryption) for a L2CAP socket (at creation time for example) ?
Regards
Fred
-----------------------------------------------
It is not by improving the oil lamp that one invents the electric bulb!
-----------------------------------------------
Danis Frederic PalmSource Europe
Software engineer
Mail : mailto:[email protected]
-----------------------------------------------
Quoted 31 lines · Marcel Holtmann
Hi Fred,
Quoted 5 lines
OK, I thought about this but I don't know how to start the authentication from an L2CAP socket. Is it possible ?
Is it possible to acces to hci command from the L2CAP socket ?you can get the ACL handle through
getsockopt()and then open an HCI raw socket and send the command. But I think theAuthentication_Requestedcommand will also fail due to limited permissions.For some time I thought to add the possibility to do authentication and enable encryption through the socket interface or L2CAP and RFCOMM. At the moment I haven't decided if I wanna do that with
setsockopt()or withioctl(). Feel free to suggest something.Do you think a pairing/bonding application is needed for Linux? If one side requests the authentication we will handle it through PIN helper and the rest is handled inside hcid. Deleting the link key is the only job we might need an application for.
Regards
Marcel
Quoted 11 lines
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerHi Fred,
Quoted 3 lines
I agree with you that Linux should not need a pairing/bonding application. But we got one and want to keep it when porting our applications to Linux.
you know that this will only work if the other side implements a simple trust policy. If you move to service based policies this makes no longer real sense. The only advantage will be that the link key is exchanged.
Quoted 2 lines
I do not know differences between
setsockopt()andioctl()enough to give you an advice, sorry.
If anyone have an opinion on this, please let me know. I am totally undecided at the moment.
Quoted 2 lines
Is there any way to force the authentication (encryption) for a L2CAP socket (at creation time for example) ?
We support if for the incoming connection on L2CAP and RFCOMM level, but nobody added support for outgoing connection. If you set the LM_AUTH flag for outgoing connections it will be ignored. Maybe it is worth to implement it.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
[Bluez-devel] l2ping and timeout
In reply to Frederic Danis-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I am confused about l2ping. The man says:
-c count
Send count number of packets then exit.
-c timeout
Wait timeout for the response.
- -c 1s - my first issue didnt work!
I need it to determine if a device is in range or out of range or off. If anyone has even an better Idea than l2ping this would help me too. A fast response when the Device is in range would be cool cuz the early my light switches on the less I stumble ...
ligi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCmfSW3NorRo/jFWIRAnSLAKDf6D3eIGA5wQSm5SXa7nO6GZMUYwCguJ03 wNoaSXPYY14oOnzsWkntumM=
=86Ig
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Marcel Holtmann
maintainerRe: [Bluez-devel] l2ping and timeout
Hi Ligi,
Quoted 6 lines
I am confused about l2ping. The man says:
-c count
Send count number of packets then exit.-c timeout
Wait timeout for the response.
no it does not.
Quoted 4 lines
I need it to determine if a device is in range or out of range or off. If anyone has even an better Idea than l2ping this would help me too. A fast response when the Device is in range would be cool cuz the early my light switches on the less I stumble ...
Use the periodic inquiry feature of Bluetooth through the HCI raw socket for this.
Regards
Marcel
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Re: [Bluez-devel] l2ping and timeout
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Quoted 9 lines · Marcel Holtmann
Hi Ligi,
Quoted 4 lines
I am confused about l2ping. The man says: -c count Send count number of packets then exit.
-c timeout Wait timeout for the response.
no it does not.
OK - my man says that - I have the newest from the gentoo portage - but it is from 2k2 ... Is there a newer man for l2ping ?
Quoted 10 lines
Quoted 5 lines
I need it to determine if a device is in range or out of range or off. If anyone has even an better Idea than l2ping this would help me too. A fast response when the Device is in range would be cool cuz the early my light switches on the less I stumble ...
Use the periodic inquiry feature of Bluetooth through the HCI raw socket for this.
Is there anything in the standart tool base for this? Any link / doc that lets me know how to do this?
Quoted 6 lines
Regards
Marcel
thanx
ligi
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCmhQF3NorRo/jFWIRAuaUAKDgJqulNjBewc4WR/yT0bOywqGiQACg0lLi nRFSUpyle8/3IYuATskpEuY=
=8mVc
-----END PGP SIGNATURE-----
-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo! Search APIs Find out how you can build Yahoo! directly into your own Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel