NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/52194: httpd fails to exec cgi scripts outside of cgi-bin



The following reply was made to PR bin/52194; it has been noted by GNATS.

From: Martin Husemann <martin%duskware.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/52194: httpd fails to exec cgi scripts outside of cgi-bin
Date: Wed, 26 Apr 2017 14:47:11 +0200

 Here is a simple method to reproduce it in -current as well.
 Extract below shar in a temp dir and then run the included ./dotest script.
 
 It will leave a background httpd and /bin/sh process around.
 
 Martin
 
 # This is a shell archive.  Save it in a file, remove anything before
 # this line, and then unpack it by entering "sh file".  Note, it may
 # create directories; files and directories will be owned by you and
 # have default permissions.
 #
 # This archive contains:
 #
 #	demo.sh
 #	dotest
 #	req
 #
 echo x - demo.sh
 sed 's/^X//' >demo.sh << 'END-of-demo.sh'
 X#! /bin/sh
 X
 Xprintf "Content-Type: plain/text\n\n"
 X
 Xprintf "Command line args:\n"
 Xecho *
 X
 Xprintf "\nEnvironment:\n"
 Xenv
 END-of-demo.sh
 echo x - dotest
 sed 's/^X//' >dotest << 'END-of-dotest'
 X#! /bin/sh
 X
 Xexec /usr/libexec/httpd -d -d -d -d -d -d -s -C .sh /bin/sh . www.test.com < req > resp
 END-of-dotest
 echo x - req
 sed 's/^X//' >req << 'END-of-req'
 XGET /demo.sh HTTP/1.1
 XHost: www.test.com
 END-of-req
 exit
 
 


Home | Main Index | Thread Index | Old Index