develooper Front page | perl.perl5.porters | Postings from December 2012

[perl #43631] Multi-argument system() invokes the shell under Win32

Thread Next
From:
bulk88 via RT
Date:
December 27, 2012 01:43
Subject:
[perl #43631] Multi-argument system() invokes the shell under Win32
Message ID:
rt-3.6.HEAD-17500-1356572631-1894.43631-15-0@perl.org
On Wed Jul 11 06:38:37 2007, demerphq wrote:
> 
> But if Jan Dubois or Steve Hay were to disagree with me id bow to
> their opinion.
> 
> Yves
> 
> 

CCing them.

I played around with this bug a little bit, when you feed a list to
win32 system, each scalar is double quoted. I couldn't cause any
additional execution through using "&"s.

system('echo', ' & echo JAPH');

becomes 

echo " & echo JAPH"

which fails,so it is retried to CreateProcess as

cmd.exe /x/d/c "echo " & echo JAPH""

yes those 2 double quotes look funny.

The result printed to console is 
______________________________________________
" & echo JAPH"

C:\p517\perl>
_______________________________________________
running manually on command line shows double execution
______________________________________________
C:\p517\perl>echo & echo JAPH
ECHO is on.
JAPH

C:\p517\perl>
______________________________________________
-- 
bulk88 ~ bulk88 at hotmail.com

---
via perlbug:  queue: perl5 status: open
https://rt.perl.org:443/rt3/Ticket/Display.html?id=43631

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