running a command with sudo
In theory you should use "visudo" to edit /etc/sudoers.. this adds
file locking and verification.
You could do something with the $EDITORS environment variable to call
a custom script...
but then visudo thinks of that and tries to stop you...
In conclusion your code looks OK!
Alex
On 21/04/2008, Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:
> Hi
>
> I need to allow the web interface in my live CD to run a few priviliged
> commands.
>
> I prepared a separate sudo_helper scriptand would like to run it through
> sudo. Is there any nicer way more proper than editing /etc/sudoers
> directly in a postinst script or a live CD chroot hook?
>
> The current edit command:
>
> LINE="www-data ALL=NOPASSWD:/usr/share/rapid-scripts/sudo_helper"
> if ! fgrep -q "$LINE" /etc/sudoers ; then
> echo "$LINE" >> /etc/sudoers
> fi
>
> --
> Tzafrir Cohen
> icq#16849755 jabber:tzafrir.cohen at xorcom.com
> +972-50-7952406 mailto:tzafrir.cohen at xorcom.com
> http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
>
> _______________________________________________
> debian-live-devel mailing list
> debian-live-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/debian-live-devel
>
Reply to: