Sun compiler type safety.
[shibboleth/sp.git] / apache / mod_apache.cpp
index e2010c2..960b2cf 100644 (file)
@@ -313,7 +313,7 @@ extern "C" int shib_check_user(request_rec* r)
 #endif
     ShibTargetApache sta(r);
 
-    // Check user authentication, the set the handler bypass
+    // Check user authentication and export information, then set the handler bypass
     pair<bool,void*> res = sta.doCheckAuthN(true);
     apr_pool_userdata_setn((const void*)42,g_UserDataKey,NULL,r->pool);
     if (res.first) return (int)res.second;
@@ -421,9 +421,7 @@ public:
     void unlock() {}
     bool authorized(
         ShibTarget* st,
-        const char* providerId,
-        const saml::SAMLAuthenticationStatement* authn,
-        const saml::SAMLResponse* attrs
+        ISessionCacheEntry* entry
     ) const;
 };
 
@@ -512,9 +510,9 @@ pair<bool,const char*> ApacheRequestMapper::getString(const char* name, const ch
             }
         }
         else if (name && !strcmp(name,"applicationId") && sta->m_dc->szApplicationId)
-            return make_pair(true,sta->m_dc->szApplicationId);
+            return pair<bool,const char*>(true,sta->m_dc->szApplicationId);
         else if (name && !strcmp(name,"requireSessionWith") && sta->m_dc->szRequireWith)
-            return make_pair(true,sta->m_dc->szRequireWith);
+            return pair<bool,const char*>(true,sta->m_dc->szRequireWith);
     }
     return s ? s->getString(name,ns) : pair<bool,const char*>(false,NULL);
 }
@@ -599,9 +597,7 @@ static SH_AP_TABLE* groups_for_user(request_rec* r, const char* user, char* grpf
 
 bool htAccessControl::authorized(
     ShibTarget* st,
-    const char* providerId,
-    const saml::SAMLAuthenticationStatement* authn,
-    const saml::SAMLResponse* attrs
+    ISessionCacheEntry* entry
 ) const
 {
     // Make sure the object is our type.
@@ -643,13 +639,13 @@ bool htAccessControl::authorized(
         t = reqs[x].requirement;
         w = ap_getword_white(sta->m_req->pool, &t);
 
-        if (!strcasecmp(w,"Shibboleth")) {
+        if (!strcasecmp(w,"shibboleth")) {
             // This is a dummy rule needed because Apache conflates authn and authz.
             // Without some require rule, AuthType is ignored and no check_user hooks run.
             SHIB_AP_CHECK_IS_OK;
         }
-        else if (!strcmp(w,"valid-user")) {
-            st->log(ShibTarget::LogLevelDebug,"htAccessControl plugin accepting valid-user");
+        else if (!strcmp(w,"valid-user") && entry) {
+            st->log(ShibTarget::LogLevelDebug,"htAccessControl plugin accepting valid-user based on active session");
             SHIB_AP_CHECK_IS_OK;
         }
         else if (!strcmp(w,"user") && !remote_user.empty()) {