From 870dbca5769f2d1f878299168afc12fb421fe281 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Wed, 12 Apr 2000 01:00:48 +0000 Subject: [PATCH] objectclass=* -> NULL --- clients/fax500/main.c | 4 ++-- clients/gopher/go500gw.c | 4 ++-- clients/mail500/main.c | 2 +- clients/tools/ldapdelete.c | 2 +- clients/ud/find.c | 20 ++++++++++---------- clients/ud/main.c | 2 +- libraries/libldap/sasl.c | 2 +- libraries/libldap/tmplout.c | 8 ++++---- servers/slurpd/ldap_op.c | 2 +- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/clients/fax500/main.c b/clients/fax500/main.c index 346ccc8bda..8362a7b520 100644 --- a/clients/fax500/main.c +++ b/clients/fax500/main.c @@ -830,7 +830,7 @@ add_member( timeout.tv_sec = FAX_TIMEOUT; timeout.tv_usec = 0; - if ( (rc = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "(objectclass=*)", + if ( (rc = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, NULL, attrs, 0, &timeout, &res )) != LDAP_SUCCESS ) { if ( rc == LDAP_NO_SUCH_OBJECT ) { add_error( err, nerr, E_BADMEMBER, dn, NULL ); @@ -1464,7 +1464,7 @@ get_attributes_mail_dn( LDAPMessage *e, char *attr1, char *attr2 ) for ( i = 0; dnlist[i] != NULL; i++ ) { if ( (rc = ldap_search_st( ld, dnlist[i], - LDAP_SCOPE_BASE, "(objectclass=*)", attrs, 0, + LDAP_SCOPE_BASE, NULL, attrs, 0, &timeout, &res )) != LDAP_SUCCESS ) { if ( rc != LDAP_NO_SUCH_OBJECT ) { unbind_and_exit( EX_TEMPFAIL ); diff --git a/clients/gopher/go500gw.c b/clients/gopher/go500gw.c index c390b283cd..dfda607001 100644 --- a/clients/gopher/go500gw.c +++ b/clients/gopher/go500gw.c @@ -553,7 +553,7 @@ isnonleaf( LDAP *ld, char **oclist, char *dn ) timeout.tv_usec = 0; ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &sizelimit); if ( (rc = ldap_search_st( ld, dn, LDAP_SCOPE_ONELEVEL, - "(objectClass=*)", attrs, 0, &timeout, &res )) + NULL, attrs, 0, &timeout, &res )) == LDAP_SUCCESS || rc == LDAP_SIZELIMIT_EXCEEDED ) { sizelimit = LDAP_NO_LIMIT; ldap_set_option(ld, LDAP_OPT_SIZELIMIT, &sizelimit); @@ -703,7 +703,7 @@ make_scope( LDAP *ld, char *dn ) timeout.tv_sec = GO500GW_TIMEOUT; timeout.tv_usec = 0; - if ( ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", + if ( ldap_search_st( ld, dn, LDAP_SCOPE_BASE, NULL, attrs, 0, &timeout, &res ) != LDAP_SUCCESS ) { return( -1 ); } diff --git a/clients/mail500/main.c b/clients/mail500/main.c index 3fb309bf9f..8cfd572aab 100644 --- a/clients/mail500/main.c +++ b/clients/mail500/main.c @@ -772,7 +772,7 @@ dn_search( timeout.tv_usec = 0; for ( i = 0; dnlist[i]; i++ ) { if ( (rc = ldap_search_st( ld, dnlist[i], LDAP_SCOPE_BASE, - "(objectclass=*)", def_attr, 0, + NULL, def_attr, 0, &timeout, &res )) != LDAP_SUCCESS ) { if ( rc == LDAP_NO_SUCH_OBJECT ) { add_error( err, nerr, E_BADMEMBER, dnlist[i], NULL ); diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 6ad029a00f..c2fa16cbc2 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -284,7 +284,7 @@ static int deletechildren( LDAP *ld, /* * Do a one level search at dn for children. For each, delete its children. */ - if ( ldap_search_s( ld, dn, LDAP_SCOPE_ONELEVEL, "(objectclass=*)", NULL, 0, &res ) == -1 ) + if ( ldap_search_s( ld, dn, LDAP_SCOPE_ONELEVEL, NULL, NULL, 0, &res ) == -1 ) { ldap_perror( ld, "ldap_search" ); ldap_get_option( ld, LDAP_OPT_ERROR_NUMBER, &rc ); diff --git a/clients/ud/find.c b/clients/ud/find.c index 5efa57f194..59a89ebf15 100644 --- a/clients/ud/find.c +++ b/clients/ud/find.c @@ -36,8 +36,8 @@ static int num_picked = 0; /* used when user picks entry at More prompt */ int vrfy( char *dn ) { - LDAPMessage *results; - static char *attrs[2] = { "objectClass", NULL }; + LDAPMessage *results = NULL; + static char *attrs[2] = { "1.1", NULL }; int ld_errno = 0; #ifdef DEBUG @@ -45,7 +45,7 @@ vrfy( char *dn ) printf("->vrfy(%s)\n", dn); #endif /* verify that this DN exists in the directory */ - (void) ldap_search_s(ld, dn, LDAP_SCOPE_BASE, "objectClass=*", attrs, TRUE, &results); + (void) ldap_search_s(ld, dn, LDAP_SCOPE_BASE, NULL, attrs, TRUE, &results); (void) ldap_msgfree(results); ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno); @@ -69,7 +69,7 @@ disambiguate( LDAPMessage *result, int matches, char **read_attrs, char *who ) char *namelist[MAX_NUM_NAMES]; /* names found */ char response[SMALL_BUF_SIZE]; /* results from user */ char *name = NULL; /* DN to lookup */ - LDAPMessage *mp; + LDAPMessage *mp = NULL; int ld_errno = 0; #ifdef DEBUG @@ -133,7 +133,7 @@ disambiguate( LDAPMessage *result, int matches, char **read_attrs, char *who ) printf(" ld = 0x%x\n", ld); printf(" search base = %s\n", name); printf(" scope = LDAP_SCOPE_BASE\n"); - printf(" filter = objectClass=*\n"); + printf(" filter = (objectClass=*)\n"); for (i = 0; read_attrs[i] != NULL; i++) printf(" read_attrs[%d] = %s\n", i, read_attrs[i]); printf(" read_attrs[%d] = NULL\n", i); @@ -141,7 +141,7 @@ disambiguate( LDAPMessage *result, int matches, char **read_attrs, char *who ) printf(" &mp = 0x%x\n", &mp); } #endif - if (ldap_search_s(ld, name, LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &mp) != LDAP_SUCCESS) { + if (ldap_search_s(ld, name, LDAP_SCOPE_BASE, NULL, read_attrs, FALSE, &mp) != LDAP_SUCCESS) { ldap_perror(ld, "ldap_search_s"); Free(name); ldap_msgfree(mp); @@ -228,7 +228,7 @@ find( char *who, int quiet ) return(NULL); } else if (matches == 1) { dn = ldap_get_dn(ld, ldap_first_entry(ld, res)); - rc = ldap_search_s(ld, dn, LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &res); + rc = ldap_search_s(ld, dn, LDAP_SCOPE_BASE, NULL, read_attrs, FALSE, &res); ldap_memfree(dn); if (rc != LDAP_SUCCESS) { int ld_errno = 0; @@ -307,7 +307,7 @@ find( char *who, int quiet ) printf(" ld = 0x%x\n", ld); printf(" dn = %s\n", dn); printf(" scope = LDAP_SCOPE_BASE\n"); - printf(" filter = %s\n", "objectClass=*"); + printf(" filter = %s\n", "(objectClass=*)"); for (i = 0; read_attrs[i] != NULL; i++) printf(" read_attrs[%d] = %s\n", i, read_attrs[i]); printf(" read_attrs[%d] = NULL\n", i); @@ -315,7 +315,7 @@ find( char *who, int quiet ) printf(" &results = 0x%x\n", &res); } #endif - if (ldap_search_s(ld, dn, LDAP_SCOPE_BASE, "objectClass=*", read_attrs, FALSE, &res) != LDAP_SUCCESS) { + if (ldap_search_s(ld, dn, LDAP_SCOPE_BASE, NULL, read_attrs, FALSE, &res) != LDAP_SUCCESS) { ldap_perror(ld, "ldap_search_s"); ldap_msgfree(res); res = NULL; @@ -466,7 +466,7 @@ fetch_boolean_value( char *who, struct attribute attr ) printf("->fetch_boolean_value(%s, %s)\n", who, attr.quipu_name); #endif attributes[0] = attr.quipu_name; - if (ldap_search_s(ld, who, LDAP_SCOPE_BASE, "objectClass=*", attributes, FALSE, &result) != LDAP_SUCCESS) { + if (ldap_search_s(ld, who, LDAP_SCOPE_BASE, NULL, attributes, FALSE, &result) != LDAP_SUCCESS) { int ld_errno = 0; ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno); if (ld_errno == LDAP_NO_SUCH_ATTRIBUTE) diff --git a/clients/ud/main.c b/clients/ud/main.c index 537280afe2..2aeb8e0c09 100644 --- a/clients/ud/main.c +++ b/clients/ud/main.c @@ -435,7 +435,7 @@ change_base( int type, char **base, char *s ) * the user if they want to see more. They can also just * type a number at that point too. */ - if (ldap_search_s(ld, *base, LDAP_SCOPE_ONELEVEL, "(|(objectClass=quipuNonLeafObject)(objectClass=externalNonLeafObject))", attrs, FALSE, &mp) != LDAP_SUCCESS) { + if (ldap_search_s(ld, *base, LDAP_SCOPE_ONELEVEL, NULL, attrs, FALSE, &mp) != LDAP_SUCCESS) { int ld_errno = 0; ldap_get_option(ld, LDAP_OPT_ERROR_NUMBER, &ld_errno); if ((ld_errno == LDAP_TIMELIMIT_EXCEEDED) || diff --git a/libraries/libldap/sasl.c b/libraries/libldap/sasl.c index f4a1f786ed..f62fa99737 100644 --- a/libraries/libldap/sasl.c +++ b/libraries/libldap/sasl.c @@ -546,7 +546,7 @@ ldap_pvt_sasl_getmechs ( LDAP *ld, LDAP_CONST char *desired, char **pmechlist ) int rc; rc = ldap_search_s( ld, NULL, LDAP_SCOPE_BASE, - "(objectclass=*)", attrs, 0, &res ); + NULL, attrs, 0, &res ); if ( rc != LDAP_SUCCESS ) { return ld->ld_errno; diff --git a/libraries/libldap/tmplout.c b/libraries/libldap/tmplout.c index e804fe0be7..d42cc03ff4 100644 --- a/libraries/libldap/tmplout.c +++ b/libraries/libldap/tmplout.c @@ -478,11 +478,11 @@ do_entry2text_search( #ifdef LDAP_CONNECTIONLESS if ( LDAP_IS_CLDAP( ld )) err = cldap_search_s( ld, dn, LDAP_SCOPE_BASE, - "objectClass=*", ocattrs, 0, &ldmp, NULL ); + NULL, ocattrs, 0, &ldmp, NULL ); else #endif /* LDAP_CONNECTIONLESS */ err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, - "objectClass=*", ocattrs, 0, &timeout, &ldmp ); + NULL, ocattrs, 0, &timeout, &ldmp ); if ( err == LDAP_SUCCESS ) { entry = ldap_first_entry( ld, ldmp ); @@ -511,11 +511,11 @@ do_entry2text_search( #ifdef LDAP_CONNECTIONLESS if ( LDAP_IS_CLDAP( ld )) - err = cldap_search_s( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", + err = cldap_search_s( ld, dn, LDAP_SCOPE_BASE, NULL, fetchattrs, 0, &ldmp, NULL ); else #endif /* LDAP_CONNECTIONLESS */ - err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, "objectClass=*", + err = ldap_search_st( ld, dn, LDAP_SCOPE_BASE, NULL, fetchattrs, 0, &timeout, &ldmp ); if ( freedn ) { diff --git a/servers/slurpd/ldap_op.c b/servers/slurpd/ldap_op.c index 6671ac6ade..dae3e8698a 100644 --- a/servers/slurpd/ldap_op.c +++ b/servers/slurpd/ldap_op.c @@ -857,7 +857,7 @@ read_krbnames( return( NULL ); } rc = ldap_search_st( ri->ri_ldp, ri->ri_bind_dn, LDAP_SCOPE_BASE, - "objectclass=*", kattrs, 0, &kst, &result ); + NULL, kattrs, 0, &kst, &result ); if ( rc != LDAP_SUCCESS ) { Debug( LDAP_DEBUG_ANY, "Error: search failed getting krbnames for %s:%d: %s\n", -- 2.39.5