52
52
to = (from == PropertyNotSetBodyLimitAction) ? default : from; \
53
53
}
54
54
55
+ #define merge_xmlargparse_value (to, from, default ) \
56
+ if (to == PropertyNotSetConfigXMLParseXmlIntoArgs) { \
57
+ to = (from == PropertyNotSetConfigXMLParseXmlIntoArgs) ? default : from; \
58
+ }
59
+
55
60
#ifdef __cplusplus
56
61
57
62
namespace modsecurity {
@@ -177,6 +182,7 @@ class RulesSetProperties {
177
182
m_secRequestBodyAccess (PropertyNotSetConfigBoolean),
178
183
m_secResponseBodyAccess (PropertyNotSetConfigBoolean),
179
184
m_secXMLExternalEntity (PropertyNotSetConfigBoolean),
185
+ m_secXMLParseXmlIntoArgs (PropertyNotSetConfigXMLParseXmlIntoArgs),
180
186
m_tmpSaveUploadedFiles (PropertyNotSetConfigBoolean),
181
187
m_uploadKeepFiles (PropertyNotSetConfigBoolean),
182
188
m_debugLog (new DebugLog()),
@@ -191,6 +197,7 @@ class RulesSetProperties {
191
197
m_secRequestBodyAccess(PropertyNotSetConfigBoolean),
192
198
m_secResponseBodyAccess(PropertyNotSetConfigBoolean),
193
199
m_secXMLExternalEntity(PropertyNotSetConfigBoolean),
200
+ m_secXMLParseXmlIntoArgs(PropertyNotSetConfigXMLParseXmlIntoArgs),
194
201
m_tmpSaveUploadedFiles(PropertyNotSetConfigBoolean),
195
202
m_uploadKeepFiles(PropertyNotSetConfigBoolean),
196
203
m_debugLog(debugLog),
@@ -218,14 +225,28 @@ class RulesSetProperties {
218
225
219
226
/* *
220
227
*
221
- *
228
+ * The ConfigBoolean enumerator consists in mapping the different
229
+ * states of the configuration boolean values.
230
+ * The default value is PropertyNotSetConfigBoolean.
222
231
*/
223
232
enum ConfigBoolean {
224
233
TrueConfigBoolean,
225
234
FalseConfigBoolean,
226
235
PropertyNotSetConfigBoolean
227
236
};
228
237
238
+ /* *
239
+ *
240
+ * The ConfigXMLParseXmlIntoArgs enumerator consists in mapping the
241
+ * different states of the configuration XMLParseXmlIntoArgs values.
242
+ * The default value is PropertyNotSetConfigXMLParseXmlIntoArgs.
243
+ */
244
+ enum ConfigXMLParseXmlIntoArgs {
245
+ TrueConfigXMLParseXmlIntoArgs,
246
+ FalseConfigXMLParseXmlIntoArgs,
247
+ OnlyArgsConfigXMLParseXmlIntoArgs,
248
+ PropertyNotSetConfigXMLParseXmlIntoArgs
249
+ };
229
250
230
251
/* *
231
252
*
@@ -338,6 +359,19 @@ class RulesSetProperties {
338
359
}
339
360
}
340
361
362
+ static std::string configXMLParseXmlIntoArgsString (ConfigXMLParseXmlIntoArgs i) {
363
+ switch (i) {
364
+ case TrueConfigXMLParseXmlIntoArgs:
365
+ return " True" ;
366
+ case FalseConfigXMLParseXmlIntoArgs:
367
+ return " False" ;
368
+ case OnlyArgsConfigXMLParseXmlIntoArgs:
369
+ return " OnlyArgs" ;
370
+ case PropertyNotSetConfigXMLParseXmlIntoArgs:
371
+ default :
372
+ return " Not set" ;
373
+ }
374
+ }
341
375
342
376
static int mergeProperties (RulesSetProperties *from,
343
377
RulesSetProperties *to, std::ostringstream *err) {
@@ -357,6 +391,10 @@ class RulesSetProperties {
357
391
from->m_secXMLExternalEntity ,
358
392
PropertyNotSetConfigBoolean);
359
393
394
+ merge_xmlargparse_value (to->m_secXMLParseXmlIntoArgs ,
395
+ from->m_secXMLParseXmlIntoArgs ,
396
+ PropertyNotSetConfigXMLParseXmlIntoArgs);
397
+
360
398
merge_boolean_value (to->m_uploadKeepFiles ,
361
399
from->m_uploadKeepFiles ,
362
400
PropertyNotSetConfigBoolean);
@@ -464,6 +502,7 @@ class RulesSetProperties {
464
502
ConfigBoolean m_secRequestBodyAccess;
465
503
ConfigBoolean m_secResponseBodyAccess;
466
504
ConfigBoolean m_secXMLExternalEntity;
505
+ ConfigXMLParseXmlIntoArgs m_secXMLParseXmlIntoArgs;
467
506
ConfigBoolean m_tmpSaveUploadedFiles;
468
507
ConfigBoolean m_uploadKeepFiles;
469
508
ConfigDouble m_argumentsLimit;
0 commit comments