aboutsummaryrefslogtreecommitdiffstats
path: root/filter/rule-context.c
diff options
context:
space:
mode:
authorMike Kestner <mkestner@ximian.com>2003-06-11 23:56:38 +0800
committerMike Kestner <mkestner@src.gnome.org>2003-06-11 23:56:38 +0800
commit59581dc2d31b2c7833115b35a4ec2fdc84a5cffb (patch)
tree9ee762b9b751f37b0cdb0e2a9963a150dd7e9de9 /filter/rule-context.c
parentf9257aeb4c12c759b5e3419a8ae94f5b2e1a3ad6 (diff)
downloadgsoc2013-evolution-59581dc2d31b2c7833115b35a4ec2fdc84a5cffb.tar.gz
gsoc2013-evolution-59581dc2d31b2c7833115b35a4ec2fdc84a5cffb.tar.zst
gsoc2013-evolution-59581dc2d31b2c7833115b35a4ec2fdc84a5cffb.zip
stat the user file before parsing.
2003-06-11 Mike Kestner <mkestner@ximian.com> * rule-context.c (load): stat the user file before parsing. svn path=/trunk/; revision=21408
Diffstat (limited to 'filter/rule-context.c')
-rw-r--r--filter/rule-context.c5
1 files changed, 4 insertions, 1 deletions
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 */