Sync
authorAndrew McNab <andrew.mcnab@manchester.ac.uk>
Fri, 28 Mar 2008 14:58:07 +0000 (14:58 +0000)
committerAndrew McNab <andrew.mcnab@manchester.ac.uk>
Fri, 28 Mar 2008 14:58:07 +0000 (14:58 +0000)
org.gridsite.core/doc/httpd-storage.conf
org.gridsite.core/interface/gridsite.h
org.gridsite.core/src/grst_admin_main.c
org.gridsite.core/src/grst_err.c
org.gridsite.core/src/make-gridsite-spec
org.gridsite.core/src/mod_gridsite.c

index 1e3db9d..636e05a 100644 (file)
@@ -93,6 +93,9 @@ LoadModule alias_module         /usr/lib/httpd/modules/mod_alias.so
 LoadModule cgi_module           /usr/lib/httpd/modules/mod_cgi.so
 LoadModule env_module           /usr/lib/httpd/modules/mod_env.so
 
+LoadModule php4_module         modules/libphp4.so
+AddType application/x-httpd-php .php
+
 TypesConfig /etc/mime.types
 
 # User and group who will own files created by Apache
@@ -100,6 +103,7 @@ User  apache
 Group apache
 
 DocumentRoot "/var/www/html"
+DirectoryIndex index.html
 
 <Directory />
     AllowOverride None
@@ -124,32 +128,6 @@ Listen 80
 Listen 777
 NameVirtualHost 127.0.0.1:80
 
-<VirtualHost login.www.printenv.localdomain:80>
-ServerName login.www.printenv.localdomain
-
-<Directory "/var/www/html">
- GridSiteIndexes       on
- GridSiteAuth          on
- GridSiteDNlists       /etc/grid-security/dn-lists/
-</Directory>
-
-ScriptAliasMatch / /var/www/cgi-bin/login.printenv.sh
-
-</VirtualHost>
-
-<VirtualHost www.printenv.localdomain:80>
-ServerName www.printenv.localdomain
-
-<Directory "/var/www/html">
- GridSiteIndexes       on
- GridSiteAuth          on
- GridSiteDNlists       /etc/grid-security/dn-lists/
-</Directory>
-
-ScriptAliasMatch / /var/www/cgi-bin/printenv.sh
-
-</VirtualHost>
-
 <VirtualHost *:80 *:777>
 
 GridSiteGridHTTP  on
@@ -159,6 +137,7 @@ GridSiteCastAlias http://sitecast.domain:777/ /var/www/html/
  GridSiteIndexes       on
  GridSiteAuth          on
  GridSiteDNlists       /etc/grid-security/dn-lists/
+ GridSiteHtmlFormat     on
 </Directory>
 
 </VirtualHost>
@@ -171,8 +150,10 @@ Listen 488
 SSLSessionCacheTimeout  300
 SSLSessionCache         shm:/var/cache/mod_ssl/shm_cache
 
-<VirtualHost *:443 *:488>
+<VirtualHost 127.0.0.1:443 127.0.0.1:488>
  
+ServerName pc63.hep.man.ac.uk
+
 SSLEngine               on
 SSLCertificateFile      /etc/grid-security/hostcert.pem
 SSLCertificateKeyFile   /etc/grid-security/hostkey.pem
@@ -186,6 +167,7 @@ GridSiteGridHTTP  on
 GridSiteCastAlias https://sitecast.domain:488/ /var/www/html/
 
 <Directory "/var/www/html">
+ SetEnv GRST_FOOTER_BLOB '</div></div></div></div><div id="footer"><div id="footer3"><div class="innertube">Copyright GridPP 2008</div></div><div id="footer2"><div class="innertube">'
  GridSiteIndexes       on
  GridSiteAuth          on
  GridSiteDNlists       /etc/grid-security/dn-lists/
@@ -193,7 +175,9 @@ GridSiteCastAlias https://sitecast.domain:488/ /var/www/html/
  GridSiteGSIProxyLimit 9
  GridSiteMethods       GET PUT DELETE MOVE
  GridSiteHtmlFormat     on
- GridSiteLoginURI       https://login.www.printenv.localdomain
+ GridSiteAutoPasscode  on
+ GridSiteRequirePasscode on
+# GridSiteLoginURI       https://login.pc63.hep.man.ac.uk
 </Directory>
 
 <Location "/dn-lists/">
@@ -202,3 +186,32 @@ GridSiteCastAlias https://sitecast.domain:488/ /var/www/html/
 
  
 </VirtualHost>
+<VirtualHost 127.0.0.2:443 127.0.0.2:488>
+ServerName login.pc63.hep.man.ac.uk
+
+SSLEngine               on
+SSLCertificateFile      /etc/grid-security/hostcert.pem
+SSLCertificateKeyFile   /etc/grid-security/hostkey.pem
+SSLCACertificatePath    /etc/grid-security/certificates
+#SSLCARevocationPath    YOUR CRL DIRECTORY WOULD GO HERE
+SSLVerifyClient         optional
+SSLVerifyDepth          10
+SSLOptions              +ExportCertData +StdEnvVars
+
+#GridSiteAutoPasscode  off
+#GridSiteRequirePasscode off
+
+AliasMatch ^/          /var/www/php-bin/gridsite-login.php
+
+<Directory "/var/www/html">
+ GridSiteIndexes       on
+ GridSiteAuth          on
+ GridSiteDNlists       /etc/grid-security/dn-lists/
+ GridSiteDNlistsURI     /dn-lists/
+ GridSiteGSIProxyLimit 9
+ GridSiteMethods       GET PUT DELETE MOVE
+ GridSiteHtmlFormat     on
+</Directory>
+</VirtualHost>
index 2a26c35..cf5a056 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2002-7, Andrew McNab, University of Manchester
+   Copyright (c) 2002-8, Andrew McNab, University of Manchester
    All rights reserved.
 
    Redistribution and use in source and binary forms, with or
 // No such file or directory
 #define GRST_RET_NO_SUCH_FILE  1003
 
-
 // #define GRSTerrorLog(GRSTerrorLevel, GRSTerrorFmt, ...) if (GRSTerrorLogFunc != NULL) (GRSTerrorLogFunc)(__FILE__, __LINE__, GRSTerrorLevel, GRSTerrorFmt, __VA_ARGS__)
+// void (*GRSTerrorLogFunc)(char *, int, int, char *, ...);
 
 #define GRSTerrorLog(GRSTerrorLevel, ...) if (GRSTerrorLogFunc != NULL) (GRSTerrorLogFunc)(__FILE__, __LINE__, GRSTerrorLevel, __VA_ARGS__)
 
-void (*GRSTerrorLogFunc)(char *, int, int, char *, ...);
+extern void (*GRSTerrorLogFunc)(char *, int, int, char *, ...);
 
 /* these levels are the same as Unix syslog() and Apache ap_log_error() */
 
index eb81fed..759dffa 100644 (file)
@@ -255,7 +255,7 @@ int main()
     }
   else if ((dn = getenv("SSL_CLIENT_S_DN")) != NULL)
     {
-      cred = GRSTgaclCredCreate("dn:", dn);
+      cred = GRSTgaclCredCreate("dn:", GRSThttpUrlMildencode(dn));
       user = GRSTgaclUserNew(cred);
     }
 
index 8d1e2cb..106021f 100644 (file)
@@ -38,4 +38,3 @@
 #include "gridsite.h"
 
 void (*GRSTerrorLogFunc)(char *, int, int, char *, ...) = NULL;
-
index ef1e399..1198a22 100755 (executable)
@@ -40,7 +40,7 @@ Prefix: ${MYPREFIX:-/usr}
 URL: http://www.gridsite.org/
 Vendor: GridPP
 Requires: libxml2
-Buildrequires: libxml2-devel,curl-ssl-devel,httpd-devel,openssl-devel
+Buildrequires: libxml2-devel,curl-devel,httpd-devel,openssl-devel
 Packager: Andrew McNab <Andrew.McNab@manchester.ac.uk>
 
 %description
index 9a6529b..01b16cc 100644 (file)
@@ -1,5 +1,5 @@
 /*
-   Copyright (c) 2003-7, Andrew McNab, Shiv Kaushal, Joseph Dada,
+   Copyright (c) 2003-8, Andrew McNab, Shiv Kaushal, Joseph Dada,
    and Yibiao Li, University of Manchester. All rights reserved.
 
    Redistribution and use in source and binary forms, with or
@@ -312,10 +312,10 @@ char *make_admin_footer(request_rec *r, mod_gridsite_dir_cfg *conf,
 
     out = apr_pstrcat(r->pool, out, "<hr><small>", NULL);
 
-    if (r->connection->notes != NULL)
+    if (r->notes != NULL)
       {
-        grst_cred_auri_0 = (char *) 
-                  apr_table_get(r->connection->notes, "GRST_CRED_AURI_0");
+        grst_cred_auri_0 = (char *)
+                  apr_table_get(r->notes, "GRST_CRED_AURI_0");
       }                       
 
     if ((grst_cred_auri_0 != NULL) && 
@@ -384,7 +384,7 @@ char *make_admin_footer(request_rec *r, mod_gridsite_dir_cfg *conf,
       {
         temp = apr_psprintf(r->pool,
                    ". <a href=\"%s%s\">Login/Logout</a>\n", 
-                   conf->loginuri, r->uri);
+                   conf->loginuri, r->unparsed_uri);
         out = apr_pstrcat(r->pool, out, temp, NULL);
       }
 
@@ -2952,13 +2952,14 @@ static int mod_gridsite_perm_handler(request_rec *r)
                }
           }
 
-         /* if passcode absent but SSL ok and not a GSI Proxy, we must 
-            have  GridSiteAutoPasscode on  so we create passcode and file
+         /* if user from SSL ok and not a GSI Proxy and have 
+            GridSiteAutoPasscode on  we create passcode and file
             automatically, and return cookie to client. 
             (if  GridSiteAutoPasscode off  then the site must use
             a login script to make passcode and file instead.) */
 
-         if ((user != NULL) &&
+         if (((mod_gridsite_dir_cfg *) cfg)->autopasscode &&
+             (user != NULL) &&
              (GRSTgaclCredGetDelegation(cred_0) == 0))
            {
              n = 0; /* number of slashes seen */
@@ -2987,7 +2988,7 @@ static int mod_gridsite_perm_handler(request_rec *r)
                         "GRIDHTTP_PASSCODE=%s; "
                         "domain=%s; "
                         "path=%s; "
-                        "secure; httponly", gridauthpasscode, r->hostname, p));
+                        "secure", gridauthpasscode, r->hostname, p));
                    }
                }
            }
@@ -3206,10 +3207,18 @@ static int mod_gridsite_perm_handler(request_rec *r)
     ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, r->server,
                  "After GACL/Onetime evaluation, GRST_PERM=%d", perm);
 
-    /* set permission and GACL environment variables */
+    /* add permission and first AURI to request notes */
     
     apr_table_setn(r->notes, "GRST_PERM", apr_psprintf(r->pool, "%d", perm));
 
+    cred = user->firstcred;
+    if ((cred != NULL) && (strncmp(cred->auri, "dn:", 3) == 0))
+      {
+        apr_table_setn(r->notes, "GRST_CRED_AURI_0", 
+                       apr_psprintf(r->pool, "%s", cred->auri));
+      }
+        
+
     if (((mod_gridsite_dir_cfg *) cfg)->envs)
       {
         /* copy any credentials from (SSL) connection to environment */
@@ -4101,7 +4110,7 @@ static void register_hooks(apr_pool_t *p)
 
     ap_hook_fixups(mod_gridsite_first_fixups,NULL,NULL,APR_HOOK_FIRST);
     
-    ap_hook_fixups(mod_gridsite_perm_handler,NULL,NULL,APR_HOOK_LAST);
+    ap_hook_fixups(mod_gridsite_perm_handler,NULL,NULL,APR_HOOK_REALLY_LAST);
     
     ap_hook_handler(mod_gridsite_handler, NULL, NULL, APR_HOOK_FIRST);