mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-06 15:10:22 -05:00
Remove more UFN cruft
This commit is contained in:
parent
86acd7eb20
commit
85a2c40ca0
6 changed files with 8 additions and 102 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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 );
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue