develooper Front page | perl.perl5.porters | Postings from February 2015

[perl #123907] on Win32 exec LIST does not quote first argument

Thread Previous | Thread Next
From:
Christian Walde
Date:
February 23, 2015 10:00
Subject:
[perl #123907] on Win32 exec LIST does not quote first argument
Message ID:
rt-4.0.18-8562-1424685600-323.123907-75-0@perl.org
# New Ticket Created by  Christian Walde 
# Please include the string:  [perl #123907]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=123907 >


I tested this with AP 5.16, and SP 5.20.2, and as such assume the behavior to be present in all Perl versions, on Win7-64.

I tested it by running oneliners in a cmd shell and capturing the kernel events with procmon. As follows are the oneliners run, their truncated output and their respective event attributes. Please note the lack of quotes on the exec call:

--

perl -e "my @call = ('d:/s p/perl/bin/perl' ,'-v'); system(@call)"

This is perl 5, version 20, subversion 2 (v5.20.2) built for MSWin32-x86-multi-thread-64int [...]

--
 
Operation:	Process Create
Path:	d:\s p\perl\bin\perl.exe
Command line:	"d:/s p/perl/bin/perl" -v
 
Operation:	Process Start
Path:	
Command line:	"d:/s p/perl/bin/perl" -v
Current directory:	C:\Windows\System32\

-- 
 
perl -e "my @call = ('d:/s p/perl/bin/perl' ,'-v'); exec(@call)"

Can't open perl script "p/perl/bin/perl": No such file or directory

--

Operation:	Process Create
Path:	d:\s p\perl\bin\perl.exe
Command line:	d:/s p/perl/bin/perl -v
 
Operation:	Process Start
Path:	
Command line:	d:/s p/perl/bin/perl -v
Current directory:	C:\Windows\System32\


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About