fork and taint

Discussion in 'Perl Misc' started by Asterbing, Apr 5, 2006.

  1. Asterbing

    Asterbing Guest

    Hello. This script below crashes perl.exe when in taint mode. I've not
    any message in error log.

    #!/usr/bin/perl -T
    print "Content-type: text/html\n\n";
    my $pid = fork();
    die "fork: $!\n" unless defined $pid;
    if (!$pid){
    print "son ok<br>";
    exit 0;}
    print "daddy ok<br>";
    exit 0;

    It seems like the problem happen on line "my $pid = fork();" because if
    I stop the script just below using an "exit 0;", it crashes the same
    way.
     
    Asterbing, Apr 5, 2006
    #1
    1. Advertising

  2. Asterbing wrote:
    > Hello. This script below crashes perl.exe when in taint mode. I've not
    > any message in error log.
    >
    > #!/usr/bin/perl -T
    > print "Content-type: text/html\n\n";
    > my $pid = fork();
    > die "fork: $!\n" unless defined $pid;
    > if (!$pid){
    > print "son ok<br>";
    > exit 0;}
    > print "daddy ok<br>";
    > exit 0;
    >
    > It seems like the problem happen on line "my $pid = fork();" because if
    > I stop the script just below using an "exit 0;", it crashes the same
    > way.


    Have you considered to ask Perl for help?

    use strict;
    use warnings;
    use CGI::Carp 'fatalsToBrowser';

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Apr 5, 2006
    #2
    1. Advertising

  3. Asterbing

    Asterbing Guest

    In article <>, says...
    >
    > Have you considered to ask Perl for help?
    >
    > use strict;
    > use warnings;
    > use CGI::Carp 'fatalsToBrowser';
    >


    Yes, I've done it and not any explicit error message is shown. Here is
    the last script test I've used and it crashes the same way.

    I only get the "before fork ok" in browser and perl.exe crashes, nothing
    more. The only more thing I know, debugging the crash using Visual
    Studio is that the exception occurs in PERL58.DLL.

    #!/usr/bin/perl -T
    use strict;
    use warnings;
    use CGI::Carp qw/fatalsToBrowser/;
    print "Content-type: text/html\n\n";
    print "before fork ok<br>";
    my $pid = fork();
    die "fork: $!\n" unless defined $pid;
    if (!$pid){
    print "son ok<br>";
    exit 0;}
    print "daddy ok<br>";
    exit 0;
     
    Asterbing, Apr 8, 2006
    #3
  4. Asterbing wrote:
    > In article <>, says...
    >>
    >>Have you considered to ask Perl for help?
    >>
    >> use strict;
    >> use warnings;
    >> use CGI::Carp 'fatalsToBrowser';

    >
    > Yes, I've done it and not any explicit error message is shown. Here is
    > the last script test I've used and it crashes the same way.
    >
    > I only get the "before fork ok" in browser and perl.exe crashes, nothing
    > more. The only more thing I know, debugging the crash using Visual
    > Studio is that the exception occurs in PERL58.DLL.
    >
    > #!/usr/bin/perl -T
    > use strict;
    > use warnings;
    > use CGI::Carp qw/fatalsToBrowser/;
    > print "Content-type: text/html\n\n";
    > print "before fork ok<br>";
    > my $pid = fork();
    > die "fork: $!\n" unless defined $pid;
    > if (!$pid){
    > print "son ok<br>";
    > exit 0;}
    > print "daddy ok<br>";
    > exit 0;


    That script runs fine with my IndigoPerl build of Perl (5.8.6).

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Apr 8, 2006
    #4
  5. Asterbing

    Asterbing Guest

    In article <>, says...
    > That script runs fine with my IndigoPerl build of Perl (5.8.6).
    >


    Well, on my side, I'm using ActivePerl 5.8.7 build 815 and this script
    works fine if not in taint mode only :-(
     
    Asterbing, Apr 8, 2006
    #5
  6. Asterbing

    Asterbing Guest

    In article <>,
    says...
    > In article <>, says...
    > > That script runs fine with my IndigoPerl build of Perl (5.8.6).
    > >

    >
    > Well, on my side, I'm using ActivePerl 5.8.7 build 815 and this script
    > works fine if not in taint mode only :-(
    >


    Goog news : just updated to ActiveState ActivePerl 5.8.7.817 for Win32
    and the problem is gone using the test script (not tested alsewhere at
    this time). So, maybe a build 815's bug.
     
    Asterbing, Apr 9, 2006
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kristina Clair
    Replies:
    0
    Views:
    697
    Kristina Clair
    Aug 27, 2004
  2. Johann C. Rocholl

    Taint (like in Perl) as a Python module: taint.py

    Johann C. Rocholl, Feb 5, 2007, in forum: Python
    Replies:
    5
    Views:
    498
    Johann C. Rocholl
    Feb 6, 2007
  3. Eric Snow

    os.fork and pty.fork

    Eric Snow, Jan 8, 2009, in forum: Python
    Replies:
    0
    Views:
    602
    Eric Snow
    Jan 8, 2009
  4. Ben
    Replies:
    17
    Views:
    262
  5. Yohan N. Leder

    crash on fork in taint mode

    Yohan N. Leder, Jun 27, 2006, in forum: Perl Misc
    Replies:
    5
    Views:
    118
    Brian McCauley
    Jun 29, 2006
Loading...

Share This Page