|
|
7a6a25 |
From 7d31c404ab6c90d19c378aaefdd70baf1a62f142 Mon Sep 17 00:00:00 2001
|
|
|
7a6a25 |
From: =?UTF-8?q?Jan=20=C4=8Cern=C3=BD?= <jcerny@redhat.com>
|
|
|
7a6a25 |
Date: Mon, 18 Mar 2019 16:35:45 +0100
|
|
|
7a6a25 |
Subject: [PATCH] Don't ignore file behaviors if filepath is specified
|
|
|
7a6a25 |
|
|
|
7a6a25 |
The effect of the code removed by this patch is that the
|
|
|
7a6a25 |
max_depth, recurse, recurse_direction and recurse_file_system
|
|
|
7a6a25 |
attributes of the behaviors element are completely ignored
|
|
|
7a6a25 |
and reset to their default values if filepath element is specified
|
|
|
7a6a25 |
in the textfilecontent54_object. This is against OVAL specification
|
|
|
7a6a25 |
and it is inconsistent with file probe, from where a similar
|
|
|
7a6a25 |
code has been removed in 93d5f1416f232d6fa21fe8f2ad771d003749ea7b.
|
|
|
7a6a25 |
---
|
|
|
7a6a25 |
.../probes/independent/textfilecontent54.c | 31 -------------------
|
|
|
7a6a25 |
1 file changed, 31 deletions(-)
|
|
|
7a6a25 |
|
|
|
7a6a25 |
diff --git a/src/OVAL/probes/independent/textfilecontent54.c b/src/OVAL/probes/independent/textfilecontent54.c
|
|
|
7a6a25 |
index fc0f944e5..5f5890e15 100644
|
|
|
7a6a25 |
--- a/src/OVAL/probes/independent/textfilecontent54.c
|
|
|
7a6a25 |
+++ b/src/OVAL/probes/independent/textfilecontent54.c
|
|
|
7a6a25 |
@@ -415,37 +415,6 @@ int probe_main(probe_ctx *ctx, void *arg)
|
|
|
7a6a25 |
m_val = "1";
|
|
|
7a6a25 |
*/
|
|
|
7a6a25 |
|
|
|
7a6a25 |
- /* reset filebehavior attributes if 'filepath' entity is used */
|
|
|
7a6a25 |
- if (filepath_ent != NULL && bh_ent != NULL) {
|
|
|
7a6a25 |
- SEXP_t *r1, *r2, *r3;
|
|
|
7a6a25 |
- r1 = r2 = r3 = NULL;
|
|
|
7a6a25 |
- if (probe_ent_attrexists(bh_ent, "ignore_case")) {
|
|
|
7a6a25 |
- r1 = probe_ent_getattrval(bh_ent, "ignore_case");
|
|
|
7a6a25 |
- }
|
|
|
7a6a25 |
- if (probe_ent_attrexists(bh_ent, "multiline")) {
|
|
|
7a6a25 |
- r2 = probe_ent_getattrval(bh_ent, "multiline");
|
|
|
7a6a25 |
- }
|
|
|
7a6a25 |
- if (probe_ent_attrexists(bh_ent, "singleline")) {
|
|
|
7a6a25 |
- r3 = probe_ent_getattrval(bh_ent, "singleline");
|
|
|
7a6a25 |
- }
|
|
|
7a6a25 |
- r0 = SEXP_list_new(NULL);
|
|
|
7a6a25 |
- SEXP_free(bh_ent);
|
|
|
7a6a25 |
- bh_ent = probe_ent_creat1("behaviors", r0, NULL);
|
|
|
7a6a25 |
- SEXP_free(r0);
|
|
|
7a6a25 |
- if (r1) {
|
|
|
7a6a25 |
- probe_ent_attr_add(bh_ent, "ignore_case", r1);
|
|
|
7a6a25 |
- SEXP_free(r1);
|
|
|
7a6a25 |
- }
|
|
|
7a6a25 |
- if (r2) {
|
|
|
7a6a25 |
- probe_ent_attr_add(bh_ent, "multiline", r2);
|
|
|
7a6a25 |
- SEXP_free(r2);
|
|
|
7a6a25 |
- }
|
|
|
7a6a25 |
- if (r3) {
|
|
|
7a6a25 |
- probe_ent_attr_add(bh_ent, "singleline", r3);
|
|
|
7a6a25 |
- SEXP_free(r3);
|
|
|
7a6a25 |
- }
|
|
|
7a6a25 |
- }
|
|
|
7a6a25 |
-
|
|
|
7a6a25 |
probe_tfc54behaviors_canonicalize(&bh_ent);
|
|
|
7a6a25 |
|
|
|
7a6a25 |
pfd.instance_ent = inst_ent;
|