[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: A little daemon



On Thursday 17 October 2002 15:11, Andrew Perrin wrote:
> It's a bad idea :)
>
> No, really - what do you need to do that can't be done by sudo, cron, or
> at?  These are well-tested tools and will probably make you happier than
> your plan.
>
> However, if you insist on doing it your way, yes, a perl script that runs
> as root, listens on a socket, and runs the commands piped to it and
> returns the results would be easy to write.  One caution: perl (like most
> processes) doesn't release memory back to the OS, so it's a good idea to
> make the loop something like:
>
> for my $i (1..1000) {
> 	# wait for connect
> 	# do stuff
> 	# return result
> }
>
> exec "$FindBin::Bin/$0";
>
> so the script renews itself every 1000 connections or so.
>
> Let me reiterate, though: it's a BAD IDEA. How will you make sure nobody
> has access to running root scripts through your daemon?
>
> ap
>

hehe, I thought your answer may result like that :-))

I need it for a small KDE application wich needs to execute some privileged 
procecesses (like mount) WITHOUT password promting to the user. The KDE app 
itself can't run as root (casue that needs an extra enviroment and i don't 
want that) and setuid root is not a good idea cause of the kdelibs (and also 
here a root env would be necessary).

So i thought using i methos like the one above would the simple and good. If u 
have a better (and simple) idea i would be really interessted to hear it 
:-))) and hey, thanks for your thoughts about that :-)

cheers,
Raffaele
-- 
Raffaele Sandrini <rasa@gmx.ch>
Annoyed about M$ Windows? Don't worry. Try Linux! (www.linux.org)



Reply to: