From 4360889791c452db9ee27b0a47739d6c358e076c Mon Sep 17 00:00:00 2001 From: Mark Sapiro Date: Sat, 6 Apr 2013 22:54:18 -0700 Subject: Defended against buggy web servers that don't include an empty QUERY_STRING in the CGI environment. (LP: 1160647) --- scripts/driver | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts/driver') diff --git a/scripts/driver b/scripts/driver index a0b6b8c6..67ff0fdf 100644 --- a/scripts/driver +++ b/scripts/driver @@ -1,6 +1,6 @@ # -*- python -*- -# Copyright (C) 1998-2010 by the Free Software Foundation, Inc. +# Copyright (C) 1998-2013 by the Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License @@ -92,6 +92,11 @@ def run_main(): # Mailman.Cgi package. That module must have a main() function, which # we dig out and call. scriptname = sys.argv[1] + # Then we truncate sys.argv because buggy web servers have been + # observed which do not provide an empty QUERY_STRING in the + # environment which causes cgi.FieldStorage() to add sys.argv[1:] to + # the constructed instance. + del sys.argv[1:] # See the reference manual for why we have to do things this way. # Note that importing should have no side-effects! pkg = __import__('Mailman.Cgi', globals(), locals(), [scriptname]) -- cgit v1.2.3