Skip to content

Commit

Permalink
Force content type to be what's acceptable for a POST request to mailman
Browse files Browse the repository at this point in the history
  • Loading branch information
jcameron committed Dec 26, 2017
1 parent 559d4f4 commit 0de2cd4
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions admin.cgi
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,14 @@ my @realhosts = ( &get_system_hostname(),

# Read posted data
my $temp = &transname();
open(my $TEMP, ">", "$temp");
open(my $TEMP, ">", $temp);
my $qs;
if (defined(&read_fully)) {
&read_fully($STDIN, \$qs, $ENV{'CONTENT_LENGTH'});
}
else {
read(STDIN, $qs, $ENV{'CONTENT_LENGTH'});
}
&read_fully($STDIN, \$qs, $ENV{'CONTENT_LENGTH'});
print $TEMP $qs;
close($TEMP);
if ($ENV{'REQUEST_METHOD'} eq 'POST') {
$ENV{'CONTENT_TYPE'} = 'application/x-www-form-urlencoded';
}

# Run the real command, and fix up output
my $cmd = &command_as_user($cgiuser, 0, "$mailman_dir/cgi-bin/$prog");
Expand Down

0 comments on commit 0de2cd4

Please sign in to comment.