Blank encrypted messages

Joseph Bruni jbruni@mac.com
Wed Apr 30 03:06:03 2003


Does the variable "$msg" exist in the subshell? If it's not defined the 
you would be just echoing nothing into the left-hand side of the pipe.

In Perl, enclosing the string in single quotes would turn off variable 
interpolation. I don't know if that would be true for your language 
though. But if $msg doesn't get interpolated, and if it doesn't exist 
as an environment variable in the subshell, you will not get anything.


On Tuesday, April 29, 2003, at 12:38 AM, Matthew Reeve wrote:

>>> $command = 'echo "$msg" | /usr/bin/gpg -e -a --always-trust  --batch
>>> --no-secmem-warning -u matt@rangie.com -r matt@rangie.com';
>>> exec($command, $encrypted, $errorcode);
>> Are you sure that exec runs a shell?
>
> It must be running a shell, as I end up with an encrypted message -
> unfortunately it's just an encryption of nothing. I can log in as the 
> same
> user (apache) and run the command from the shell and get an output 
> which,
> when decrypted, contains the data. However when run from PHP the 
> encrypted
> data, when decrypted, contains nothing.
>
> I've re-written to use files being passed in and out, and the command 
> when
> exec'd or system'd returns an error code of 0 (zero).
>
> I'm absolutely stumped on this.
>
> Thanks for the suggestions so far,
>
> Matthew Reeve
>
>
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users@gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
>