[pubcookie-dev] WEBISO CVS update: fox; webiso/pubcookie/src index.cgi.c,1.108.2.2,1.108.2.3

Jim Fox fox at cac.washington.edu
Thu Oct 23 08:51:25 PDT 2003


Update of /usr/local/cvsroot/webiso/pubcookie/src
 In directory webiso-cvs.cac.washington.edu:/var/tmp/cvs-serv1390/webiso/pubcookie/src
 
 Modified Files:
       Tag: UWash3
 	index.cgi.c 
 Log Message:
 
 Check for authorized granting source.
 
 Fix %user% field in some templates
 
 
 



Index: webiso/pubcookie/src/index.cgi.c
diff -c webiso/pubcookie/src/index.cgi.c:1.108.2.2 webiso/pubcookie/src/index.cgi.c:1.108.2.3
*** webiso/pubcookie/src/index.cgi.c:1.108.2.2	Wed Oct  1 12:37:39 2003
--- webiso/pubcookie/src/index.cgi.c	Thu Oct 23 08:51:23 2003
***************
*** 6,12 ****
  /** @file index.cgi.c
   * Login server CGI
   *
!  * $Id: index.cgi.c,v 1.108.2.2 2003/10/01 19:37:39 fox Exp $
   */
  
  #ifdef HAVE_CONFIG_H
--- 6,12 ----
  /** @file index.cgi.c
   * Login server CGI
   *
!  * $Id: index.cgi.c,v 1.108.2.3 2003/10/23 15:51:23 fox Exp $
   */
  
  #ifdef HAVE_CONFIG_H
***************
*** 1893,1898 ****
--- 1893,1915 ----
      pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE, 
  		     "cookie_test: cookies: %s", cookies);
  
+     /* Make sure the granting source is authorized */
+     if (l->host) {
+         char *th = strdup(l->host);
+         char *thc;
+         if (thc=strchr(th,':')) *thc = '\0';
+         if (!libpbc_test_crypt_key(p, th)) {
+             ntmpl_print_html(p, TMPL_FNAME,
+                  libpbc_config_getstring(p, "tmpl_login_unauth_grant",
+                                             "login_unauth_grant"),
+                  NULL);
+             clear_greq_cookie(p);
+             free(th);
+             return (PBC_FAIL);
+         }
+         free(th);
+     }
+        
      /* we don't currently handle form-multipart */
      /* the formmultipart cookie is set by the module */
      if ( strstr(cookies, PBC_FORM_MP_COOKIENAME) ) {
***************
*** 2507,2512 ****
--- 2524,2530 ----
      char		*cookie_local = NULL;
      char *peer = NULL;
      char *ptr = NULL;
+     int ret = PBC_FAIL;
  
      pbc_log_activity(p, PBC_LOG_DEBUG_LOW, "create_cookie: hello\n"); 
  
***************
*** 2555,2564 ****
          strncpy (cookie, cookie_local, max);
          /* dynamically allocated by libpbc_get_cookie_with_expire(p) */
          free(cookie_local);
      }
  
      pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE, "create_cookie: goodbye\n" ); 
  
!     return (PBC_OK);
  }
  
--- 2573,2583 ----
          strncpy (cookie, cookie_local, max);
          /* dynamically allocated by libpbc_get_cookie_with_expire(p) */
          free(cookie_local);
+         ret = PBC_OK;
      }
  
      pbc_log_activity(p, PBC_LOG_DEBUG_VERBOSE, "create_cookie: goodbye\n" ); 
  
!     return (ret);
  }
  



end of message


More information about the pubcookie-dev mailing list