* - 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 );
}
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 ) {
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;
}
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 );