1 |
commit: 8918300e01b08bc5bede8e8deb6ee4b451d54310 |
2 |
Author: Michael Mair-Keimberger (asterix) <m.mairkeimberger <AT> gmail <DOT> com> |
3 |
AuthorDate: Mon Feb 13 18:07:22 2017 +0000 |
4 |
Commit: David Seifert <soap <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Feb 14 21:39:01 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8918300e |
7 |
|
8 |
www-apache/mod_whatkilledus: remove unused file |
9 |
|
10 |
Closes: https://github.com/gentoo/gentoo/pull/3959 |
11 |
|
12 |
www-apache/mod_whatkilledus/files/gen_test_char.c | 121 ---------------------- |
13 |
1 file changed, 121 deletions(-) |
14 |
|
15 |
diff --git a/www-apache/mod_whatkilledus/files/gen_test_char.c b/www-apache/mod_whatkilledus/files/gen_test_char.c |
16 |
deleted file mode 100644 |
17 |
index 587583aed6..0000000000 |
18 |
--- a/www-apache/mod_whatkilledus/files/gen_test_char.c |
19 |
+++ /dev/null |
20 |
@@ -1,121 +0,0 @@ |
21 |
-/* Licensed to the Apache Software Foundation (ASF) under one or more |
22 |
- * contributor license agreements. See the NOTICE file distributed with |
23 |
- * this work for additional information regarding copyright ownership. |
24 |
- * The ASF licenses this file to You under the Apache License, Version 2.0 |
25 |
- * (the "License"); you may not use this file except in compliance with |
26 |
- * the License. You may obtain a copy of the License at |
27 |
- * |
28 |
- * http://www.apache.org/licenses/LICENSE-2.0 |
29 |
- * |
30 |
- * Unless required by applicable law or agreed to in writing, software |
31 |
- * distributed under the License is distributed on an "AS IS" BASIS, |
32 |
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
33 |
- * See the License for the specific language governing permissions and |
34 |
- * limitations under the License. |
35 |
- */ |
36 |
- |
37 |
-#include "apr.h" |
38 |
-#include "apr_lib.h" |
39 |
- |
40 |
-#if APR_HAVE_STDIO_H |
41 |
-#include <stdio.h> |
42 |
-#endif |
43 |
-#if APR_HAVE_STRING_H |
44 |
-#include <string.h> |
45 |
-#endif |
46 |
- |
47 |
-/* A bunch of functions in util.c scan strings looking for certain characters. |
48 |
- * To make that more efficient we encode a lookup table. |
49 |
- */ |
50 |
-#define T_ESCAPE_SHELL_CMD (0x01) |
51 |
-#define T_ESCAPE_PATH_SEGMENT (0x02) |
52 |
-#define T_OS_ESCAPE_PATH (0x04) |
53 |
-#define T_HTTP_TOKEN_STOP (0x08) |
54 |
-#define T_ESCAPE_LOGITEM (0x10) |
55 |
-#define T_ESCAPE_FORENSIC (0x20) |
56 |
- |
57 |
-int main(int argc, char *argv[]) |
58 |
-{ |
59 |
- unsigned c; |
60 |
- unsigned char flags; |
61 |
- |
62 |
- printf("/* this file is automatically generated by gen_test_char, " |
63 |
- "do not edit */\n" |
64 |
- "#define T_ESCAPE_SHELL_CMD (%u)\n" |
65 |
- "#define T_ESCAPE_PATH_SEGMENT (%u)\n" |
66 |
- "#define T_OS_ESCAPE_PATH (%u)\n" |
67 |
- "#define T_HTTP_TOKEN_STOP (%u)\n" |
68 |
- "#define T_ESCAPE_LOGITEM (%u)\n" |
69 |
- "#define T_ESCAPE_FORENSIC (%u)\n" |
70 |
- "\n" |
71 |
- "static const unsigned char test_char_table[256] = {", |
72 |
- T_ESCAPE_SHELL_CMD, |
73 |
- T_ESCAPE_PATH_SEGMENT, |
74 |
- T_OS_ESCAPE_PATH, |
75 |
- T_HTTP_TOKEN_STOP, |
76 |
- T_ESCAPE_LOGITEM, |
77 |
- T_ESCAPE_FORENSIC); |
78 |
- |
79 |
- for (c = 0; c < 256; ++c) { |
80 |
- flags = 0; |
81 |
- if (c % 20 == 0) |
82 |
- printf("\n "); |
83 |
- |
84 |
- /* escape_shell_cmd */ |
85 |
-#if defined(WIN32) || defined(OS2) |
86 |
- /* Win32/OS2 have many of the same vulnerable characters |
87 |
- * as Unix sh, plus the carriage return and percent char. |
88 |
- * The proper escaping of these characters varies from unix |
89 |
- * since Win32/OS2 use carets or doubled-double quotes, |
90 |
- * and neither lf nor cr can be escaped. We escape unix |
91 |
- * specific as well, to assure that cross-compiled unix |
92 |
- * applications behave similiarly when invoked on win32/os2. |
93 |
- * |
94 |
- * Rem please keep in-sync with apr's list in win32/filesys.c |
95 |
- */ |
96 |
- if (c && strchr("&;`'\"|*?~<>^()[]{}$\\\n\r%", c)) { |
97 |
- flags |= T_ESCAPE_SHELL_CMD; |
98 |
- } |
99 |
-#else |
100 |
- if (c && strchr("&;`'\"|*?~<>^()[]{}$\\\n", c)) { |
101 |
- flags |= T_ESCAPE_SHELL_CMD; |
102 |
- } |
103 |
-#endif |
104 |
- |
105 |
- if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=~", c)) { |
106 |
- flags |= T_ESCAPE_PATH_SEGMENT; |
107 |
- } |
108 |
- |
109 |
- if (!apr_isalnum(c) && !strchr("$-_.+!*'(),:@&=/~", c)) { |
110 |
- flags |= T_OS_ESCAPE_PATH; |
111 |
- } |
112 |
- |
113 |
- /* these are the "tspecials" from RFC2068 */ |
114 |
- if (c && (apr_iscntrl(c) || strchr(" \t()<>@,;:\\/[]?={}", c))) { |
115 |
- flags |= T_HTTP_TOKEN_STOP; |
116 |
- } |
117 |
- |
118 |
- /* For logging, escape all control characters, |
119 |
- * double quotes (because they delimit the request in the log file) |
120 |
- * backslashes (because we use backslash for escaping) |
121 |
- * and 8-bit chars with the high bit set |
122 |
- */ |
123 |
- if (c && (!apr_isprint(c) || c == '"' || c == '\\' || apr_iscntrl(c))) { |
124 |
- flags |= T_ESCAPE_LOGITEM; |
125 |
- } |
126 |
- |
127 |
- /* For forensic logging, escape all control characters, top bit set, |
128 |
- * :, | (used as delimiters) and % (used for escaping). |
129 |
- */ |
130 |
- if (!apr_isprint(c) || c == ':' || c == '|' || c == '%' |
131 |
- || apr_iscntrl(c) || !c) { |
132 |
- flags |= T_ESCAPE_FORENSIC; |
133 |
- } |
134 |
- |
135 |
- printf("%u%c", flags, (c < 255) ? ',' : ' '); |
136 |
- } |
137 |
- |
138 |
- printf("\n};\n"); |
139 |
- |
140 |
- return 0; |
141 |
-} |