Skip Menu |

This queue is for tickets about the Net-Server CPAN distribution.

Report information
The Basics
Id: 17853
Status: resolved
Priority: 0/
Queue: Net-Server

People
Owner: Nobody in particular
Requestors: dobrin [...] imageworks.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.90
Fixed in: (no value)



Subject: "system" does not act upon Port data successfully in Cygwin
In NET::SERVER::PREFORK (v.90)module. On WinXP/ Cygwin1.5.18. Perl, v5.8.7 built for cygwin-thread-multi-64int. All is well on Linux but in Cygwin (1.5.18) everything works fine until I try to take the data coming in via the socket ($_) and fork off a "system" or "exec" using that data. When I do this, the client connection is abruptly closed without successfully performing the "system" call. If I define the variable internally it all works fine. Example: Sub make_dirs ( my $destinU = $_ ; chomp; $destinU =~ tr#\\#/#; $destinU =~ tr/://d; ##### # my $destinUnx = "/cygdrive/c/temp/newdir"; my $destinUnx = "/cygdrive/$destinU"; ##### if (! -d "$destinU" ){ print "Unix style path is $destinUnx\r\n"; system "mkdir -p ${destinUnx}" ; } } Result: when c:\temp\newdir is sent in I get: Unix style path is /cygdrive/c/temp/newdir #####And nothing happens and client session crashes. When I reverse the commented lines I get : Unix style path is /cygdrive/c/temp/newdir ##### the directory is created and the client session remains open and stable. If I run the first example on Linux (centos4) All works as it's suppose to. I tried running the above example in a script using the SOCKET module, and the above worked as expected .
Subject: working_strace
Download working_strace
application/octet-stream 21.1k

Message body not shown because it is not plain text.

Subject: notworking_strace
Download notworking_strace
application/octet-stream 15.2k

Message body not shown because it is not plain text.

This sounds like you are running in Taint enabled mode. If so, then data coming out of the socket is tainted and trying to use it in a system call will cause the server to die. You need to untaint your data by passing it through a regex and then capturing the output. There are numerous posts on perlmonks.org about how to untaint your data. Paul