We have a post op plugin which triggers undera certain condition and
when Directory Server calls the plugin , Plugin BINDS to OTHER server
( not the same host). The problem I am seeing is that whatever host I
specify , post-op plugin always binds to localhost.

Is there any way to find the problem area for custom plugins?

After I initialize ldap_init() function , and create a LDAP structure
pointer , ldap_simple_bind_s tries to try to bind as admin ID and what
I am getting in
LDAP access logs is, HOST is replaced by LOCALHOST loopback address
127.0.0.1. That is if my  HOST LDAP port is say 255.xxx.xxx.220 , and
client IP is say 222.xxx.xxx.111, instead of seeing in logs a LDAP
connection LDAP connection from 222.xxx.xxx.111 to 255.xxx.xxx.220
LDAP connection from 127.0.0.1 to 127.0.0.1

I checked that HOST and PORT are still valid even after mod is
attempted. I don't know at which point HOST is overwritten by
localhost. I understand that if no HOST is found alive, LDAP C api
will assume localhost?

Below is what I am doing
Note:
argv[0] = HOST
argv[1] = PORT
argv[2] = Admin
argv[3] = pass

        if( (ld = ldap_init(argv[0], atoi(argv[1]))) == NULL)
         {
           (debug)   /* getting correct HOST and PORT here
           /* TRAP error - Unable to Initialize*/

         }
 
  ldapVersion = LDAP_VERSION3;
  ldap_set_option(ld, LDAP_OPT_PROTOCOL_VERSION, &ldapVersion);
  ldap_set_option(ld, LDAP_OPT_REFERRALS,LDAP_OPT_ON);

         /* auth to directory as admin */
  if(ld is Initialized)
  {
  /*Checked if host and port are still valid - Yes they are valid */

           if( ldap_simple_bind_s(ld, argv[2], argv[3]) !=
LDAP_SUCCESS) */
           {
          (debug)/* check for error - unable to BIND */
    
           }
  }
 
         /* contruct the modification to make */
        
         /* make the modification */
         if( ldap_modify_s(ld, dn, mods) != LDAP_SUCCESS)
         {
   /* fails because HOST and PORT are changed to 127.0.0.1 to whatever
is supplied */
          (debug)/* check for - unable to MOD */
         }
        
         ldap_unbind( ld );
_______________________________________________
mozilla-directory mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-directory

Reply via email to