From: Andrea Zagli Date: Mon, 18 Dec 2017 16:27:25 +0000 (+0100) Subject: Mandatory configuration parameters. X-Git-Url: https://saetta.ns0.it/gitweb?a=commitdiff_plain;p=zakautho%2Fmod_authz Mandatory configuration parameters. --- diff --git a/src/mod_authz_zakautho.c b/src/mod_authz_zakautho.c index 4021e4b..3a439bf 100644 --- a/src/mod_authz_zakautho.c +++ b/src/mod_authz_zakautho.c @@ -113,6 +113,12 @@ check_authorization (request_rec *r, zakautho_config *config; + xmlDocPtr xdoc; + xmlNodePtr xnode; + + GError *error; + GdaConnection *gdacon; + if (!r->user) { return AUTHZ_DENIED_NO_USER; @@ -139,9 +145,6 @@ check_authorization (request_rec *r, if (config->xml_filename != NULL) { - xmlDocPtr xdoc; - xmlNodePtr xnode; - xdoc = xmlParseFile (config->xml_filename); if (xdoc != NULL) { @@ -162,9 +165,6 @@ check_authorization (request_rec *r, } else if (config->db_cnc_string != NULL) { - GError *error; - GdaConnection *gdacon; - error = NULL; gdacon = gda_connection_open_from_string (NULL, config->db_cnc_string, NULL, 0, &error); if (gdacon == NULL || error != NULL) @@ -184,6 +184,13 @@ check_authorization (request_rec *r, return AUTHZ_DENIED; } } + else + { + ap_log_rerror (APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02594) + "libzakautho configuration must be loaded from xml file or from database. " + "Please use AuthZakAuthoXmlFilename or AuthZakAuthoDbCncString in apache configuration."); + return AUTHZ_DENIED; + } _user = g_strdup_printf (config->user_decoration != NULL ? config->user_decoration : "%s", r->user); role_user = zak_autho_get_role_from_id (autho, _user);