2006-11-19 11:50:01

by Mikael Lindqvist

[permalink] [raw]
Subject: [Bluez-users] permissions to set local name

Hi,

I've noticed that only the superuser may perform some hci commands, such as
OCF_WRITE_LOCAL_NAME and OCF_WRITE_INQUIRY_MODE. How can I grant privileges
for other users to perform those commands?

The problem is that I have an application that needs to set those
paramaters, but I don't want to run the application as root.

Thanks in advance!

-- Mikael


Attachments:
(No filename) (359.00 B)
(No filename) (388.00 B)
(No filename) (347.00 B)
(No filename) (164.00 B)
Download all attachments

2006-11-21 11:10:06

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] permissions to set local name

Hi Mikael,

> > > Do you know of something that makes it possible to use d-bus to do
> > > obex pushes? I have been looking for that but not found anything. The
> > > reason why I haven't used d-bus for my project before is mainly
> > > because of this, it would feel strange to have half the application
> > > use d-bus and the other half not.
> >
> > It is actually on my list of things that I like to have, but my time is
> > limited and so I might work on other stuff first.
>
> It would be useful... Just in case I would feel extra productive some
> day, how would you envision this? By a separate daemon that would sit
> and provide this service over d-bus, or would it be built in to hcid?
> Or maybe first as a separate daemon, and if it seems stable enough
> later it would be built into hcid?

it should be a separate daemon or even process implementing the service
agent interface.

> And would it be a good idea to build it on top of openobex? What other
> implementations of obex are there?

Non that I know of and yes, OpenOBEX is the way to go.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-11-21 09:36:20

by Mikael Lindqvist

[permalink] [raw]
Subject: Re: [Bluez-users] permissions to set local name

> > Do you know of something that makes it possible to use d-bus to do
> > obex pushes? I have been looking for that but not found anything. The
> > reason why I haven't used d-bus for my project before is mainly
> > because of this, it would feel strange to have half the application
> > use d-bus and the other half not.
>
> It is actually on my list of things that I like to have, but my time is
> limited and so I might work on other stuff first.
>

Ok,

It would be useful... Just in case I would feel extra productive some
day, how would you envision this? By a separate daemon that would sit
and provide this service over d-bus, or would it be built in to hcid?
Or maybe first as a separate daemon, and if it seems stable enough
later it would be built into hcid?

And would it be a good idea to build it on top of openobex? What other
implementations of obex are there?

-- Mikael

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-11-21 09:17:14

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] permissions to set local name

Hi Mikael,

> > With the bluez-utils-3.x series, the D-Bus support is required. We don't
> > support any non D-Bus version anymore. You will see the long term
> > advantage of D-Bus once you start using it. Trust me. I wasn't a believe
> > for a long time, but nowadays, D-Bus is the way to go.
> >
>
> Ok, I might give D-Bus a chance, but it depends.. :)

you should. At some point you start seeing the big picture.

> Do you know of something that makes it possible to use d-bus to do
> obex pushes? I have been looking for that but not found anything. The
> reason why I haven't used d-bus for my project before is mainly
> because of this, it would feel strange to have half the application
> use d-bus and the other half not.

It is actually on my list of things that I like to have, but my time is
limited and so I might work on other stuff first.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-11-21 09:14:12

by Mikael Lindqvist

[permalink] [raw]
Subject: Re: [Bluez-users] permissions to set local name

Hi,

>
> With the bluez-utils-3.x series, the D-Bus support is required. We don't
> support any non D-Bus version anymore. You will see the long term
> advantage of D-Bus once you start using it. Trust me. I wasn't a believe
> for a long time, but nowadays, D-Bus is the way to go.
>

Ok, I might give D-Bus a chance, but it depends.. :)

Do you know of something that makes it possible to use d-bus to do
obex pushes? I have been looking for that but not found anything. The
reason why I haven't used d-bus for my project before is mainly
because of this, it would feel strange to have half the application
use d-bus and the other half not.

-- Mikael

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-11-20 08:43:24

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] permissions to set local name

Hi Mikael,

> How does hcid know what mode that is "best" for my application? I want
> to make sure that it is 1 (result with rssi), is there a way I can
> tell hcid to always choose that mode then?

if inquiry with RSSI is supported by the chip, it will be activated for
any bluez-utils-3.x you use. In case you already have a chip that
supports extended inquiry from the Bluetooth 2.1 specification, it will
also enable that by default.

The events that indicate that a new device has been found are send out
over D-Bus and they are unified between all versions of the Bluetooth
specification. That is internal to hcid and you applications don't have
to worry about this stuff anymore. Same goes for the name resolving
after the inquiry process. It is all taken care of.

> Also, I would like to have as few external dependencies, so if
> possible I would prefer to not use d-bus. Is there a way to set the
> local name without d-bus and without root privileges?

With the bluez-utils-3.x series, the D-Bus support is required. We don't
support any non D-Bus version anymore. You will see the long term
advantage of D-Bus once you start using it. Trust me. I wasn't a believe
for a long time, but nowadays, D-Bus is the way to go.

Anyway, there is a security filter inside the kernel that can be
modified to allows certain commands for non-root users. However you are
on you own with doing that.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2006-11-20 08:31:57

by Mikael Lindqvist

[permalink] [raw]
Subject: Re: [Bluez-users] permissions to set local name

Hi again,

How does hcid know what mode that is "best" for my application? I want to
make sure that it is 1 (result with rssi), is there a way I can tell hcid to
always choose that mode then?

Also, I would like to have as few external dependencies, so if possible I
would prefer to not use d-bus. Is there a way to set the local name without
d-bus and without root privileges?

-- Mikael

On 11/19/06, Marcel Holtmann <[email protected]> wrote:
>
> Hi Mikael,
>
> > I've noticed that only the superuser may perform some hci commands,
> > such as OCF_WRITE_LOCAL_NAME and OCF_WRITE_INQUIRY_MODE. How can I
> > grant privileges for other users to perform those commands?
> >
> > The problem is that I have an application that needs to set those
> > paramaters, but I don't want to run the application as root.
>
> the inquiry mode should never be set by an application. It is up to hcid
> to pick the best inquiry mode.
>
> The local name can be set via the D-Bus interface and no root privileges
> are needed.
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>


Attachments:
(No filename) (1.54 kB)
(No filename) (2.12 kB)
(No filename) (347.00 B)
(No filename) (164.00 B)
Download all attachments

2006-11-19 12:47:51

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] permissions to set local name

Hi Mikael,

> I've noticed that only the superuser may perform some hci commands,
> such as OCF_WRITE_LOCAL_NAME and OCF_WRITE_INQUIRY_MODE. How can I
> grant privileges for other users to perform those commands?
>
> The problem is that I have an application that needs to set those
> paramaters, but I don't want to run the application as root.

the inquiry mode should never be set by an application. It is up to hcid
to pick the best inquiry mode.

The local name can be set via the D-Bus interface and no root privileges
are needed.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users