From: Pierangelo Masarati Date: Mon, 12 Jul 2004 22:33:44 +0000 (+0000) Subject: cleanup X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~78 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f4a428d060456a5fa5e8afc12430ddba16030342;p=openldap cleanup --- diff --git a/servers/slapd/overlays/overlays.c b/servers/slapd/overlays/overlays.c index 74e6217f56..8d2a348989 100644 --- a/servers/slapd/overlays/overlays.c +++ b/servers/slapd/overlays/overlays.c @@ -23,7 +23,6 @@ #include "slap.h" - #if SLAPD_OVER_CHAIN == SLAPD_MOD_STATIC extern int chain_init(); #endif diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index 16d9e9d9c1..959cc4882f 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -667,11 +667,13 @@ rwm_send_entry( Operation *op, SlapReply *rs ) * - attributes that are requested * - no values if attrsonly is set */ + e = entry_dup( e ); if ( e == NULL ) { rc = LDAP_NO_MEMORY; goto fail; } + rs->sr_flags |= ( REP_ENTRY_MODIFIABLE | REP_ENTRY_MUSTBEFREED ); } @@ -1013,12 +1015,12 @@ rwm_config( int rc = 0; char *argv0 = NULL; - if ( strncasecmp( argv[ 0 ], "rwm-", sizeof( "rwm-" ) - 1 ) == 0 ) { + if ( strncasecmp( argv[ 0 ], "rwm-", STRLENOF( "rwm-" ) ) == 0 ) { argv0 = argv[ 0 ]; - argv[ 0 ] = &argv0[ sizeof( "rwm-" ) - 1 ]; + argv[ 0 ] = &argv0[ STRLENOF( "rwm-" ) ]; } - if ( strncasecmp( argv[0], "rewrite", sizeof("rewrite") - 1 ) == 0 ) { + if ( strncasecmp( argv[0], "rewrite", STRLENOF("rewrite") ) == 0 ) { rc = rwm_rw_config( be, fname, lineno, argc, argv ); } else if ( strcasecmp( argv[0], "map" ) == 0 ) { diff --git a/servers/slapd/overlays/rwmconf.c b/servers/slapd/overlays/rwmconf.c index 7917882ad9..0bdb928c55 100644 --- a/servers/slapd/overlays/rwmconf.c +++ b/servers/slapd/overlays/rwmconf.c @@ -270,13 +270,13 @@ rwm_suffix_massage_patternize( const char *s ) len = strlen( s ); - res = ch_calloc( sizeof( char ), len + sizeof( "%1" ) ); + res = ch_calloc( sizeof( char ), len + STRLENOF( "%1" ) + 1 ); if ( res == NULL ) { return NULL; } strcpy( res, "%1" ); - strcpy( res + sizeof( "%1" ) - 1, s ); + strcpy( res + STRLENOF( "%1" ), s ); return res; } diff --git a/servers/slapd/overlays/rwmmap.c b/servers/slapd/overlays/rwmmap.c index 9d79679be3..7333e66068 100644 --- a/servers/slapd/overlays/rwmmap.c +++ b/servers/slapd/overlays/rwmmap.c @@ -78,7 +78,7 @@ rwm_map_init( struct ldapmap *lm, struct ldapmapping **m ) mapping = (struct ldapmapping *)ch_calloc( 2, sizeof( struct ldapmapping ) ); if ( mapping == NULL ) { - return; + return LDAP_NO_MEMORY; } rc = slap_str2ad( "objectClass", &mapping->m_src_ad, &text );