Instead of passthru, why not use backticks?
So:
<?
function getDELETEPRIVATE()
{
ob_start();
`/usr/bin/gpg --no-secmem-warning --home /home/test/.gnupg --yes
--yes --delete-secret-key 'B209E218'`;
echo"<pre>";
$lookup = ob_get_contents();
ob_end_clean();
return $lookup;
}
$delete = getDELETEPRIVATE();
echo "=========================================</BR>";
echo "<pre>$delete</pre>";
?>
That said, remember, this is going to be executed by www-data (or apache,
I don't recall the user assigned by redhat to the webserver. www-data
isn't likely to have the permissions to execute the command on test's key.
Root can do it. Clearly, you don't want to run apache as root, so the
answer is to use sudo.
Ian
On Sat, 14 Dec 2002, Graziano wrote:
> Hello
>
> I written a php script to delete secret keys , however I receive this error ;
> >gpg: cannot open /dev/tty
>
> If I add --no-tty I receive this error ,
> >gpg: Sorry, no terminal at all requested - can't get input
>
> Any idea ?
>
> Below there is the php script (the command executed is on $command) .
> Thank you
> Graziano Meneguzzo
> Rome ,Italy
>
> <?
> function getDELETEPRIVATE()
> {
> ob_start();
> $command = "/usr/bin/gpg --no-secmem-warning --home /home/test/.gnupg --yes
> --yes --delete-secret-key 'B209E218'";
>
> passthru($command);
>
> echo"<pre>";
> $lookup = ob_get_contents();
> ob_end_clean();
> return $lookup;
> }
>
> $delete = getDELETEPRIVATE();
> echo "=========================================</BR>";
> echo "<pre>$delete</pre>";
> ?>
>
>
>
>
> _______________________________________________
> Seawolf-list mailing list
> [EMAIL PROTECTED]
> https://listman.redhat.com/mailman/listinfo/seawolf-list
>
_______________________________________________
Seawolf-list mailing list
[EMAIL PROTECTED]
https://listman.redhat.com/mailman/listinfo/seawolf-list