2006-03-08 21:19:25

by Radek

[permalink] [raw]
Subject: [Bluez-devel] PIN helper

Hello,
from whot I had read in the net there had been some controversies about
the pinhelpers. The d-bus one need d-bus, and the python one need some
extra libs as well as X..
Maybe it was thougt before.. but I would suggest using a different
method. A list of devices with coresponding pins. This gives the
possibilities to have a different pin for different devices (important
especially if you have some that have a fixed pin:0000, not a very
secure idea for a default pin) and possibly a default pin as an option.
A very simple script that does that:

#!/bin/sh
echo "PIN:"$(grep $2 /etc/bluetooth/pins|sed s/.*PIN\://)

Not a very clean solusion (sorry I'm no programer, and my knowledge of
bash/sh is limited) but portable (bysybox suports all that is needed).
The obviously in format:

anything countaining the HWaddress of the device PIN: and the pin

this gives the possibility to have something like this:

00:0E:05:05:04:02; My cat; PIN:0000
00:0E:05:05:04:01; The dog; PIN:1111432334

It would be better if the script checked the files permisions, gave an
option to use a default pin and maybe some logging... But for that my
current sh knowledge is not enough.. sorry :-(

Still I think this is a beeter solusion, a more universal one, then the
ones shiped with bluez now.. which doesn't meen that the current
helpers are not helpful :)

My regards.

--
Radoslaw Rurarz
Warsaw Poland


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel


2006-03-13 04:08:03

by KrAnTi KaMbHaMpAtI

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

a side question related to this....

Is it possible to support multiple fixed passkeys like
"0000", "1234" etc.,

Rgds,
-K


--- Dave Mielke <[email protected]> wrote:

> [quoted lines by Radek Rurarz on 2006/03/10 at 23:24
> +0100]
>
> >Works.. both on PC and the iPAQ..
>
> Excellent! Here's a slightly newer copy wherein the
> -h output shows what can go
> into the configuration file as well as what should
> go into the pins file.
>
> There's just one line I need to fix as it still uses
> a bashism which I have yet
> to figure out how to do in Bourne Shell syntax. It's
> commented out for the time
> being (look for #fix). The effect of this is that
> the file mode check isn't
> being enforced.
>
> Assuming that I'm not being too presumptuous, what's
> the right way to now go
> about requesting that this script become the new PIN
> helper? My suggestion is
> to rename the current helper to xbluepin, and to
> place at least "command
> xbluepin" into the configuration file for this
> script.
>
> Can anyone think of any more enhancements?
>
> --
> Dave Mielke | 2213 Fox Crescent | I
> believe that the Bible is the
> Phone: 1-613-726-0014 | Ottawa, Ontario | Word of
> God. Please contact me
> EMail: [email protected] | Canada K2A 1H7 | if
> you're concerned about Hell.
> http://FamilyRadio.com/ |
> http://Mielke.cc/bible/
> > #!/bin/sh
> # This script has been written by Dave Mielke
> <[email protected]>. It's a light
> # weight, text mode, Bluetooth PIN helper script.
> #
> # Step 1: The PINs file, /etc/bluetooth/pins (can be
> changed with the -f
> # option), is searched for a line which corresponds
> to the Bluetooth address of
> # the device. Each line in this file should contain
> the address of a device and
> # its PIN, in that order, separated by space. Any
> additional data on the line
> # is ignored and can be used as a comment to help
> identify the device. For
> # example, if the address of your cell phone is
> 01:23:45:67:89:AB, and if its
> # PIN is 12345, then its line would look like this:
> #
> # 01:23:45:67:89:AB 12345 my cell phone
> #
> # If the address is found within the PINs file then
> the corresponding PIN is
> # returned.
> #
> # Step 2: If the -c option has been specified then
> its operand is interpreted
> # as the command which is to be used to prompt the
> user for the PIN. If it is
> # appropriately quoted so that it can contain space
> then options may be
> # specified after the command name. It must
> interpret its positional parameters
> # and return its response as if it were being
> directly invoked as a Bluetooth
> # PIN helper. If it returns a PIN then that PIN is
> returned.
> #
> # Step 3: If the -n option has not been specified
> then the user is prompted for
> # the PIN via a text-mode dialog in a free virtual
> terminal. The console
> # automatically returns to the original virtual
> terminal as soon as the user
> # responds to the dialog. If the response contains
> at least one character then
> # the entire response is returned as the PIN.
> #
> # Step 4: Return the fact that the PIN could not be
> determined.
> #
> # Error messages are written to the system log
> (syslog) if "logger" is in the
> # command search path ($PATH) and if standard output
> is not a terminal (tty or
> # pty). If any of these conditions is not satisfied
> then errors are written to
> # standard error.
> #
> # Invoke this script with the -h option to see a
> summary of its options,
> # parameters, and configuration file syntax.
>
> programName="${0##*/}"
> configurationDirectory="/etc/bluetooth"
>
configurationFile="${configurationDirectory}/${programName}.conf"
> defaultPinCommand=""
> defaultPinsFile="${configurationDirectory}/pins"
> defaultAcceptableModes="600"
>
> programMessage() {
> echo >&2 "${programName}: ${1}"
> }
>
> programError() {
> programMessage "${2}" error
> exit "${1}"
> }
>
> syntaxError() {
> programError 2 "${1}"
> }
>
> setVariable() {
> eval "${1}"'="${2}"'
> }
>
> findCommand() {
> variable="${1}"
> shift
> command="${1}"
>
> while [ "${#}" -gt 0 ]
> do
> path="`which "${1}" 2>/dev/null`"
> [ -n "${path}" ] && {
> setVariable "${variable}" "${path}"
> return 0
> }
> shift
> done
>
> programMessage "command not found: ${command}"
> return 1
> }
>
> isReadableFile() {
> [ -f "${1}" ] && {
> if [ ! -r "${1}" ]
> then
> programMessage "file not readable: ${1}"
> else
> return 0
> fi
> }
> return 1
> }
>
> respondWithPin() {
> echo "PIN:${1}"
> exit 0
> }
>
> [ ! -t 1 ] && {
> findCommand loggerPath logger && {
> programMessage() {
> "${loggerPath}" -t "${programName}[${$}]"
> -p "daemon.${2:-warning}" -- "${1}"
> }
> }
> }
>
> showUsage=false
> pinCommand="${defaultPinCommand}"
> pinsFile="${defaultPinsFile}"
> acceptableModes="${defaultAcceptableModes}"
> promptUser=true
> pinLimit=16
>
> [ -n "${configurationFile}" ] && isReadableFile
> "${configurationFile}" && {
> exec <"${configurationFile}"
> lineNumber=0
> while read attribute setting
> do
> lineNumber=`expr "${lineNumber}" + 1`
>
> case "${attribute}"
> in
> '') continue;;
> \#*) continue;;
>
> command)
> variable=pinCommand
> type=string
> ;;
>
> file)
> variable=pinsFile
> type=word
> ;;
>
> modes)
> variable=acceptableModes
> type=word
> ;;
>
> prompt)
> variable=promptUser
> type=flag
> ;;
>
> *) type=invalid;;
> esac
>
> problem=""
> if [ "${type}" = "invalid" ]
> then
> problem="invalid attribute: ${attribute}"
> elif [ "${type}" != "string" ]
> then
> if [ "${setting}" = "" ]
> then
> problem="missing attribute setting:
> ${attribute}"
> else
> excess="${setting#* }"
> if [ "${excess}" != "${setting}" ]
> then
> problem="excess data: ${excess}"
> elif [ "${type}" = "flag" ]
> then
> case "${setting}"
> in
> yes|ye|y|true|tru|tr|t|on)
> setting=true;;
> no|n|false|fals|fal|fa|f|off|of)
> setting=false;;
> *) problem="invalid flag setting:
> ${setting}";;
> esac
>
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 23:04:29

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/10 at 23:24 +0100]

>Works.. both on PC and the iPAQ..

Excellent! Here's a slightly newer copy wherein the -h output shows what can go
into the configuration file as well as what should go into the pins file.

There's just one line I need to fix as it still uses a bashism which I have yet
to figure out how to do in Bourne Shell syntax. It's commented out for the time
being (look for #fix). The effect of this is that the file mode check isn't
being enforced.

Assuming that I'm not being too presumptuous, what's the right way to now go
about requesting that this script become the new PIN helper? My suggestion is
to rename the current helper to xbluepin, and to place at least "command
xbluepin" into the configuration file for this script.

Can anyone think of any more enhancements?

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


Attachments:
(No filename) (1.11 kB)
bluepin (8.94 kB)
Download all attachments

2006-03-10 22:24:25

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Fri, 10 Mar 2006 15:55:04 -0500
Dave Mielke <[email protected]> wrote:

> [quoted lines by Radek Rurarz on 2006/03/10 at 20:22 +0100]
>=20
> >bluepin: invalid file permission modes:
>=20
> Fixed. Thanks. Here's a newer version which implements=20
> /etc/bluetooth/bluepin.conf. Try putting the following lines in it
> (indent not required):
>=20
> prompt no
> modes off

Works.. both on PC and the iPAQ..

Thank you :)

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 20:56:20

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

Oops! I was too hasty with the send button and forgot to attach the script.
Here it is.

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


Attachments:
(No filename) (389.00 B)
bluepin (8.56 kB)
Download all attachments

2006-03-10 20:55:04

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/10 at 20:22 +0100]

>bluepin: invalid file permission modes:

Fixed. Thanks. Here's a newer version which implements
/etc/bluetooth/bluepin.conf. Try putting the following lines in it (indent not
required):

prompt no
modes off

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 19:22:47

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Fri, 10 Mar 2006 13:39:33 -0500
Dave Mielke <[email protected]> wrote:

> [quoted lines by Radek Rurarz on 2006/03/10 at 19:13 +0100]
>=20
> >bluepin -n gives (there is no poin in launching the promp on the iPAQ
> >enyway.. no keyboard):
> >=20
> >bluepin: command not found: stat
> >bluepin: file permission modes not verifiable: /etc/bluetooth/pins
> >ERR
>=20
> Try disabling that check by specifying a null mode, i.e.: -m ''

bluepin: invalid file permission modes:

But I must admit, this script works better on my PC.

My regards.

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 18:39:33

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/10 at 19:13 +0100]

>bluepin -n gives (there is no poin in launching the promp on the iPAQ
>enyway.. no keyboard):
>
>bluepin: command not found: stat
>bluepin: file permission modes not verifiable: /etc/bluetooth/pins
>ERR

Try disabling that check by specifying a null mode, i.e.: -m ''

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 18:13:46

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Fri, 10 Mar 2006 12:25:25 -0500
Dave Mielke <[email protected]> wrote:


> Please try the attached updated script. I think I've removed all the
> bashisms. My /bin/sh, however, supports more than it should so it's
> hard for me to be sure.

bluepin -n gives (there is no poin in launching the promp on the iPAQ
enyway.. no keyboard):
=20
bluepin: command not found: stat
bluepin: file permission modes not verifiable: /etc/bluetooth/pins
ERR

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 18:10:14

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Fri, 10 Mar 2006 08:35:37 -0500
Dave Mielke <[email protected]> wrote:


> No problewm. I'll take out all of the bash-specific stuff and make it
> work in plain old sh. Is there a man page for that version of sh
> which you could send me for reference?

No, there is no man or info at all ror the basic instal of Familiar
0.8.3 ( http://www.handhelds.org/moin/moin.cgi/FamiliarDistribution )

The sh is from:
BusyBox v1.00 (2006.02.18-15:37+0000) multi-call binary
( http://www.busybox.net/ I think).

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 17:25:25

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/10 at 08:28 +0100]

>iPAQs or rather Familiar in general have a BusyBox all in one
>executable, at least for the basic comands.
>Bash is not present, it could be instaled, but at great expense of free
>space (or even not passible, doto lack of space).
>The executable has only sh, and I'm not sure is it a 100% full
>implementation.

Please try the attached updated script. I think I've removed all the bashisms.
My /bin/sh, however, supports more than it should so it's hard for me to be
sure.

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


Attachments:
(No filename) (837.00 B)
bluepin (6.57 kB)
Download all attachments

2006-03-10 13:35:37

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/10 at 08:28 +0100]

>iPAQs or rather Familiar in general have a BusyBox all in one
>executable, at least for the basic comands.
>Bash is not present, it could be instaled, but at great expense of free
>space (or even not passible, doto lack of space).
>The executable has only sh, and I'm not sure is it a 100% full
>implementation.

No problewm. I'll take out all of the bash-specific stuff and make it work in
plain old sh. Is there a man page for that version of sh which you could send
me for reference?

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 07:28:59

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Thu, 9 Mar 2006 20:33:08 -0500
Dave Mielke <[email protected]> wrote:

> Does your ipaq have /bin/bash, or did you try changing the first line
> of the script so that it points to /bin/sh. It looks like it isn't
> running bash. If bash isn't available on these platforms, or if a
> less functional version of bash is being used, then we'll just have
> to change the code to not use some of bash's cooler features.

Sorry, my foult (a bissy day and a late haur did have some evects :( )
iPAQs or rather Familiar in general have a BusyBox all in one
executable, at least for the basic comands.
Bash is not present, it could be instaled, but at great expense of free
space (or even not passible, doto lack of space).
The executable has only sh, and I'm not sure is it a 100% full
implementation.

Ps.
I did change the first line.

I'm sorry for rather poor information. I was trying to provide a fast
feedbak.. and in the proces dorgot to add much of the needed
information.

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-10 01:33:08

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/09 at 23:04 +0100]

>:( Unfortunatelly it doesn't.. BusyBox.. it seams to be mising some
>things..
>
>I get:
>/usr/bin/bluepin: 158: shopt: not found

shopt is a bash built-in command.

>/usr/bin/bluepin: 159: typeset: not found

typeset is a bash built-in command.

d>bluepin:
>exit: 159: Illegal number:

Does your ipaq have /bin/bash, or did you try changing the first line of the
script so that it points to /bin/sh. It looks like it isn't running bash. If
bash isn't available on these platforms, or if a less functional version of
bash is being used, then we'll just have to change the code to not use some of
bash's cooler features.

>Any ideas for making the script more portable?

I usually have ideas, but we need to first figure out what the problem is. If
the system does have bash, can you figure out which version of bash it is?

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-09 22:04:20

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Thu, 9 Mar 2006 22:55:21 +0100
Radek Rurarz <[email protected]> wrote:


> Ps.
> In a moment I'll put the script on iPAQ, if it works there.. I have
> nothing more to ask for.

:( Unfortunatelly it doesn't.. BusyBox.. it seams to be mising some
things..

I get:
/usr/bin/bluepin: 158: shopt: not found
/usr/bin/bluepin: 159: typeset: not found
/usr/bin/bluepin: 159: typeset: not found
/usr/bin/bluepin: 159: typeset: not found
/usr/bin/bluepin: 159: typeset: not found
/usr/bin/bluepin: 159: typeset: not found
bluepin:=20
exit: 159: Illegal number:

My regards.

Any ideas for making the script more portable?

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-09 21:55:21

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Thu, 9 Mar 2006 14:34:23 -0500
Dave Mielke <[email protected]> wrote:

> The latest version of the script is attached to this post. Please
> have a look at it and/or give it a try. I've went with making this
> option (-c) be non-cumulative for the time being, but it'd be very
> easy to change that. Please let me know what else you think needs to
> be done.

Ok, in place.. and working, at least with sending the pin form the
list :) (which is the part that I need).
Thank you...

For others ideas.. a config file, lets say /etc/bluetooth/pins.conf for
puting options like -n and -c ;) (disabling promp and seting
alternative helpers).

Still, as much as I'm concerned... I'm for changing the default
pinhelper to yours and adding the python X helper as one colled from it.

My regards.

Ps.
In a moment I'll put the script on iPAQ, if it works there.. I have
nothing more to ask for.


--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-09 19:34:23

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/09 at 19:29 +0100]

>For security reasons an simplicyty... one is a good idea.
>But having an option to try more then one is more universal (but not
>nessesary).
>If it's not a big problem (both for you to implement and for the system
>to compute..) it would be a nice feature.

The latest version of the script is attached to this post. Please have a look
at it and/or give it a try. I've went with making this option (-c) be
non-cumulative for the time being, but it'd be very easy to change that. Please
let me know what else you think needs to be done.

>I prefer a working program, then a problematic one with documentation ;)

I tend to agree.

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


Attachments:
(No filename) (993.00 B)
bluepin (6.77 kB)
Download all attachments

2006-03-09 18:29:53

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Thu, 9 Mar 2006 01:12:55 -0500
Dave Mielke <[email protected]> wrote:

> [quoted lines by Radek Rurarz on 2006/03/09 at 07:06 +0100]
>=20
> >A simpler method would be to relly on another pinhelper (for
> >instance one from the bluez-utlis) set in a config file.. juts pass
> >the arguments to it.. and see if it returns a propper pin.. if not
> >fall back to the internal methods (promp if allowed, the pin file
> >shoud be checked first).
>=20
> Do you think it should be just one, or should multiple specifications
> of the option accumulate a set of helpers to try?

Good question..
For security reasons an simplicyty... one is a good idea.
But having an option to try more then one is more universal (but not
nessesary).
If it's not a big problem (both for you to implement and for the system
to compute..) it would be a nice feature.
=20
> >Sorry, didn't noticed that... I need to work on my sh skills ;)
>=20
> I'm grateful that you didn't as that gave me the idea to document the
> "feature".

It would be nice ;) still the bluz is poorly documented as whole.. an
you're prepering the helper... The documentation is usually prepered
after something is ready ;)

Ps.
I prefer a working program, then a problematic one with documentation ;)

My regards.

Ps.
Sorry for any spelling mistakes...

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-09 06:12:55

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/09 at 07:06 +0100]

>A simpler method would be to relly on another pinhelper (for
>instance one from the bluez-utlis) set in a config file.. juts pass the
>arguments to it.. and see if it returns a propper pin.. if not fall
>back to the internal methods (promp if allowed, the pin file shoud be
>checked first).

Do you think it should be just one, or should multiple specifications of the
option accumulate a set of helpers to try?

>Sorry, didn't noticed that... I need to work on my sh skills ;)

I'm grateful that you didn't as that gave me the idea to document the
"feature".

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-09 06:06:49

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Thu, 9 Mar 2006 00:55:52 -0500
Dave Mielke <[email protected]> wrote:


> >> >possibly to chose another pinhelper if there
> >> >is no pin (for instance the one for X, if that fails to create a
> >> >promp).
>=20
> This one will take some thought. It could check to see if X is
> running, and then run the X one if so and do the text-mode thing
> otherwise. If that's okay, the option would be something like:
> -x /etc/bluetooth/xbluepin

A simpler method would be to relly on another pinhelper (for
instance one from the bluez-utlis) set in a config file.. juts pass the
arguments to it.. and see if it returns a propper pin.. if not fall
back to the internal methods (promp if allowed, the pin file shoud be
checked first).

Then it could be a standard pinhelper.. even with kde/gnome/opie/gpe
(last two on handhelds) on top.

> >> >3. In the pins file another 'slot' for the name of the device
> >> >(not nessesary the one advertised by it, rather to have an idea
> >> >whot is it)
>=20
> The script actually already did that, i.e. it ignores data after the
> PIN. Now it's documented, though, and even with an example.

Sorry, didn't noticed that... I need to work on my sh skills ;)

My regards.


--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-09 05:55:52

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/09 at 06:44 +0100]

>if the permissions are wrong (the
>propper ones set in a config file, or in the script itself) the script
>should not use the file and either refuse the connection = ERR (and
>syslog the error) or fallback to other methods of geting the PIN (if
>allowed).

Done. I won't let the permissions be more than 600 (although I'll perhaps add
an option to override that). The logging is done too.

>> >2. an option to chose wheather a promp should be used even if there
>> >is no pin in the file,

This one (-n for no prompt) has now been done.

>> >possibly to chose another pinhelper if there
>> >is no pin (for instance the one for X, if that fails to create a
>> >promp).

This one will take some thought. It could check to see if X is running, and
then run the X one if so and do the text-mode thing otherwise. If that's okay,
the option would be something like: -x /etc/bluetooth/xbluepin

>> >3. In the pins file another 'slot' for the name of the device
>> >(not nessesary the one advertised by it, rather to have an idea whot
>> >is it)

The script actually already did that, i.e. it ignores data after the PIN. Now
it's documented, though, and even with an example.

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-09 05:44:24

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Wed, 8 Mar 2006 17:16:44 -0500
Dave Mielke <[email protected]> wrote:

> [quoted lines by Radek Rurarz on 2006/03/08 at 23:01 +0100]
>=20
> >Some things I would like to have:
> >1. checking the permissions of the file
>=20
> Do you mean that you'd like it to log via syslog if the permissions
> are unsafe?

That would be nice. But first of all, if the permissions are wrong (the
propper ones set in a config file, or in the script itself) the script
should not use the file and either refuse the connection =3D ERR (and
syslog the error) or fallback to other methods of geting the PIN (if
allowed).

> >2. an option to chose wheather a promp should be used even if there
> >is no pin in the file, possibly to chose another pinhelper if there
> >is no pin (for instance the one for X, if that fails to create a
> >promp).
> >
> >3. In the pins file another 'slot' for the name of the device
> >(not nessesary the one advertised by it, rather to have an idea whot
> >is it)
>=20
> These are good ideas. Thanks. I'll do them.

I'll be greatful :)

My regards.

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-08 22:16:44

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek Rurarz on 2006/03/08 at 23:01 +0100]

>Some things I would like to have:
>1. checking the permissions of the file

Do you mean that you'd like it to log via syslog if the permissions are unsafe?

>2. an option to chose wheather a promp should be used even if there is
>no pin in the file, possibly to chose another pinhelper if there is no
>pin (for instance the one for X, if that fails to create a promp).
>
>3. In the pins file another 'slot' for the name of the device
>(not nessesary the one advertised by it, rather to have an idea whot is
>it)

These are good ideas. Thanks. I'll do them.

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-08 22:01:09

by Radek

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

On Wed, 8 Mar 2006 16:40:32 -0500
Dave Mielke <[email protected]> wrote:


> May I use this opportunity to "readvertise" a script I tried to bring
> to your collective attention some months ago. It's attached to this
> post as "bluepin". It works in text mode, supports a file containing
> address/pin mappings, and uses the dialog utility to bring up a
> text-mode prompt on a spare virtual terminal for devices not listed
> in the file. Please give it some consideration. I'll be glad to
> enhance it as necessary regarding whatever features it's missing or
> could use in addition to what it already does. See the comments at
> the top of the script for more detail.=20

Some things I would like to have:
1. checking the permissions of the file

2. an option to chose wheather a promp should be used even if there is
no pin in the file, possibly to chose another pinhelper if there is no
pin (for instance the one for X, if that fails to create a promp).

3. In the pins file another 'slot' for the name of the device
(not nessesary the one advertised by it, rather to have an idea whot is
it)

No more ideas for now.

My regards.

--=20
Rados=B3aw Rurarz
Warsaw Poland
GG: 7249330


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel

2006-03-08 21:40:32

by Dave Mielke

[permalink] [raw]
Subject: Re: [Bluez-devel] PIN helper

[quoted lines by Radek on 2006/03/08 at 22:19 +0100]

>from whot I had read in the net there had been some controversies about
>the pinhelpers. The d-bus one need d-bus, and the python one need some
>extra libs as well as X..

May I use this opportunity to "readvertise" a script I tried to bring to your
collective attention some months ago. It's attached to this post as "bluepin".
It works in text mode, supports a file containing address/pin mappings, and
uses the dialog utility to bring up a text-mode prompt on a spare virtual
terminal for devices not listed in the file. Please give it some consideration.
I'll be glad to enhance it as necessary regarding whatever features it's
missing or could use in addition to what it already does. See the comments at
the top of the script for more detail.

--
Dave Mielke | 2213 Fox Crescent | I believe that the Bible is the
Phone: 1-613-726-0014 | Ottawa, Ontario | Word of God. Please contact me
EMail: [email protected] | Canada K2A 1H7 | if you're concerned about Hell.
http://FamilyRadio.com/ | http://Mielke.cc/bible/


Attachments:
(No filename) (1.08 kB)
bluepin (1.91 kB)
Download all attachments