Active Topics

 


Reply
Thread Tools
Posts: 20 | Thanked: 11 times | Joined on Apr 2010
#1
Hi

I'm trying to develop a bluetooth application for the n900 using Qt. However i'd like to test my app on my linux machine before porting it to maemo.
I'm using hci_write_class_of_dev(dd,0x200408,0); from the bluez library to make the device the application is running on identify itself as a bluetooth handsfree device. But this function needs root access so I can't debug my application because the call to this function will always fail.
Any Idea's on how I can solve this?

I'm using Qt creator on Kubuntu as my development environment.

Thanks in advance
 
Posts: 116 | Thanked: 86 times | Joined on Dec 2009 @ New Orleans, LA, USA
#2
How do you run anything as root? Run the app as the user root, or set the binary suid root. Or is there something more to this seemingly straightforward request that you forgot to include? Im sure i'm missing some detail that would make this make more sense.
 
Posts: 20 | Thanked: 11 times | Joined on Apr 2010
#3
Originally Posted by shinkamui View Post
How do you run anything as root? Run the app as the user root, or set the binary suid root. Or is there something more to this seemingly straightforward request that you forgot to include?
It's my first time developing in and for a linux environment so any clarification is appreciated
How do i set the binary suid?
 
Posts: 20 | Thanked: 11 times | Joined on Apr 2010
#4
I found a work around. I just lunch Qtcreator as root and all my problems go away.
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#5
Running Qtcreator as root is plain bad. This will let it destroy anything and everything if you foul up your build scripts. Furthermore, all files generated by it will be owned by root but saved in places where you'd most likely want to play around as normal user.

So, NEVER run build tools as root!
 
Posts: 20 | Thanked: 11 times | Joined on Apr 2010
#6
Originally Posted by Joorin View Post
Running Qtcreator as root is plain bad. This will let it destroy anything and everything if you foul up your build scripts. Furthermore, all files generated by it will be owned by root but saved in places where you'd most likely want to play around as normal user.

So, NEVER run build tools as root!
You said what not to do but you didn't give me any workaround for my initial problem.
 
Posts: 726 | Thanked: 345 times | Joined on Apr 2010 @ Sweden
#7
Originally Posted by anistein View Post
You said what not to do but you didn't give me any workaround for my initial problem.
Life is hard.

You've got at least two suggestions in other comments already. But...

SUID binaries are bad. Use sudo if you really want to run an application as root. Or start the application as root, and run the build process as a normal user.
 
Reply


 
Forum Jump


All times are GMT. The time now is 09:21.