mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-25 00:59:45 -05:00
cleanup ident string
This commit is contained in:
parent
d23243a507
commit
dde3f1ad3f
1 changed files with 30 additions and 15 deletions
|
|
@ -1372,8 +1372,7 @@ monitor_back_db_open(
|
|||
Entry *e, **ep;
|
||||
monitor_entry_t *mp;
|
||||
int i;
|
||||
char buf[ BACKMONITOR_BUFSIZE ],
|
||||
*end_of_line;
|
||||
char buf[ BACKMONITOR_BUFSIZE ];
|
||||
struct berval bv;
|
||||
struct tm *tms;
|
||||
#ifdef HAVE_GMTIME_R
|
||||
|
|
@ -1452,20 +1451,36 @@ monitor_back_db_open(
|
|||
return( -1 );
|
||||
}
|
||||
|
||||
bv.bv_val = (char *) Versionstr;
|
||||
end_of_line = strchr( Versionstr, '\n' );
|
||||
if ( end_of_line ) {
|
||||
bv.bv_len = end_of_line - Versionstr;
|
||||
} else {
|
||||
bv.bv_len = strlen( Versionstr );
|
||||
}
|
||||
bv.bv_val = strchr( (char *) Versionstr, '$' );
|
||||
if ( bv.bv_val != NULL ) {
|
||||
char *end;
|
||||
|
||||
if ( attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
|
||||
&bv, NULL ) ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"unable to add monitoredInfo to \"%s\" entry\n",
|
||||
SLAPD_MONITOR_DN, 0, 0 );
|
||||
return( -1 );
|
||||
bv.bv_val++;
|
||||
for ( ; bv.bv_val[ 0 ] == ' '; bv.bv_val++ )
|
||||
;
|
||||
|
||||
end = strchr( bv.bv_val, '$' );
|
||||
if ( end != NULL ) {
|
||||
end--;
|
||||
|
||||
for ( ; end > bv.bv_val && end[ 0 ] == ' '; end-- )
|
||||
;
|
||||
|
||||
end++;
|
||||
|
||||
bv.bv_len = end - bv.bv_val;
|
||||
|
||||
} else {
|
||||
bv.bv_len = strlen( bv.bv_val );
|
||||
}
|
||||
|
||||
if ( attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
|
||||
&bv, NULL ) ) {
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"unable to add monitoredInfo to \"%s\" entry\n",
|
||||
SLAPD_MONITOR_DN, 0, 0 );
|
||||
return( -1 );
|
||||
}
|
||||
}
|
||||
|
||||
mp = monitor_entrypriv_create();
|
||||
|
|
|
|||
Loading…
Reference in a new issue