Originally Posted by b0uncer
I guess it is, but to me it sounds like a security risk "piping" a password, especially if you thought to do it clear-text-wise.
EDIT: of course it's not good having no password at all, either.
I wasn't planning on doing in real clear text. But using a C application something like this:
sprintf(cmd, "echo %c%c%c%c | sudo -S /etc/init.d/apache2 restart", pass, pass, pass, pass);