ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: execute command as root
Date Tue, 20 Apr 2004 20:26:15 GMT
Don't you need to pipe a password to su?  You could do
that using exec's inputstring (or to redirect from a
file, input) attribute... or for another idea, you
could put the chown into a shell script owned by root
and turn on SETUID for the shell script.  At least
this way you don't store root's password anyway and
you can control access to the script with groups...
you could also look into the kinds of things you can
do with sudo...

-Matt

--- stevecanfield@yahoo.com wrote:
> I have a script that needs to chown some files as
> root, but I don't want to have to execute everything
> as root. I've been trying to use 'su' with no
> success.
> Any ideas? I've been trying variations on the
> following:
>   <exec executable="su">
>     <arg value="-c 'chown -R someUser /var/tomcat'
> root"/>
>   </exec>
> 
> I've also tried running it from a shell:
>   <exec executable="sh">
>     <arg line="su -c 'chown -R someUser /var/tomcat'
> root"/>
>   </exec>
> 
> Should I be able to do something like this? I either
> get an error telling me that su wants input from
> stdin
> or that sh cannot run an executable.
> 
> -sc
> 
> 
> 	
> 		
> __________________________________
> Do you Yahoo!?
> Yahoo! Photos: High-quality 4x6 digital prints for
> 25
> http://photos.yahoo.com/ph/print_splash
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25
http://photos.yahoo.com/ph/print_splash

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message