Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Developing an app that needs root privileges ?
Developing an app that needs root privileges ? [message #237745] Fri, 27 October 2006 14:53 Go to next message
Eclipse UserFriend
Originally posted by: me.somewhere.com

I need to use a raw socket for some special communications. Raw sockets
in Linux need root privileges. Any tips for developing an app that needs
root access ?

Should the app itself query the user for root login if the user isn't root
? Or just exit gracefully ?

Would running Eclipse as root make things simpler or would it mess up a
lot of things ?
Re: Developing an app that needs root privileges ? [message #237814 is a reply to message #237745] Mon, 30 October 2006 17:06 Go to previous messageGo to next message
Eclipse UserFriend
The question is indeed - do you run the java application as root or somehow
to switch to root for your operation. I would wrap that raw sockets
functionality in a separate
native process (you need native access anyway) and then you can ask the
user for password
or anything else you need.

Genady Beryozkin
http://www.genady.net/rmi/



me2 wrote:
> I need to use a raw socket for some special communications. Raw sockets
> in Linux need root privileges. Any tips for developing an app that needs
> root access ?
>
> Should the app itself query the user for root login if the user isn't root
> ? Or just exit gracefully ?
>
> Would running Eclipse as root make things simpler or would it mess up a
> lot of things ?
>
Re: Developing an app that needs root privileges ? [message #238024 is a reply to message #237814] Thu, 09 November 2006 00:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: me.somewhere.com

On Tue, 31 Oct 2006 00:06:57 +0200, Genady wrote:

> The question is indeed - do you run the java application as root or somehow
> to switch to root for your operation. I would wrap that raw sockets
> functionality in a separate
> native process (you need native access anyway) and then you can ask the
> user for password
> or anything else you need.
>
> Genady Beryozkin
> http://www.genady.net/rmi/


I will wrap the raw socket in a separate thread. However, in the mean
time I'd like a simple way to test the test app. How can one do this in
Eclipse ? Is there an easy way to run the app as su ? Maybe set
something in the run parameters ?

Thanks.
Re: Developing an app that needs root privileges ? [message #238044 is a reply to message #238024] Thu, 09 November 2006 14:53 Go to previous messageGo to next message
Eclipse UserFriend
If you set the setuid bit on the executable and it is owned by root, the
application will run as root. However, you will obviously want to restrict
access to the file to prevent it being changed (or perhaps even run) by
users other than those you intend it for.

You can get more from here: http://www.linuxjournal.com/article/2114


"me2" <me@somewhere.com> wrote in message
news:eiuei7$a6t$1@utils.eclipse.org...
> On Tue, 31 Oct 2006 00:06:57 +0200, Genady wrote:
>
>> The question is indeed - do you run the java application as root or
>> somehow
>> to switch to root for your operation. I would wrap that raw sockets
>> functionality in a separate
>> native process (you need native access anyway) and then you can ask the
>> user for password
>> or anything else you need.
>>
>> Genady Beryozkin
>> http://www.genady.net/rmi/
>
>
> I will wrap the raw socket in a separate thread. However, in the mean
> time I'd like a simple way to test the test app. How can one do this in
> Eclipse ? Is there an easy way to run the app as su ? Maybe set
> something in the run parameters ?
>
> Thanks.
Re: Developing an app that needs root privileges ? [message #238055 is a reply to message #238044] Fri, 10 November 2006 14:52 Go to previous message
Eclipse UserFriend
Originally posted by: me.somewhere.com

On Thu, 09 Nov 2006 14:53:55 -0500, Joe Skora wrote:

> If you set the setuid bit on the executable and it is owned by root, the
> application will run as root. However, you will obviously want to restrict
> access to the file to prevent it being changed (or perhaps even run) by
> users other than those you intend it for.

Thanks for the reply. Hmmm... I didn't think of doing it that way. I was
expecting a Java solution to change the user or something. My app will be
multi platform some day, ie XP and Linux. Is there a standard way to run
something as superuser when you start it as a regular user ?

Thanks.
Previous Topic:Need to explicitliy create JUnit launch configration
Next Topic:Trouble integrating ant build (j2ee/weblogic)
Goto Forum:
  


Current Time: Sun Jul 20 19:57:25 EDT 2025

Powered by FUDForum. Page generated in 0.04498 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top