summaryrefslogtreecommitdiffstats
path: root/lasso
diff options
context:
space:
mode:
authorBenjamin Dauvergne <bdauvergne@entrouvert.com>2008-11-02 11:49:53 +0000
committerBenjamin Dauvergne <bdauvergne@entrouvert.com>2008-11-02 11:49:53 +0000
commit810f2a9bf97346ddeb9cec9b530f3b6210fd05ea (patch)
treea9c902704ff49b5938e353b108ed0ae53f63922c /lasso
parente6dfd11cd4d7027c746d3ea225ec6ac4a002f337 (diff)
downloadlasso-810f2a9bf97346ddeb9cec9b530f3b6210fd05ea.tar.gz
lasso-810f2a9bf97346ddeb9cec9b530f3b6210fd05ea.tar.xz
lasso-810f2a9bf97346ddeb9cec9b530f3b6210fd05ea.zip
Add verification of access before calling libxml loading function
* lasso/id-ff/provider.c: (lasso_provider_load_metadata) libxml emit warning when trying to parse non-existing or non-accessible file, so verify that the file is accessible before calling libxml. (the corner case of having warning when the file become inaccessible between the two calls is non-interesting)
Diffstat (limited to 'lasso')
-rw-r--r--lasso/id-ff/provider.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lasso/id-ff/provider.c b/lasso/id-ff/provider.c
index c00e6c89..363223b6 100644
--- a/lasso/id-ff/provider.c
+++ b/lasso/id-ff/provider.c
@@ -42,6 +42,7 @@
#include <lasso/id-ff/providerprivate.h>
#include <lasso/saml-2.0/providerprivate.h>
+#include <unistd.h>
#include "../utils.h"
#include "../debug.h"
@@ -723,9 +724,11 @@ lasso_provider_load_metadata(LassoProvider *provider, const gchar *path)
gboolean ret;
g_return_val_if_fail(LASSO_IS_PROVIDER(provider), FALSE);
+ if (access(path, R_OK) != 0) {
+ return FALSE;
+ }
doc = xmlParseFile(path);
if (doc == NULL) {
- lasso_release_doc(doc);
return FALSE;
}
ret = lasso_provider_load_metadata_from_doc(provider, doc);