Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to prevent a program to run as root?[solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
GNUtoo
Veteran
Veteran


Joined: 05 May 2005
Posts: 1919

PostPosted: Fri Aug 31, 2007 9:28 pm    Post subject: how to prevent a program to run as root?[solved] Reply with quote

sometimes i don't pay attention at the status of the console(if it's root or not) and i run eclipse as root...
how do i prevent it running when i'm root

Code:
# eclipse-3.3
!!! You are running Eclipse as root. Be advised that this will modify the contents of
!!! /usr/lib/eclipse-3.3, and that such a modification may prevent you from safely
!!! upgrading to later 3.3 revisions.

!!! To ensure correct behavior on your next upgrade, do:
!!!  1) 'emerge unmerge "=eclipse-sdk-3.3"'
!!!  2) 'rm -rf /usr/lib/eclipse-3.3'
!!!  3) 'emerge eclipse-sdk'



and the contrary,..how to run kwrite as root without kdesu?


Last edited by GNUtoo on Fri Aug 31, 2007 10:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9679
Location: almost Mile High in the USA

PostPosted: Fri Aug 31, 2007 9:34 pm    Post subject: Reply with quote

one easy possibility is to put something earlier in root's path that will run some other program named the same thing, possibly in /sbin, or even easier, just create an alias to run 'echo' instead.

I had to do this for 'shutdown' ... I've shut down the incorrect machine multiple times, forces me to check carefully before shutting a machine down.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Rob1n
l33t
l33t


Joined: 29 Nov 2003
Posts: 714
Location: Cambridge, UK

PostPosted: Fri Aug 31, 2007 9:35 pm    Post subject: Re: how to prevent a program to run as root? and the contrat Reply with quote

GNUtoo wrote:
sometimes i don't pay attention at the status of the console(if it's root or not) and i run eclipse as root...
how do i prevent it running when i'm root

The only thing I can think of is to set an alias in root's .bashrc - if this has the same name as the application then it'll get run in preference.

Quote:
and the contrary,..how to run kwrite as root without kdesu?

You could chmod it as suid I guess. That'll mean anyone can edit anything using kwrite though.
Back to top
View user's profile Send private message
GNUtoo
Veteran
Veteran


Joined: 05 May 2005
Posts: 1919

PostPosted: Fri Aug 31, 2007 10:16 pm    Post subject: Reply with quote

i will use .bashrc for eclipse...
and i will also try it for kwtrite(alias kwrite='/usr/kde/3.5/bin/kwrite')

thanks...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum