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,27 @@ class RulesSetProperties {
218
225
219
226
/* *
220
227
*
221
- *
228
+ * The ConfigBoolean enumerator defines the states for configuration boolean values.
229
+ * The default value is PropertyNotSetConfigBoolean.
222
230
*/
223
231
enum ConfigBoolean {
224
232
TrueConfigBoolean,
225
233
FalseConfigBoolean,
226
234
PropertyNotSetConfigBoolean
227
235
};
228
236
237
+ /* *
238
+ *
239
+ * The ConfigXMLParseXmlIntoArgs enumerator defines the states for the configuration
240
+ * XMLParseXmlIntoArgs values.
241
+ * The default value is PropertyNotSetConfigXMLParseXmlIntoArgs.
242
+ */
243
+ enum ConfigXMLParseXmlIntoArgs {
244
+ TrueConfigXMLParseXmlIntoArgs,
245
+ FalseConfigXMLParseXmlIntoArgs,
246
+ OnlyArgsConfigXMLParseXmlIntoArgs,
247
+ PropertyNotSetConfigXMLParseXmlIntoArgs
248
+ };
229
249
230
250
/* *
231
251
*
@@ -338,6 +358,19 @@ class RulesSetProperties {
338
358
}
339
359
}
340
360
361
+ static std::string configXMLParseXmlIntoArgsString (ConfigXMLParseXmlIntoArgs i) {
362
+ switch (i) {
363
+ case TrueConfigXMLParseXmlIntoArgs:
364
+ return " True" ;
365
+ case FalseConfigXMLParseXmlIntoArgs:
366
+ return " False" ;
367
+ case OnlyArgsConfigXMLParseXmlIntoArgs:
368
+ return " OnlyArgs" ;
369
+ case PropertyNotSetConfigXMLParseXmlIntoArgs:
370
+ default :
371
+ return " Not set" ;
372
+ }
373
+ }
341
374
342
375
static int mergeProperties (RulesSetProperties *from,
343
376
RulesSetProperties *to, std::ostringstream *err) {
@@ -357,6 +390,10 @@ class RulesSetProperties {
357
390
from->m_secXMLExternalEntity ,
358
391
PropertyNotSetConfigBoolean);
359
392
393
+ merge_xmlargparse_value (to->m_secXMLParseXmlIntoArgs ,
394
+ from->m_secXMLParseXmlIntoArgs ,
395
+ PropertyNotSetConfigXMLParseXmlIntoArgs);
396
+
360
397
merge_boolean_value (to->m_uploadKeepFiles ,
361
398
from->m_uploadKeepFiles ,
362
399
PropertyNotSetConfigBoolean);
@@ -464,6 +501,7 @@ class RulesSetProperties {
464
501
ConfigBoolean m_secRequestBodyAccess;
465
502
ConfigBoolean m_secResponseBodyAccess;
466
503
ConfigBoolean m_secXMLExternalEntity;
504
+ ConfigXMLParseXmlIntoArgs m_secXMLParseXmlIntoArgs;
467
505
ConfigBoolean m_tmpSaveUploadedFiles;
468
506
ConfigBoolean m_uploadKeepFiles;
469
507
ConfigDouble m_argumentsLimit;
0 commit comments