]> granicus.if.org Git - apache-authnz-external/commitdiff
Minor fix + Output result code in externalgroup_check_authorization() error message
authorMicah Andersen <micah@bimi.org>
Fri, 1 Dec 2017 04:35:55 +0000 (23:35 -0500)
committerMicah Andersen <micah@bimi.org>
Fri, 1 Dec 2017 04:35:55 +0000 (23:35 -0500)
-t and w are never used in externalfilegroup_check_authorization(), so removed.

-externalgroup_check_authorization() now logs the last failing result code along with the 'User not in Required group.' message.
-code is initialized to 0 to prevent a compiler warning.

mod_authnz_external/mod_authnz_external.c

index 995e8e3840324d794c62b72ada1b61c976613e74..0a600eddf6b985506841f1b8263ef5ccb3f32b5e 100644 (file)
@@ -640,7 +640,7 @@ static authz_status externalgroup_check_authorization(request_rec *r,
     char *extname= dir->group_name;
     const char *extpath, *extmethod;
     const char *t, *w;
-    int code;
+    int code = 0;
 
     if (dir->authncheck){
         /* If no authenticated user, pass */
@@ -682,8 +682,8 @@ static authz_status externalgroup_check_authorization(request_rec *r,
 
     ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
        "Authorization of user %s to access %s failed. "
-       "User not in Required group.",
-       r->user, r->uri);
+       "User not in Required group. Last result code: %i",
+       r->user, r->uri, code);
 
     return AUTHZ_DENIED;
 }
@@ -704,7 +704,6 @@ static authz_status externalfilegroup_check_authorization(request_rec *r,
     char *extname= dir->group_name;
     const char *extpath, *extmethod;
     const char *filegroup= NULL;
-    const char *t, *w;
     int code;
 
     if (dir->authncheck){