Hi Steve,
First for the quick response.
a) For the encrypt file, it seems the behaviour is not reproduced when the file is encrypted:
#crypt_file <test.pl >testenc.pl
OK
# perl ./testenc.pl
$0 : ./testenc.pl
--
root 3189 2984 4 13:12 pts/1 00:00:00 xxxxxxxxxxx 1 2 3 4
--
$0 : xxxxxxxxxxx 1 2 3 4
But this is not valid for me because I would like to pack everything into a binary executable. But the good news it
seems the problem is not reproduce
b) I tested with PAR alone (no filter)
test01:~# ./test A B C
$0 : ./test
--
root 3257 2984 0 13:23 pts/1 00:00:00 xxxxxx A B C <-- See that!!
--
$0 : xxxxxxxxxxx 1 2 3 4
As you can see, it does not work either. If you apply a filter to the PAR archive (different from crypto) ...
test01:~# ./test A B C
$0 : ./test
--
root 3276 2984 30 13:24 pts/1 00:00:00 xxxxxx A B C <-- Same result with other filter??
--
$0 : xxxxxxxxxxx 1 2 3 4
Same behaviour. Something weird... only 6 first character are replaced and arguments seems to be missing as well.. (????)
Any ideas? Could it be related to PAR??
Regards
> Subject: RE: [rt.cpan.org #48752] $0 is not working when encrypted
> From: bug-Filter-Crypto@rt.cpan.org
> To: mianrojas@hotmail.com
> Date: Mon, 17 Aug 2009 04:45:10 -0400
>
> <URL:
http://rt.cpan.org/Ticket/Display.html?id=48752 >
>
> Hi Miguel,
>
>
>
> Thanks for the bug report.
>
>
>
> Unfortunately, I only have a Windows system available and I can't reproduce this problem. I have Cygwin installed, but your test program (unencrypted!) just produces this:
>
>
>
> $ perl ./test.pl
>
> $0 : ./test.pl
>
> --
>
> shay 4960 3504 con 09:36:22 /usr/bin/perl
>
> shay 2884 4960 con 09:36:22 /usr/bin/sh
>
> --
>
> $0 : xxxxxxxxxxx 1 2 3 4
>
>
>
> Note that you're doing two things at once with the "pp -f Crypto..." command: you're encrypting the script and you're packaging it up into a PAR executable. Perhaps you could do some further tests to discover whether it is the encryption done by Filter-Crypto or the executable packaging done by PAR that is the cause of the problem.
>
>
>
> For example, if you run the crypt_file script to encrypt test.pl but don't package it up into a PAR executable, does that exhibit the same problem?
>
>
>
> And if you run "pp" without the -f / -F / -M arguments to produce a PAR executable in which the script is not encrypted, does that exhibit the same problem?
>
>
>
> Cheers,
>
> Steve
>
>
>
>
>
> > -----Original Message-----
>
> > From: Miguel Angel Rojas Gómez via RT [mailto:bug-Filter-
>
> > Crypto@rt.cpan.org]
>
> > Sent: 16 August 2009 16:09
>
> > To: undisclosed-recipients
>
> > Subject: [rt.cpan.org #48752] $0 is not working when encrypted
>
> >
>
> > Sun Aug 16 11:08:31 2009: Request 48752 was acted upon.
>
> > Transaction: Ticket created by mianrojas@hotmail.com
>
> > Queue: Filter-Crypto
>
> > Subject: $0 is not working when encrypted
>
> > Broken in: (no value)
>
> > Severity: (no value)
>
> > Owner: Nobody
>
> > Requestors: mianrojas@hotmail.com
>
> > Status: new
>
>
> >
>
> >
>
> >
>
> > Hi all,
>
> >
>
> >
>
> >
>
> > Here is an very short and concise example in which you can see
>
> > something is not working properly when a perl file is encrypted:
>
> >
>
> >
>
> >
>
> > # cat test.pl
>
> > #!/usr/bin/perl
>
> >
>
> > print "\$0 : $0\n";
>
> > $0 = "xxxxxxxxxxx 1 2 3 4";
>
> > print "--\n";
>
> > system("ps -ef | grep -v grep | grep $$");
>
> > print "--\n";
>
> > print "\$0 : $0\n";
>
> >
>
> > exit 0;
>
> >
>
> >
>
> >
>
> > # ./test.pl A B C
>
> > $0 : ./test.pl
>
> > --
>
> > root 2992 2806 0 16:53 pts/0 00:00:00 xxxxxxxxxxx 1 2 3 4
>
> > --
>
> > $0 : xxxxxxxxxxx 1 2 3 4
>
> >
>
> >
>
> >
>
> > # pp -f Crypto -F Crypto -M Filter::Crypto::Decrypt -o test test.pl
>
> >
>
> >
>
> >
>
> > # ./test A B C
>
> > $0 : ./test
>
> > --
>
> > root 3017 2806 99 16:53 pts/0 00:00:01 xxxxxx A B C
>
> > --
>
> > $0 : xxxxxxxxxxx 1 2 3 4
>
> >
>
> >
>
> >
>
> > # uname -a
>
> > Linux test01 2.6.26-2-686 #1 SMP Sun Jun 21 04:57:38 UTC 2009 i686
>
> > GNU/Linux
>
> >
>
> >
>
> >
>
> > # perl -v
>
> >
>
> > This is perl, v5.10.0 built for i486-linux-gnu-thread-multi
>
> >
>
> > Copyright 1987-2007, Larry Wall
>
> >
>
> > Perl may be copied only under the terms of either the Artistic License
>
> > or the
>
> > GNU General Public License, which may be found in the Perl 5 source kit.
>
> >
>
> > Complete documentation for Perl, including FAQ lists, should be found
>
> > on
>
> > this system using "man perl" or "perldoc perl". If you have access to
>
> > the
>
>
> > Page.
>
> >
>
> >
>
> >
>
> > I'm currently using Debian GNU/Linux, lenny version. Crypto (1.23)
>
> > modules have been compiled and installed properly with no error.
>
> >
>
> >
>
> >
>
> > As you can see, it seems not possible to change executable name when
>
> > file is encrypted and only 6 characters have changed.
>
> >
>
> > It seems to be an error, because encryption should warranty same output.
>
> >
>
> >
>
> >
>
> > Any ideas?
>
> >
>
> >
>
> >
>
> > Thanks for you help.
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> >
>
> > _________________________________________________________________
>
> > Internet Explorer 8 más sencillo y seguro ¡Descárgatelo gratis!
>
>