aboutsummaryrefslogtreecommitdiffstats
path: root/filter
diff options
context:
space:
mode:
Diffstat (limited to 'filter')
-rw-r--r--filter/ChangeLog4
-rw-r--r--filter/rule-context.c5
2 files changed, 8 insertions, 1 deletions
diff --git a/filter/ChangeLog b/filter/ChangeLog
index 2a3a45a8fb..9a660e60f6 100644
--- a/filter/ChangeLog
+++ b/filter/ChangeLog
@@ -1,3 +1,7 @@
+2003-06-11 Mike Kestner <mkestner@ximian.com>
+
+ * rule-context.c (load): stat the user file before parsing.
+
2003-06-06 Jeffrey Stedfast <fejj@ximian.com>
Fixes some leaks from bug #43883.
diff --git a/filter/rule-context.c b/filter/rule-context.c
index a1751b6e62..f76d9fae89 100644
--- a/filter/rule-context.c
+++ b/filter/rule-context.c
@@ -290,6 +290,7 @@ load(RuleContext *rc, const char *system, const char *user)
xmlNodePtr set, rule, root;
struct _part_set_map *part_map;
struct _rule_set_map *rule_map;
+ struct stat st;
rule_context_set_error(rc, NULL);
@@ -310,7 +311,9 @@ load(RuleContext *rc, const char *system, const char *user)
return -1;
}
/* doesn't matter if this doens't exist */
- rc->user = xmlParseFile(user);
+ rc->user = NULL;
+ if (stat (user, &st) != -1 && S_ISREG (st.st_mode))
+ rc->user = xmlParseFile(user);
/* now parse structure */
/* get rule parts */