From: Kurt Zeilenga Date: Mon, 11 Jun 2001 21:25:14 +0000 (+0000) Subject: Remove more UFN cruft X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~1323 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=85a2c40ca074b9a38cff695047d05d2351175337;p=openldap Remove more UFN cruft --- diff --git a/clients/finger/main.c b/clients/finger/main.c index a19fece964..96f8d3595c 100644 --- a/clients/finger/main.c +++ b/clients/finger/main.c @@ -259,7 +259,7 @@ do_search( LDAP *ld, char *buf ) { char *dn, *rdn; char **title; - int rc = 0, matches = 0, i, ufn; + int rc = 0, matches = 0, i; struct timeval tv; LDAPFiltDesc *fd; LDAPFiltInfo *fi = NULL; @@ -270,25 +270,6 @@ do_search( LDAP *ld, char *buf ) #endif 0 }; - ufn = 0; -#ifdef FINGER_UFN - if ( strchr( buf, ',' ) != NULL ) { - ldap_ufn_setprefix( ld, base ); - tv.tv_sec = FINGER_TIMEOUT; - tv.tv_usec = 0; - ldap_ufn_timeout( (void *) &tv ); - - if ( (rc = ldap_ufn_search_s( ld, buf, attrs, 0, &result )) - != LDAP_SUCCESS && rc != LDAP_SIZELIMIT_EXCEEDED ) { - fprintf( stderr, FINGER_UNAVAILABLE ); - ldap_perror( ld, "ldap_search_st" ); - exit( EXIT_FAILURE ); - } - - matches = ldap_count_entries( ld, result ); - ufn = 1; - } else { -#endif if ( (fd = ldap_init_getfilter( filterfile )) == NULL ) { fprintf( stderr, "Cannot open filter file (%s)\n", @@ -318,9 +299,6 @@ do_search( LDAP *ld, char *buf ) ldap_msgfree( result ); result = NULL; } -#ifdef FINGER_UFN - } -#endif if ( rc == LDAP_SIZELIMIT_EXCEEDED ) { printf( "(Partial results - a size limit was exceeded)\r\n" ); @@ -336,7 +314,7 @@ do_search( LDAP *ld, char *buf ) exit( EXIT_FAILURE ); } else if ( matches <= FINGER_LISTLIMIT ) { printf( "%d %s match%s found for \"%s\":\r\n", matches, - ufn ? "UFN" : fi->lfi_desc, matches > 1 ? "es" : "", buf ); + fi->lfi_desc, matches > 1 ? "es" : "", buf ); fflush( stdout ); for ( e = ldap_first_entry( ld, result ); e != NULL; ) { @@ -348,7 +326,7 @@ do_search( LDAP *ld, char *buf ) } } else { printf( "%d %s matches for \"%s\":\r\n", matches, - ufn ? "UFN" : fi->lfi_desc, buf ); + fi->lfi_desc, buf ); fflush( stdout ); #ifdef FINGER_SORT_ATTR diff --git a/clients/gopher/go500.c b/clients/gopher/go500.c index 2b7c4ed675..948d4b4e88 100644 --- a/clients/gopher/go500.c +++ b/clients/gopher/go500.c @@ -482,24 +482,6 @@ do_search( LDAP *ld, FILE *fp, char *buf ) LDAPMessage *e, *res; static char *attrs[] = { "title", 0 }; -#ifdef GO500_UFN - if ( strchr( buf, ',' ) != NULL ) { - ldap_ufn_setprefix( ld, base ); - tv.tv_sec = GO500_TIMEOUT; - tv.tv_usec = 0; - ldap_ufn_timeout( (void *) &tv ); - - if ( (rc = ldap_ufn_search_s( ld, buf, attrs, 0, &res )) - != LDAP_SUCCESS && rc != LDAP_SIZELIMIT_EXCEEDED ) { - fprintf(fp, - "0An error occurred (explanation)\t@%d\t%s\t%d\r\n", - rc, myhost, myport ); - return; - } - - matches = ldap_count_entries( ld, res ); - } else { -#endif if ( (filtd = ldap_init_getfilter( filterfile )) == NULL ) { fprintf( stderr, "Cannot open filter file (%s)\n", filterfile ); @@ -525,9 +507,6 @@ do_search( LDAP *ld, FILE *fp, char *buf ) break; } ldap_getfilter_free( filtd ); -#ifdef GO500_UFN - } -#endif if ( matches <= 0 ) { return; diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index efe5054d81..b1292ba897 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -743,27 +743,6 @@ do_search( LDAP *ld, FILE *fp, char *query ) *filter++ = '\0'; base = query; -#ifdef GO500GW_UFN - if ( strchr( filter, ',' ) != NULL ) { - ldap_ufn_setprefix( ld, base ); - timeout.tv_sec = GO500GW_TIMEOUT; - timeout.tv_usec = 0; - ldap_ufn_timeout( (void *) &timeout ); - - deref = LDAP_DEREF_FINDING; - ldap_set_option(ld, LDAP_OPT_DEREF, &deref); - - if ( (rc = ldap_ufn_search_s( ld, filter, attrs, 0, &res )) - != LDAP_SUCCESS && rc != LDAP_SIZELIMIT_EXCEEDED ) { - fprintf(fp, - "0An error occurred (explanation)\t@%d\t%s\t%d\r\n", - rc, myhost, myport ); - return; - } - - count = ldap_count_entries( ld, res ); - } else { -#endif if ( (scope = make_scope( ld, base )) == -1 ) { fprintf( fp, "3Bad scope\r\n" ); exit( EXIT_FAILURE ); @@ -801,9 +780,6 @@ do_search( LDAP *ld, FILE *fp, char *query ) deref = LDAP_DEREF_ALWAYS; ldap_set_option(ld, LDAP_OPT_DEREF, &deref); ldap_getfilter_free( filtd ); -#ifdef GO500GW_UFN - } -#endif if ( count == 0 ) { return; diff --git a/clients/rcpt500/query.c b/clients/rcpt500/query.c index 4e92f62a43..55996a9e06 100644 --- a/clients/rcpt500/query.c +++ b/clients/rcpt500/query.c @@ -41,7 +41,7 @@ query_cmd( struct msginfo *msgp, char *reply ) LDAP *ldp; LDAPMessage *ldmsgp, *entry; char *dn; - int matches, rc, ld_errno, ufn; + int matches, rc, ld_errno; LDAPFiltDesc *lfdp; LDAPFiltInfo *lfi; struct ldap_disptmpl *tmpllist = NULL; @@ -51,8 +51,6 @@ query_cmd( struct msginfo *msgp, char *reply ) #endif NULL }; - ufn = 0; - if ( msgp->msg_arg == NULL ) { return( help_cmd( msgp, reply )); } @@ -95,24 +93,6 @@ query_cmd( struct msginfo *msgp, char *reply ) matches = 0; -#ifdef RCPT500_UFN - if ( strchr( msgp->msg_arg, ',' ) != NULL ) { - struct timeval tv; - - ldap_ufn_setprefix( ldp, searchbase ); - if (( rc = ldap_ufn_search_s( ldp, msgp->msg_arg, attrs, 0, &ldmsgp )) - != LDAP_SUCCESS && rc != LDAP_SIZELIMIT_EXCEEDED - && rc != LDAP_TIMELIMIT_EXCEEDED ) { - report_ldap_err( ldp, reply ); - close_ldap( ldp ); - ldap_getfilter_free( lfdp ); - return( 0 ); - } - matches = ldap_count_entries( ldp, ldmsgp ); - ufn = 1; - } else { -#endif /* RCPT500_UFN */ - for ( lfi = ldap_getfirstfilter( lfdp, "rcpt500", msgp->msg_arg ); lfi != NULL; lfi = ldap_getnextfilter( lfdp )) { rc = ldap_search_s( ldp, searchbase, LDAP_SCOPE_SUBTREE, @@ -134,9 +114,6 @@ query_cmd( struct msginfo *msgp, char *reply ) ldap_msgfree( ldmsgp ); } } -#ifdef RCPT500_UFN - } -#endif /* RCPT500_UFN */ if ( matches == 0 ) { sprintf( buf, "No matches were found for '%s'\n", msgp->msg_arg ); @@ -156,7 +133,7 @@ query_cmd( struct msginfo *msgp, char *reply ) if ( matches <= RCPT500_LISTLIMIT ) { sprintf( buf, "%d %s match%s found for '%s':\n\n", matches, - ufn ? "UFN" : lfi->lfi_desc, + lfi->lfi_desc, ( matches > 1 ) ? "es" : "", msgp->msg_arg ); strcat( reply, buf ); @@ -184,7 +161,7 @@ query_cmd( struct msginfo *msgp, char *reply ) } else { sprintf( buf, "%d %s matches were found for '%s':\n", - matches, ufn ? "UFN" : lfi->lfi_desc, msgp->msg_arg ); + matches, lfi->lfi_desc, msgp->msg_arg ); strcat( reply, buf ); append_entry_list( reply, msgp->msg_arg, ldp, ldmsgp ); ldap_msgfree( ldmsgp ); diff --git a/clients/ud/find.c b/clients/ud/find.c index 890ff431ce..d5b85e9c21 100644 --- a/clients/ud/find.c +++ b/clients/ud/find.c @@ -213,9 +213,6 @@ find( char *who, int quiet ) break; } - /* - * It wasn't a UFN, so look it up in the usual method. - */ for (fi = ldap_getfirstfilter(lfdp, "ud", who); fi != NULL; fi = ldap_getnextfilter(lfdp)) { #ifdef DEBUG diff --git a/clients/ud/mod.c b/clients/ud/mod.c index ecacefbe6d..2484c8af80 100644 --- a/clients/ud/mod.c +++ b/clients/ud/mod.c @@ -466,9 +466,8 @@ mail_is_good: * If the attribute which we are gathering is a "owner" * then we should lookup the name. The user is going to * either have to change the search base before doing the - * modify, or the person is going to have to be within the - * scope of the current search base, or they will need to - * type in a UFN. + * modify or the person is going to have to be within the + * scope of the current search base. */ if (!strcmp(id, "owner")) { LDAPMessage *lmp, *elmp;