]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
sync with head
authorKurt Zeilenga <kurt@openldap.org>
Wed, 12 Mar 2003 21:58:48 +0000 (21:58 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 12 Mar 2003 21:58:48 +0000 (21:58 +0000)
servers/slapd/daemon.c
servers/slapd/filter.c
servers/slapd/modify.c

index 5869fe418c98243d965836541c49deb0fa5f705f..e61feceb12ae2c7505a29cc5d29c38ffeb6cb7bf 100644 (file)
@@ -107,7 +107,7 @@ void slapd_slp_init( const char* urls ) {
                if( strcmp( slapd_srvurls[i], "ldap:///" ) == 0) {
                        char *host = ldap_pvt_get_fqdn( NULL );
                        if ( host != NULL ) {
-                               slapd_srvurls[i] = (char *) realloc( slapd_srvurls[i],
+                               slapd_srvurls[i] = (char *) ch_realloc( slapd_srvurls[i],
                                        strlen( host ) +
                                        sizeof( LDAP_SRVTYPE_PREFIX ) );
                                strcpy( lutil_strcopy(slapd_srvurls[i],
@@ -119,7 +119,7 @@ void slapd_slp_init( const char* urls ) {
                } else if ( strcmp( slapd_srvurls[i], "ldaps:///" ) == 0) {
                        char *host = ldap_pvt_get_fqdn( NULL );
                        if ( host != NULL ) {
-                               slapd_srvurls[i] = (char *) realloc( slapd_srvurls[i],
+                               slapd_srvurls[i] = (char *) ch_realloc( slapd_srvurls[i],
                                        strlen( host ) +
                                        sizeof( LDAPS_SRVTYPE_PREFIX ) );
                                strcpy( lutil_strcopy(slapd_srvurls[i],
@@ -1613,7 +1613,7 @@ slapd_daemon_task(
 #ifdef SLAPD_RLOOKUPS
                                if ( use_reverse_lookup ) {
                                        char *herr;
-                                       if (ldap_pvt_get_hname( &from, len, hbuf,
+                                       if (ldap_pvt_get_hname( (const struct sockaddr *)&from, len, hbuf,
                                                sizeof(hbuf), &herr ) == 0) {
                                                ldap_pvt_str2lower( hbuf );
                                                dnsname = hbuf;
index 45a8d190e9b343bb9488670d3cb149dd4ab92356..c29b86f2acca3b59ae6ce82bd552022c52d6ecbb 100644 (file)
@@ -602,7 +602,7 @@ filter2bv( Filter *f, struct berval *fstr )
 
                fstr->bv_len = f->f_av_desc->ad_cname.bv_len +
                        tmp.bv_len + ( sizeof("(=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=%s)",
                        f->f_av_desc->ad_cname.bv_val,
@@ -616,7 +616,7 @@ filter2bv( Filter *f, struct berval *fstr )
 
                fstr->bv_len = f->f_av_desc->ad_cname.bv_len +
                        tmp.bv_len + ( sizeof("(>=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s>=%s)",
                        f->f_av_desc->ad_cname.bv_val,
@@ -630,7 +630,7 @@ filter2bv( Filter *f, struct berval *fstr )
 
                fstr->bv_len = f->f_av_desc->ad_cname.bv_len +
                        tmp.bv_len + ( sizeof("(<=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s<=%s)",
                        f->f_av_desc->ad_cname.bv_val,
@@ -644,7 +644,7 @@ filter2bv( Filter *f, struct berval *fstr )
 
                fstr->bv_len = f->f_av_desc->ad_cname.bv_len +
                        tmp.bv_len + ( sizeof("(~=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s~=%s)",
                        f->f_av_desc->ad_cname.bv_val,
@@ -655,7 +655,7 @@ filter2bv( Filter *f, struct berval *fstr )
        case LDAP_FILTER_SUBSTRINGS:
                fstr->bv_len = f->f_sub_desc->ad_cname.bv_len +
                        ( sizeof("(=*)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 128 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 128 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)",
                        f->f_sub_desc->ad_cname.bv_val );
@@ -710,7 +710,7 @@ filter2bv( Filter *f, struct berval *fstr )
        case LDAP_FILTER_PRESENT:
                fstr->bv_len = f->f_desc->ad_cname.bv_len +
                        ( sizeof("(=*)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)",
                        f->f_desc->ad_cname.bv_val );
@@ -720,7 +720,7 @@ filter2bv( Filter *f, struct berval *fstr )
        case LDAP_FILTER_OR:
        case LDAP_FILTER_NOT:
                fstr->bv_len = sizeof("(%)") - 1;
-               fstr->bv_val = malloc( fstr->bv_len + 128 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 128 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%c)",
                        f->f_choice == LDAP_FILTER_AND ? '&' :
@@ -757,7 +757,7 @@ filter2bv( Filter *f, struct berval *fstr )
                        ( f->f_mr_dnattrs ? sizeof(":dn")-1 : 0 ) +
                        ( f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_len+1 : 0 ) +
                        tmp.bv_len + ( sizeof("(:=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)",
                        ad.bv_val,
@@ -1141,7 +1141,7 @@ vrFilter2bv( ValuesReturnFilter *vrf, struct berval *fstr )
        }
 
        fstr->bv_len = sizeof("()") - 1;
-       fstr->bv_val = malloc( fstr->bv_len + 128 );
+       fstr->bv_val = ch_malloc( fstr->bv_len + 128 );
 
        snprintf( fstr->bv_val, fstr->bv_len + 1, "()");
 
@@ -1177,7 +1177,7 @@ simple_vrFilter2bv( ValuesReturnFilter *vrf, struct berval *fstr )
 
                fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len +
                        tmp.bv_len + ( sizeof("(=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=%s)",
                        vrf->vrf_av_desc->ad_cname.bv_val,
@@ -1191,7 +1191,7 @@ simple_vrFilter2bv( ValuesReturnFilter *vrf, struct berval *fstr )
 
                fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len +
                        tmp.bv_len + ( sizeof("(>=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s>=%s)",
                        vrf->vrf_av_desc->ad_cname.bv_val,
@@ -1205,7 +1205,7 @@ simple_vrFilter2bv( ValuesReturnFilter *vrf, struct berval *fstr )
 
                fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len +
                        tmp.bv_len + ( sizeof("(<=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s<=%s)",
                        vrf->vrf_av_desc->ad_cname.bv_val,
@@ -1219,7 +1219,7 @@ simple_vrFilter2bv( ValuesReturnFilter *vrf, struct berval *fstr )
 
                fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len +
                        tmp.bv_len + ( sizeof("(~=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s~=%s)",
                        vrf->vrf_av_desc->ad_cname.bv_val,
@@ -1230,7 +1230,7 @@ simple_vrFilter2bv( ValuesReturnFilter *vrf, struct berval *fstr )
        case LDAP_FILTER_SUBSTRINGS:
                fstr->bv_len = vrf->vrf_sub_desc->ad_cname.bv_len +
                        ( sizeof("(=*)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 128 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 128 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)",
                        vrf->vrf_sub_desc->ad_cname.bv_val );
@@ -1286,7 +1286,7 @@ simple_vrFilter2bv( ValuesReturnFilter *vrf, struct berval *fstr )
        case LDAP_FILTER_PRESENT:
                fstr->bv_len = vrf->vrf_desc->ad_cname.bv_len +
                        ( sizeof("(=*)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)",
                        vrf->vrf_desc->ad_cname.bv_val );
@@ -1307,7 +1307,7 @@ simple_vrFilter2bv( ValuesReturnFilter *vrf, struct berval *fstr )
                        ( vrf->vrf_mr_dnattrs ? sizeof(":dn")-1 : 0 ) +
                        ( vrf->vrf_mr_rule_text.bv_len ? vrf->vrf_mr_rule_text.bv_len+1 : 0 ) +
                        tmp.bv_len + ( sizeof("(:=)") - 1 );
-               fstr->bv_val = malloc( fstr->bv_len + 1 );
+               fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
 
                snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)",
                        ad.bv_val,
index 5e6f5232d09f98405e141625f4f43a76f00f2048..0a6eb40680cf03c2afa5d9af29a21240276b0ec6 100644 (file)
 #include <ac/string.h>
 #include <ac/time.h>
 
-#include "lutil.h"
-
 #include "ldap_pvt.h"
 #include "slap.h"
 #ifdef LDAP_SLAPI
 #include "slapi.h"
 #endif
+#include "lutil.h"
+
 
 int
 do_modify(