[cups-devel] [LOW] STR #4454: CGI handling broken

Tim Waugh noreply at cups.org
Fri Jul 18 07:33:39 PDT 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

CGI script handling seems to be broken, and reverting the patch from STR
#3600 fixes it.

How to reproduce:
1. Create a simple perl script and copy it to /usr/share/cups/www:

#!/usr/bin/perl
print "Content-Type: text/plain\n\n";
print "Hello\n";
print "PATH_INFO=".$ENV{'PATH_INFO'}."\n";
print "QUERY_STRING=".$ENV{'QUERY_STRING'}."\n";

2. chmod -x /usr/share/cups/www/simple-script.pl
3. restorecon /usr/share/cups/www/simple-script.pl
4. echo "application/x-httpd-perl pl" > /etc/cups/cgi.types
6. Point a browser at http://localhost:631/simple-script.pl

Actual results: 500 internal server error.
Expected results: script output.

The attached cups-cgi.patch fixes it.

I note that PATH_INFO still isn't set regardless of URL. I think a correct
URL would be something like http://localhost:631/simple-script.pl/path, but
that gives 404. I don't really know enough about PATH_INFO to know
how/whether that should be fixed.

Link: https://www.cups.org/str.php?L4454
Version: 1.7.4
Attachment: https://www.cups.org/strfiles.php/3367/cups-cgi.patch
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
Comment: GPGTools - https://gpgtools.org

iQIcBAEBCgAGBQJTyTBDAAoJENujp6sI12Ij3HIQAJMiKpS8Yq+qVU2/VcKaC1ZC
XEdRk4wpPtoqV+UhNUFGHJ8EefT+NEB0AX9P9EhS8uWCpm3OC30TmlsPtBF+aW8V
j6scm7ldJsObAUncbnB7venMIvorhhhHQoKn4hZ4WHtUCY661752ARtPuUhGPOnk
4RWscktzR5jPcPyAqMs0C8kRba4TRYGr7NkDJMohxEJRxR225lSzxsfLeKWHgXUk
GsCXY0xo1NtcYYnHmjbxTbQKJyoCyaFnDNuLnVxJCcTJvH3Io2s+OBVlyLtCc8Wp
gx2yeh9WsZ4xB5Pd9NbwzQkZo5WdYkd99zBbrddSYuqff14pvFmHa6HwhfBdASty
lxPWvllRvv5Z5JqUQ+N4GXLYDplW6aE1IXBUGcwoJ9QhqyvY4iv1kePPK+gEmRTt
iS0Vs5WpTDpcOgSONW6Wt0SW8mKM2heJ2Het7CqkFX8u2s4gAc7i+fxnDD7y2wMd
/Rr58PfPN61CfL3KCvkL+lDCXeSBwp6AlLuhYqKnyEI2xFzmo3cXJe3jJgxvvK9G
En1D814rdTrJ4HE09aKYn5NzMex7Cv+Hc22/RUE9R7CFUCQeTdbErCOUAJSHfVoN
qk/1mWGeOQGY20ehXHBMVgKJxJoQtuVMBxrX1U9dZ5Ba+i5Q/9mz/rdNNjLAbBwB
Pb7mUJ730g0HMk6FCCth
=Y8mB
-----END PGP SIGNATURE-----




More information about the cups mailing list