This repository has been archived by the owner on May 14, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 727
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #612 from dune73/known_bugs_rc2
Known bugs rc2
- Loading branch information
Showing
2 changed files
with
64 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env python | ||
# | ||
# This script reads all the rule files passed on the command line, | ||
# and outputs them, with each (multi-line) directive joined as a | ||
# single line. | ||
# | ||
# This can be used to work around a bug in Apache < 2.4.11 in | ||
# parsing long configuration directives. | ||
# | ||
# Usage: | ||
# | ||
# util/join-multiline-rules/join.py rules/*.conf > rules/rules.conf.joined | ||
# | ||
# This produces a single 'rules.conf.joined' file that can be included | ||
# in buggy Apache versions. It is recommended to keep this file in the | ||
# rules/ directory (because it refers to .data files in that directory) | ||
# but give it a name not ending in .conf (so the file will not be | ||
# included in *.conf and you can re-run the command multiple times | ||
# without including its own output). | ||
# | ||
# Example: | ||
# | ||
# SecRule &TX:paranoia_level "@eq 0" \ | ||
# "id:901120,\ | ||
# phase:1,\ | ||
# pass,\ | ||
# nolog,\ | ||
# setvar:tx.paranoia_level=1" | ||
# | ||
# will be outputted as: | ||
# | ||
# SecRule &TX:paranoia_level "@eq 0" "id:901120,phase:1,pass,nolog,setvar:tx.paranoia_level=1" | ||
# | ||
|
||
import fileinput, sys | ||
|
||
for line in fileinput.input(): | ||
line = line.strip() | ||
if line == '': | ||
sys.stdout.write("\n") | ||
continue | ||
|
||
if line[-1] == '\\': | ||
sys.stdout.write(line[0:-1]) | ||
else: | ||
sys.stdout.write(line) | ||
sys.stdout.write("\n") |