[pubcookie-dev] WEBISO CVS update: jjminer; libpubcookie.c,2.49,2.50 mod_pubcookie.c,1.110,1.111 pbc_version.h,1.49,1.50 verify.c,1.13,1.14 verify.h,1.6,1.7 verify_alwaystrue.c,1.6,1.7 verify_kerberos4.c,1.6,1.7 verify_ldap.c,1.16,1.17 verify_shadow.c,1.8,1.9

miner at doit.wisc.edu miner at doit.wisc.edu
Wed Mar 5 22:12:52 PST 2003


Update of /usr/local/cvsroot/webiso/pubcookie/src
 In directory webiso-cvs.cac.washington.edu:/var/tmp/cvs-serv8476
 
 Modified Files:
 	flavor_basic.c index.cgi.c libpubcookie.c mod_pubcookie.c 
 	pbc_version.h verify.c verify.h verify_alwaystrue.c 
 	verify_kerberos4.c verify_ldap.c verify_shadow.c 
 Log Message:
     Overall: cleaning up after the p_everywhere merge, so that things will
     compile at least.
     Changed the call to the verifier to pass the pool that they need.
     Added "typedef void pool" to all the .c files that needed it.
     Cleaned up the #includes on libpubcookie.c (Apache includes were done twice,
     and broke the Solaris strings.h)
     Fixed the // comment in mod_pubcookie.c.
     Set the version back to 3.0.0 pre-beta4.
     Changed ALL of the verifiers to take pool argument, fixed the signature for
     "plaintext_verifier" in verify.h
     Fixed the LDAP verifier so that it works again.
 



Index: webiso/pubcookie/src/flavor_basic.c
diff -c webiso/pubcookie/src/flavor_basic.c:1.30 webiso/pubcookie/src/flavor_basic.c:1.31
*** webiso/pubcookie/src/flavor_basic.c:1.30	Wed Mar  5 14:38:47 2003
--- webiso/pubcookie/src/flavor_basic.c	Wed Mar  5 22:12:50 2003
***************
*** 23,29 ****
   */
  
  /*
!     $Id: flavor_basic.c,v 1.30 2003/03/05 22:38:47 willey Exp $
   */
  
  #ifdef HAVE_CONFIG_H
--- 23,29 ----
   */
  
  /*
!     $Id: flavor_basic.c,v 1.31 2003/03/06 06:12:50 jjminer Exp $
   */
  
  #ifdef HAVE_CONFIG_H
***************
*** 432,438 ****
              credsp = &creds;
          }
  
!         if (v->v(l->user, l->pass, NULL, l->realm, credsp, errstr) == 0) {
              if (debug) {
                  /* xxx log realm */
                  pbc_log_activity(p,  PBC_LOG_AUDIT,
--- 432,438 ----
              credsp = &creds;
          }
  
!         if (v->v(p, l->user, l->pass, NULL, l->realm, credsp, errstr) == 0) {
              if (debug) {
                  /* xxx log realm */
                  pbc_log_activity(p,  PBC_LOG_AUDIT,


Index: webiso/pubcookie/src/index.cgi.c
diff -c webiso/pubcookie/src/index.cgi.c:1.97 webiso/pubcookie/src/index.cgi.c:1.98
*** webiso/pubcookie/src/index.cgi.c:1.97	Wed Mar  5 14:38:47 2003
--- webiso/pubcookie/src/index.cgi.c	Wed Mar  5 22:12:50 2003
***************
*** 20,26 ****
   */
  
  /*
!  * $Revision: 1.97 $
   */
  
  #ifdef HAVE_CONFIG_H
--- 20,26 ----
   */
  
  /*
!  * $Revision: 1.98 $
   */
  
  #ifdef HAVE_CONFIG_H
***************
*** 28,36 ****
  # include "pbc_path.h"
  #endif
  
- /* a pointer for an Apache memory pool is passed everywhwere */
- typedef void pool;
- 
  /* LibC */
  #ifdef HAVE_ARPA_INET_H
  # include <arpa/inet.h>
--- 28,33 ----
***************
*** 110,115 ****
--- 107,114 ----
  # error "cgic is required for building the login server"
  #endif /* HAVE_CGIC_H */
  
+ /* An apache "pool" */
+ typedef void pool;
  
  /* pubcookie things */
  #include "pubcookie.h"


Index: webiso/pubcookie/src/libpubcookie.c
diff -c webiso/pubcookie/src/libpubcookie.c:2.49 webiso/pubcookie/src/libpubcookie.c:2.50
*** webiso/pubcookie/src/libpubcookie.c:2.49	Wed Mar  5 14:38:47 2003
--- webiso/pubcookie/src/libpubcookie.c	Wed Mar  5 22:12:50 2003
***************
*** 18,24 ****
   */
  
  /* 
!     $Id: libpubcookie.c,v 2.49 2003/03/05 22:38:47 willey Exp $
   */
  
  #ifdef HAVE_CONFIG_H
--- 18,24 ----
   */
  
  /* 
!     $Id: libpubcookie.c,v 2.50 2003/03/06 06:12:50 jjminer Exp $
   */
  
  #ifdef HAVE_CONFIG_H
***************
*** 26,43 ****
  # include "pbc_path.h"
  #endif
  
- #if defined (APACHE1_3)
- # include "httpd.h"
- # include "http_config.h"
- # include "http_core.h"
- # include "http_log.h"
- # include "http_main.h"
- # include "http_protocol.h"
- # include "util_script.h"
- #else
- typedef void pool;
- #endif
- 
  #if defined (WIN32)
  
  # include <windows.h>
--- 26,31 ----
***************
*** 102,107 ****
--- 90,97 ----
  # include "http_main.h"
  # include "http_protocol.h"
  # include "util_script.h"
+ #else
+ typedef void pool;
  #endif
  
  #ifdef OPENSSL_IN_DIR


Index: webiso/pubcookie/src/mod_pubcookie.c
diff -c webiso/pubcookie/src/mod_pubcookie.c:1.110 webiso/pubcookie/src/mod_pubcookie.c:1.111
*** webiso/pubcookie/src/mod_pubcookie.c:1.110	Wed Mar  5 14:38:47 2003
--- webiso/pubcookie/src/mod_pubcookie.c	Wed Mar  5 22:12:50 2003
***************
*** 18,24 ****
   */
  
  /*
!     $Id: mod_pubcookie.c,v 1.110 2003/03/05 22:38:47 willey Exp $
   */
  
  #ifdef HAVE_CONFIG_H
--- 18,24 ----
   */
  
  /*
!     $Id: mod_pubcookie.c,v 1.111 2003/03/06 06:12:50 jjminer Exp $
   */
  
  #ifdef HAVE_CONFIG_H
***************
*** 1035,1041 ****
          apri = APLOG_ERR;
  
      ap_log_error(APLOG_MARK, apri, NULL, "%s", msg);
! //    fprintf(stderr, msg);
  
  }
  
--- 1035,1041 ----
          apri = APLOG_ERR;
  
      ap_log_error(APLOG_MARK, apri, NULL, "%s", msg);
! /*    fprintf(stderr, msg); */
  
  }
  


Index: webiso/pubcookie/src/pbc_version.h
diff -c webiso/pubcookie/src/pbc_version.h:1.49 webiso/pubcookie/src/pbc_version.h:1.50
*** webiso/pubcookie/src/pbc_version.h:1.49	Wed Mar  5 14:38:47 2003
--- webiso/pubcookie/src/pbc_version.h	Wed Mar  5 22:12:50 2003
***************
*** 19,25 ****
   */
  
  /*
!     $Id: pbc_version.h,v 1.49 2003/03/05 22:38:47 willey Exp $
   */
  
  #ifndef PUBCOOKIE_VERSION
--- 19,25 ----
   */
  
  /*
!     $Id: pbc_version.h,v 1.50 2003/03/06 06:12:50 jjminer Exp $
   */
  
  #ifndef PUBCOOKIE_VERSION
***************
*** 44,49 ****
   * in configure.ac and re-run autoconf and autoheader.
   */
  
! #define PBC_VERSION_STRING "3.0.0 pre-beta5"
  
  #endif /* !PUBCOOKIE_VERSION */
--- 44,49 ----
   * in configure.ac and re-run autoconf and autoheader.
   */
  
! #define PBC_VERSION_STRING "3.0.0 pre-beta4"
  
  #endif /* !PUBCOOKIE_VERSION */


Index: webiso/pubcookie/src/verify.c
diff -c webiso/pubcookie/src/verify.c:1.13 webiso/pubcookie/src/verify.c:1.14
*** webiso/pubcookie/src/verify.c:1.13	Thu Nov 14 13:12:12 2002
--- webiso/pubcookie/src/verify.c	Wed Mar  5 22:12:50 2003
***************
*** 18,24 ****
   */
  
  /*
!     $Id: verify.c,v 1.13 2002/11/14 21:12:12 jjminer Exp $
   */
  
  #ifdef HAVE_CONFIG_H
--- 18,24 ----
   */
  
  /*
!     $Id: verify.c,v 1.14 2003/03/06 06:12:50 jjminer Exp $
   */
  
  #ifdef HAVE_CONFIG_H
***************
*** 37,42 ****
--- 37,45 ----
  #ifdef HAVE_STRING_H
  # include <string.h>
  #endif /* HAVE_STRING_H */
+ 
+ /* Pretending we're Apache */
+ typedef void pool;
  
  #include "verify.h"
  


Index: webiso/pubcookie/src/verify.h
diff -c webiso/pubcookie/src/verify.h:1.6 webiso/pubcookie/src/verify.h:1.7
*** webiso/pubcookie/src/verify.h:1.6	Tue Aug 20 13:31:18 2002
--- webiso/pubcookie/src/verify.h	Wed Mar  5 22:12:50 2003
***************
*** 18,24 ****
   */
  
  /*
!     $Id: verify.h,v 1.6 2002/08/20 20:31:18 greenfld Exp $
   */
  #ifndef INCLUDED_VERIFY_H
  #define INCLUDED_VERIFY_H
--- 18,24 ----
   */
  
  /*
!     $Id: verify.h,v 1.7 2003/03/06 06:12:50 jjminer Exp $
   */
  #ifndef INCLUDED_VERIFY_H
  #define INCLUDED_VERIFY_H
***************
*** 67,73 ****
   *         -2 indicates a system error
  */
  /* returns 0 on success; non-zero on failure */
! typedef int plaintext_verifier(const char *userid,
  			       const char *passwd,
  			       const char *service,
  			       const char *user_realm,
--- 67,73 ----
   *         -2 indicates a system error
  */
  /* returns 0 on success; non-zero on failure */
! typedef int plaintext_verifier(pool * p, const char *userid,
  			       const char *passwd,
  			       const char *service,
  			       const char *user_realm,


Index: webiso/pubcookie/src/verify_alwaystrue.c
diff -c webiso/pubcookie/src/verify_alwaystrue.c:1.6 webiso/pubcookie/src/verify_alwaystrue.c:1.7
*** webiso/pubcookie/src/verify_alwaystrue.c:1.6	Thu Nov 14 13:12:12 2002
--- webiso/pubcookie/src/verify_alwaystrue.c	Wed Mar  5 22:12:50 2003
***************
*** 12,17 ****
--- 12,20 ----
  # include <stdio.h>
  #endif /* HAVE_STDIO_H */
  
+ /* Pretending we're Apache */
+ typedef void pool;
+ 
  #include "verify.h"
  
  #ifdef HAVE_DMALLOC_H
***************
*** 22,28 ****
  
  extern int debug;
  
! int alwaystrue_v(const char *userid,
  		 const char *passwd,
  		 const char *service,
  		 const char *user_realm,
--- 25,31 ----
  
  extern int debug;
  
! int alwaystrue_v(pool * p, const char *userid,
  		 const char *passwd,
  		 const char *service,
  		 const char *user_realm,


Index: webiso/pubcookie/src/verify_kerberos4.c
diff -c webiso/pubcookie/src/verify_kerberos4.c:1.6 webiso/pubcookie/src/verify_kerberos4.c:1.7
*** webiso/pubcookie/src/verify_kerberos4.c:1.6	Thu Nov 14 13:12:12 2002
--- webiso/pubcookie/src/verify_kerberos4.c	Wed Mar  5 22:12:50 2003
***************
*** 8,13 ****
--- 8,16 ----
  # include <stdlib.h>
  #endif /* HAVE_STDLIB_H */
  
+ /* Pretending we're Apache */
+ typedef void pool;
+ 
  #include "verify.h"
  
  #ifdef HAVE_DMALLOC_H
***************
*** 16,22 ****
  # endif /* ! APACHE */
  #endif /* HAVE_DMALLOC_H */
  
! static int kerberos4_v(const char *userid,
  		       const char *passwd,
  		       const char *service,
  		       const char *user_realm,
--- 19,25 ----
  # endif /* ! APACHE */
  #endif /* HAVE_DMALLOC_H */
  
! static int kerberos4_v(pool * p, const char *userid,
  		       const char *passwd,
  		       const char *service,
  		       const char *user_realm,


Index: webiso/pubcookie/src/verify_ldap.c
diff -c webiso/pubcookie/src/verify_ldap.c:1.16 webiso/pubcookie/src/verify_ldap.c:1.17
*** webiso/pubcookie/src/verify_ldap.c:1.16	Fri Dec  6 08:47:21 2002
--- webiso/pubcookie/src/verify_ldap.c	Wed Mar  5 22:12:50 2003
***************
*** 3,9 ****
   *
   * Verifies users against an LDAP server (or servers.)
   * 
!  * $Id: verify_ldap.c,v 1.16 2002/12/06 16:47:21 jjminer Exp $
   */
  
  #ifdef HAVE_CONFIG_H
--- 3,9 ----
   *
   * Verifies users against an LDAP server (or servers.)
   * 
!  * $Id: verify_ldap.c,v 1.17 2003/03/06 06:12:50 jjminer Exp $
   */
  
  #ifdef HAVE_CONFIG_H
***************
*** 16,21 ****
--- 16,24 ----
  #endif /* HAVE_STDLIB_H */
  
  
+ /* a pointer for an Apache memory pool is passed everywhwere */
+ typedef void pool;
+ 
  #include "verify.h"
  
  #ifdef ENABLE_LDAP
***************
*** 88,117 ****
  
  /**
   * Actually does an LDAP Bind
   * @param ld LDAP *
   * @param user char *
   * @param password char *
   * @param errstr const char **
   * @retval 0 for sucess, nonzero on failure.
   */
! static int do_bind( LDAP *ld, char * user, const char * password, const char ** errstr )
  {
      int rc;
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "do_bind: hello\n" );
      
      rc = ldap_simple_bind_s (ld, user, password );
  
      if ( rc != LDAP_SUCCESS) {
!         pbc_log_activity(PBC_LOG_DEBUG_LOW, "do_bind: failed - %s\n", 
                           ldap_err2string(rc) );
          *errstr  = "Bind failed -- auth failed";
          return -1;
      } else {
!         pbc_log_activity(PBC_LOG_DEBUG_LOW, "do_bind: bind successful\n" );
      }
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "do_bind: bye!\n" );
  
      return 0;
  }
--- 91,122 ----
  
  /**
   * Actually does an LDAP Bind
+  * @param p pool *
   * @param ld LDAP *
   * @param user char *
   * @param password char *
   * @param errstr const char **
   * @retval 0 for sucess, nonzero on failure.
   */
! static int do_bind( pool * p, LDAP *ld, char * user,
!                     const char * password, const char ** errstr )
  {
      int rc;
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "do_bind: hello\n" );
      
      rc = ldap_simple_bind_s (ld, user, password );
  
      if ( rc != LDAP_SUCCESS) {
!         pbc_log_activity( p, PBC_LOG_DEBUG_LOW, "do_bind: failed - %s\n", 
                           ldap_err2string(rc) );
          *errstr  = "Bind failed -- auth failed";
          return -1;
      } else {
!         pbc_log_activity( p, PBC_LOG_DEBUG_LOW, "do_bind: bind successful\n" );
      }
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "do_bind: bye!\n" );
  
      return 0;
  }
***************
*** 171,183 ****
      /* p should point to the '?' beginning the extended data */
  
      if (*p == '?' && *(p-1) != '?' ) {
!         pbc_log_activity( PBC_LOG_ERROR, "Error parsing \"%s\": p=\"%s\"",
                            ldap_url, p );
          return NULL;
      }
  
      if (*p == '\0') {
!         pbc_log_activity( PBC_LOG_ERROR, "No Extended data on \"%s\"",
                            ldap_url );
          return NULL;
      }
--- 176,188 ----
      /* p should point to the '?' beginning the extended data */
  
      if (*p == '?' && *(p-1) != '?' ) {
!         pbc_log_activity( p,  PBC_LOG_ERROR, "Error parsing \"%s\": p=\"%s\"",
                            ldap_url, p );
          return NULL;
      }
  
      if (*p == '\0') {
!         pbc_log_activity( p,  PBC_LOG_ERROR, "No Extended data on \"%s\"",
                            ldap_url );
          return NULL;
      }
***************
*** 224,240 ****
  
  /**
   * Connects to an LDAP Server
   * @param ld LDAP **
   * @param ldap_port int
   * @param errstr const char **
   * @retval 0 for sucess, nonzero on failure.
   */
! static int ldap_connect( LDAP ** ld, 
  			 char * ldap_uri, 
  			 const char ** errstr ) 
  {
      int rc = 0;
!     char *tmp_uri, *p;
      int tmplen = 0;
  
      char *dn = NULL;
--- 229,246 ----
  
  /**
   * Connects to an LDAP Server
+  * @param p poll *
   * @param ld LDAP **
   * @param ldap_port int
   * @param errstr const char **
   * @retval 0 for sucess, nonzero on failure.
   */
! static int ldap_connect( pool * p, LDAP ** ld, 
  			 char * ldap_uri, 
  			 const char ** errstr ) 
  {
      int rc = 0;
!     char *tmp_uri;
      int tmplen = 0;
  
      char *dn = NULL;
***************
*** 243,252 ****
      LDAPURLDesc *ludp;
      char **exts = NULL;
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "ldap_connect: hello\n" );
  
      if ( ldap_url_parse( ldap_uri, &ludp ) ) {
!         pbc_log_activity(PBC_LOG_ERROR, "Cannot parse \"%s\"\n", ldap_uri  );
          *errstr = "System Error.  Contact your system administrator.";
          return -1;
      }
--- 249,258 ----
      LDAPURLDesc *ludp;
      char **exts = NULL;
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "ldap_connect: hello\n" );
  
      if ( ldap_url_parse( ldap_uri, &ludp ) ) {
!         pbc_log_activity( p, PBC_LOG_ERROR, "Cannot parse \"%s\"\n", ldap_uri  );
          *errstr = "System Error.  Contact your system administrator.";
          return -1;
      }
***************
*** 276,287 ****
                  } else if ( strcasecmp( *exts, "x-Password" ) == 0 ) {
                      pwd = strdup( val );
                  } else {
!                     pbc_log_activity( PBC_LOG_ERROR, 
                                        "ldap_connect: unknown extension %s=%s\n",
                                        *exts, val );
                  }
              } else {
!                 pbc_log_activity( PBC_LOG_ERROR,
                                    "ldap_connect: extension error parsing \"%s\"\n",
                                    *exts );
              }
--- 282,293 ----
                  } else if ( strcasecmp( *exts, "x-Password" ) == 0 ) {
                      pwd = strdup( val );
                  } else {
!                     pbc_log_activity( p,  PBC_LOG_ERROR, 
                                        "ldap_connect: unknown extension %s=%s\n",
                                        *exts, val );
                  }
              } else {
!                 pbc_log_activity( p,  PBC_LOG_ERROR,
                                    "ldap_connect: extension error parsing \"%s\"\n",
                                    *exts );
              }
***************
*** 317,330 ****
      if (exts != NULL)
          free(exts);
  
!     pbc_log_activity( PBC_LOG_DEBUG_VERBOSE, "Server: %s Port: %d SSL: %d",
                        ludp->lud_host, ludp->lud_port,
                        ludp->lud_options & LDAP_URL_OPT_SECURE);
  
      if (ludp->lud_options & LDAP_URL_OPT_SECURE) {
  
          if ( ldapssl_client_init( CERT_DB_PATH, NULL ) != 0 ) {
!             pbc_log_activity( PBC_LOG_ERROR, "Error loading cert db \"%s\"!",
                                CERT_DB_PATH );
              return -2;
          }
--- 323,336 ----
      if (exts != NULL)
          free(exts);
  
!     pbc_log_activity( p,  PBC_LOG_DEBUG_VERBOSE, "Server: %s Port: %d SSL: %d",
                        ludp->lud_host, ludp->lud_port,
                        ludp->lud_options & LDAP_URL_OPT_SECURE);
  
      if (ludp->lud_options & LDAP_URL_OPT_SECURE) {
  
          if ( ldapssl_client_init( CERT_DB_PATH, NULL ) != 0 ) {
!             pbc_log_activity( p,  PBC_LOG_ERROR, "Error loading cert db \"%s\"!",
                                CERT_DB_PATH );
              return -2;
          }
***************
*** 347,359 ****
  #endif /* LDAP_OPENLDAP */
  
      if (rc != LDAP_SUCCESS || *ld == NULL) {
!         pbc_log_activity( PBC_LOG_DEBUG_VERBOSE,
                            "ldap_connect: LDAP Initialization error %d.\n", rc  );
          *errstr = "connection to ldap server failed -- auth failed";
          return -2;
      }
  
!     rc = do_bind( *ld, dn, pwd, errstr );
  
      /* OK, We're bound, so we don't need the dn/pwd strings anymore.. */
  
--- 353,365 ----
  #endif /* LDAP_OPENLDAP */
  
      if (rc != LDAP_SUCCESS || *ld == NULL) {
!         pbc_log_activity( p,  PBC_LOG_DEBUG_VERBOSE,
                            "ldap_connect: LDAP Initialization error %d.\n", rc  );
          *errstr = "connection to ldap server failed -- auth failed";
          return -2;
      }
  
!     rc = do_bind( p, *ld, dn, pwd, errstr );
  
      /* OK, We're bound, so we don't need the dn/pwd strings anymore.. */
  
***************
*** 365,376 ****
  
      if( rc == -1 ) {
          /* Here a bind failing isn't catastrophic..  */
!         pbc_log_activity(PBC_LOG_DEBUG_LOW, "ldap_connect: Bind Failed.\n"  );
          /* ldap_unbind(*ld); */
          return -2;
      }
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "ldap_connect: bye!\n" );
  
      return 0;
  }
--- 371,382 ----
  
      if( rc == -1 ) {
          /* Here a bind failing isn't catastrophic..  */
!         pbc_log_activity( p, PBC_LOG_DEBUG_LOW, "ldap_connect: Bind Failed.\n"  );
          /* ldap_unbind(*ld); */
          return -2;
      }
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "ldap_connect: bye!\n" );
  
      return 0;
  }
***************
*** 388,394 ****
   * @param errstr const char **
   * @retval 0 for sucess, nonzero on failure.
   */
! static int get_dn( LDAP * ld, 
                     char * ldapuri,
                     char ** dn,
                     const char ** errstr )
--- 394,400 ----
   * @param errstr const char **
   * @retval 0 for sucess, nonzero on failure.
   */
! static int get_dn( pool * p, LDAP * ld, 
                     char * ldapuri,
                     char ** dn,
                     const char ** errstr )
***************
*** 401,424 ****
      LDAPMessage * entry = NULL;
      LDAPURLDesc *ludp = NULL;
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "get_dn: hello\n" );
  
      *dn = NULL;
  
      if ( ldap_url_parse( ldapuri, &ludp ) ) {
!         pbc_log_activity(PBC_LOG_ERROR, "Cannot parse \"%s\"\n", ldapuri  );
          *errstr = "System Error.  Contact your system administrator.";
          return -1;
      }
  
!     pbc_log_activity( PBC_LOG_DEBUG_VERBOSE, "searching: %s for %s",
                        ludp->lud_dn, ludp->lud_filter );
  
      err = ldap_search_s( ld, ludp->lud_dn, LDAP_SCOPE_SUBTREE,
                           ludp->lud_filter, NULL, 0, &results );
  
      if (err != LDAP_SUCCESS) {
!         pbc_log_activity( PBC_LOG_DEBUG_VERBOSE,
                            "User not found - error %d (%s)!",
                            err, ldap_err2string(err) );
          *errstr = "user not found -- auth failed";
--- 407,430 ----
      LDAPMessage * entry = NULL;
      LDAPURLDesc *ludp = NULL;
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "get_dn: hello\n" );
  
      *dn = NULL;
  
      if ( ldap_url_parse( ldapuri, &ludp ) ) {
!         pbc_log_activity( p, PBC_LOG_ERROR, "Cannot parse \"%s\"\n", ldapuri  );
          *errstr = "System Error.  Contact your system administrator.";
          return -1;
      }
  
!     pbc_log_activity( p,  PBC_LOG_DEBUG_VERBOSE, "searching: %s for %s",
                        ludp->lud_dn, ludp->lud_filter );
  
      err = ldap_search_s( ld, ludp->lud_dn, LDAP_SCOPE_SUBTREE,
                           ludp->lud_filter, NULL, 0, &results );
  
      if (err != LDAP_SUCCESS) {
!         pbc_log_activity( p,  PBC_LOG_DEBUG_VERBOSE,
                            "User not found - error %d (%s)!",
                            err, ldap_err2string(err) );
          *errstr = "user not found -- auth failed";
***************
*** 427,433 ****
  
      num_entries = ldap_count_entries(ld, results);
  
!     pbc_log_activity( PBC_LOG_DEBUG_VERBOSE, "get_dn: Found %d Entries\n",
                        num_entries );
  
      if (num_entries != 1) {
--- 433,439 ----
  
      num_entries = ldap_count_entries(ld, results);
  
!     pbc_log_activity( p,  PBC_LOG_DEBUG_VERBOSE, "get_dn: Found %d Entries\n",
                        num_entries );
  
      if (num_entries != 1) {
***************
*** 447,453 ****
  
      *dn = ldap_get_dn(ld, entry);
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "get_dn: Got DN: \"%s\"\n", *dn  );
      
      if (*dn == NULL) {
          ldap_msgfree(results);
--- 453,459 ----
  
      *dn = ldap_get_dn(ld, entry);
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "get_dn: Got DN: \"%s\"\n", *dn  );
      
      if (*dn == NULL) {
          ldap_msgfree(results);
***************
*** 464,470 ****
      ldap_msgfree( entry );
  #endif
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "get_dn: bye!\n" );
  
      return 0;
  }
--- 470,476 ----
      ldap_msgfree( entry );
  #endif
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "get_dn: bye!\n" );
  
      return 0;
  }
***************
*** 479,485 ****
   * @retval 0 on success, nonzero on failure
   */
  
! static int ldap_v( const char *userid,
  			  const char *passwd,
  			  const char *service,
  			  const char *user_realm,
--- 485,491 ----
   * @retval 0 on success, nonzero on failure
   */
  
! static int ldap_v( pool * p, const char *userid,
  			  const char *passwd,
  			  const char *service,
  			  const char *user_realm,
***************
*** 492,503 ****
      char  **ldap_uri_list;
      char *key = NULL;
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "ldap_verifier: hello\n" );
  
      if (creds) *creds = NULL;
  
      key = gen_key(user_realm, "uri");
!     ldap_uri_list = libpbc_config_getlist(key);
      free(key);
  
      if (service != NULL) {
--- 498,509 ----
      char  **ldap_uri_list;
      char *key = NULL;
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "ldap_verifier: hello\n" );
  
      if (creds) *creds = NULL;
  
      key = gen_key(user_realm, "uri");
!     ldap_uri_list = libpbc_config_getlist(p, key);
      free(key);
  
      if (service != NULL) {
***************
*** 524,530 ****
  
          LDAP *ld = NULL;
          char  *user_dn = NULL;
!         char *p;
  
          if ( strstr( ldap_uri_in, "%s" ) == NULL ) {
              /* The LDAP URI must contain a %s to hold the user name! */
--- 530,536 ----
  
          LDAP *ld = NULL;
          char  *user_dn = NULL;
!         char *ptr;
  
          if ( strstr( ldap_uri_in, "%s" ) == NULL ) {
              /* The LDAP URI must contain a %s to hold the user name! */
***************
*** 547,556 ****
           * char(013), a vertical tab should do it.
           */
  
!         p = strstr( ldap_uri_in, "%s" ) + 2;
  
!         while( ( p = strchr(p, '%') ) != NULL ) {
!             *p = '\013';
          }
  
          num = snprintf( ldap_uri, len, ldap_uri_in, userid );
--- 553,562 ----
           * char(013), a vertical tab should do it.
           */
  
!         ptr = strstr( ldap_uri_in, "%s" ) + 2;
  
!         while( ( ptr = strchr(ptr, '%') ) != NULL ) {
!             *ptr = '\013';
          }
  
          num = snprintf( ldap_uri, len, ldap_uri_in, userid );
***************
*** 563,575 ****
  
          /* Make all the VT's back in to %'s. */
  
!         p = ldap_uri;
  
!         while( ( p = strchr(p, '\013') ) != NULL ) {
!             *p = '%';
          }
  
!         pbc_log_activity( PBC_LOG_DEBUG_VERBOSE,
                            "ldap_verifier: uri: \"%s\"\n", ldap_uri );
  
          if (userid == NULL || passwd == NULL) {
--- 569,581 ----
  
          /* Make all the VT's back in to %'s. */
  
!         ptr = ldap_uri;
  
!         while( ( ptr = strchr(ptr, '\013') ) != NULL ) {
!             *ptr = '%';
          }
  
!         pbc_log_activity( p,  PBC_LOG_DEBUG_VERBOSE,
                            "ldap_verifier: uri: \"%s\"\n", ldap_uri );
  
          if (userid == NULL || passwd == NULL) {
***************
*** 581,590 ****
           * The definately needs to be changed.  There will need to be a
           * "searching" login that we use to find the Dn.
           */
!         got_error = ldap_connect( &ld, ldap_uri, errstr );
          if( got_error == 0 ) {
  
!             got_error = get_dn( ld, ldap_uri, &user_dn, errstr );
  
              if( got_error == 0 && strlen(user_dn) ) {
                  LDAPURLDesc *ludp;
--- 587,596 ----
           * The definately needs to be changed.  There will need to be a
           * "searching" login that we use to find the Dn.
           */
!         got_error = ldap_connect( p, &ld, ldap_uri, errstr );
          if( got_error == 0 ) {
  
!             got_error = get_dn( p, ld, ldap_uri, &user_dn, errstr );
  
              if( got_error == 0 && strlen(user_dn) ) {
                  LDAPURLDesc *ludp;
***************
*** 595,615 ****
                      got_error = -2;
                  } else {
  
!                     got_error = do_bind( ld, user_dn, passwd, errstr );
  
                      if (got_error != 0)
                          *errstr = "couldn't bind as user -- auth failed";
  
                      if ( got_error == 0 ) {
!                         pbc_log_activity( PBC_LOG_AUDIT,
                                            "%s succesfully bound to %s:%d\n",
                                            userid, ludp->lud_host, ludp->lud_port );
                      } else if ( got_error == -1 ) {
!                         pbc_log_activity( PBC_LOG_AUDIT,
                                            "%s fatal error binding to %s:%d\n",
                                            userid, ludp->lud_host, ludp->lud_port );
                      } else if ( got_error == -2 ) {
!                         pbc_log_activity( PBC_LOG_AUDIT,
                                            "%s error binding to %s:%d.  Continuing\n",
                                            userid, ludp->lud_host, ludp->lud_port );
                      }
--- 601,621 ----
                      got_error = -2;
                  } else {
  
!                     got_error = do_bind( p, ld, user_dn, passwd, errstr );
  
                      if (got_error != 0)
                          *errstr = "couldn't bind as user -- auth failed";
  
                      if ( got_error == 0 ) {
!                         pbc_log_activity( p,  PBC_LOG_AUDIT,
                                            "%s succesfully bound to %s:%d\n",
                                            userid, ludp->lud_host, ludp->lud_port );
                      } else if ( got_error == -1 ) {
!                         pbc_log_activity( p,  PBC_LOG_AUDIT,
                                            "%s fatal error binding to %s:%d\n",
                                            userid, ludp->lud_host, ludp->lud_port );
                      } else if ( got_error == -2 ) {
!                         pbc_log_activity( p,  PBC_LOG_AUDIT,
                                            "%s error binding to %s:%d.  Continuing\n",
                                            userid, ludp->lud_host, ludp->lud_port );
                      }
***************
*** 630,636 ****
          i++;
      }
  
!     pbc_log_activity(PBC_LOG_DEBUG_VERBOSE, "ldap_verifier: bye!\n" );
  
      return(got_error);
  }
--- 636,642 ----
          i++;
      }
  
!     pbc_log_activity( p, PBC_LOG_DEBUG_VERBOSE, "ldap_verifier: bye!\n" );
  
      return(got_error);
  }
***************
*** 638,644 ****
  
  #else /* ENABLE_LDAP */
  
! static int ldap_v(const char *userid,
  		  const char *passwd,
  		  const char *service,
  		  const char *user_realm,
--- 644,650 ----
  
  #else /* ENABLE_LDAP */
  
! static int ldap_v(pool * p, const char *userid,
  		  const char *passwd,
  		  const char *service,
  		  const char *user_realm,


Index: webiso/pubcookie/src/verify_shadow.c
diff -c webiso/pubcookie/src/verify_shadow.c:1.8 webiso/pubcookie/src/verify_shadow.c:1.9
*** webiso/pubcookie/src/verify_shadow.c:1.8	Thu Nov 14 13:12:12 2002
--- webiso/pubcookie/src/verify_shadow.c	Wed Mar  5 22:12:50 2003
***************
*** 20,26 ****
   */
  
  /*
!     $Id: verify_shadow.c,v 1.8 2002/11/14 21:12:12 jjminer Exp $
   */
  
  /**
--- 20,26 ----
   */
  
  /*
!     $Id: verify_shadow.c,v 1.9 2003/03/06 06:12:50 jjminer Exp $
   */
  
  /**
***************
*** 37,42 ****
--- 37,45 ----
  # include <stdlib.h>
  #endif /* HAVE_STDLIB_H */
  
+ /* Pretending we're Apache */
+ typedef void pool;
+ 
  #include "verify.h"
  
  #ifdef ENABLE_SHADOW
***************
*** 59,65 ****
  # endif /* ! APACHE */
  #endif /* HAVE_DMALLOC_H */
  
! static int shadow_v(const char *userid,
  		    const char *passwd,
  		    const char *service,
  		    const char *user_realm,
--- 62,68 ----
  # endif /* ! APACHE */
  #endif /* HAVE_DMALLOC_H */
  
! static int shadow_v(pool * p, const char *userid,
  		    const char *passwd,
  		    const char *service,
  		    const char *user_realm,
***************
*** 109,115 ****
  
  #else /* ENABLE_SHADOW */
  
! static int shadow_v(const char *userid,
  		    const char *passwd,
  		    const char *service,
  		    const char *user_realm,
--- 112,118 ----
  
  #else /* ENABLE_SHADOW */
  
! static int shadow_v(pool * p, const char *userid,
  		    const char *passwd,
  		    const char *service,
  		    const char *user_realm,



end of message


More information about the pubcookie-dev mailing list