mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Fix prev commit
This commit is contained in:
parent
58865ccb38
commit
b6a42fd1a2
@ -929,6 +929,9 @@ limits_unparse( struct slap_limits *lim, struct berval *bv )
|
|||||||
ptr = lutil_strcopy( ptr, lim->lm_group_oc->soc_cname.bv_val );
|
ptr = lutil_strcopy( ptr, lim->lm_group_oc->soc_cname.bv_val );
|
||||||
*ptr++ = '/';
|
*ptr++ = '/';
|
||||||
ptr = lutil_strcopy( ptr, lim->lm_group_ad->ad_cname.bv_val );
|
ptr = lutil_strcopy( ptr, lim->lm_group_ad->ad_cname.bv_val );
|
||||||
|
ptr = lutil_strcopy( ptr, "=\"" );
|
||||||
|
ptr = lutil_strcopy( ptr, lim->lm_pat.bv_val );
|
||||||
|
*ptr++ = '"';
|
||||||
} else {
|
} else {
|
||||||
lm = lim->lm_flags & SLAP_LIMITS_MASK;
|
lm = lim->lm_flags & SLAP_LIMITS_MASK;
|
||||||
switch( lm ) {
|
switch( lm ) {
|
||||||
@ -973,24 +976,25 @@ limits_unparse_one( struct slap_limits_set *lim, int which, struct berval *bv )
|
|||||||
if ( which & SLAP_LIMIT_SIZE ) {
|
if ( which & SLAP_LIMIT_SIZE ) {
|
||||||
if ( lim->lms_s_soft != SLAPD_DEFAULT_SIZELIMIT ) {
|
if ( lim->lms_s_soft != SLAPD_DEFAULT_SIZELIMIT ) {
|
||||||
|
|
||||||
|
/* If same as global limit, drop it */
|
||||||
|
if ( lim != &frontendDB->be_def_limit &&
|
||||||
|
lim->lms_s_soft == frontendDB->be_def_limit.lms_s_soft )
|
||||||
|
goto s_hard;
|
||||||
/* If there's also a hard limit, fully qualify this one */
|
/* If there's also a hard limit, fully qualify this one */
|
||||||
if ( lim->lms_s_hard )
|
else if ( lim->lms_s_hard )
|
||||||
ptr = lutil_strcopy( ptr, " size.soft=" );
|
ptr = lutil_strcopy( ptr, " size.soft=" );
|
||||||
|
|
||||||
/* If doing both size & time, qualify this */
|
/* If doing both size & time, qualify this */
|
||||||
else if ( which & SLAP_LIMIT_TIME )
|
else if ( which & SLAP_LIMIT_TIME )
|
||||||
ptr = lutil_strcopy( ptr, " size=" );
|
ptr = lutil_strcopy( ptr, " size=" );
|
||||||
|
|
||||||
/* Otherwise if same as global limit, drop it */
|
|
||||||
else if ( lim != &frontendDB->be_def_limit &&
|
|
||||||
lim->lms_s_soft == frontendDB->be_def_limit.lms_s_soft )
|
|
||||||
return;
|
|
||||||
if ( lim->lms_s_soft == -1 )
|
if ( lim->lms_s_soft == -1 )
|
||||||
ptr = lutil_strcopy( ptr, "unlimited" );
|
ptr = lutil_strcopy( ptr, "unlimited" );
|
||||||
else
|
else
|
||||||
ptr += sprintf( ptr, "%d", lim->lms_s_soft );
|
ptr += sprintf( ptr, "%d", lim->lms_s_soft );
|
||||||
*ptr++ = ' ';
|
*ptr++ = ' ';
|
||||||
}
|
}
|
||||||
|
s_hard:
|
||||||
if ( lim->lms_s_hard ) {
|
if ( lim->lms_s_hard ) {
|
||||||
ptr = lutil_strcopy( ptr, " size.hard=" );
|
ptr = lutil_strcopy( ptr, " size.hard=" );
|
||||||
if ( lim->lms_s_hard == -1 )
|
if ( lim->lms_s_hard == -1 )
|
||||||
@ -1032,25 +1036,26 @@ limits_unparse_one( struct slap_limits_set *lim, int which, struct berval *bv )
|
|||||||
if ( which & SLAP_LIMIT_TIME ) {
|
if ( which & SLAP_LIMIT_TIME ) {
|
||||||
if ( lim->lms_t_soft != SLAPD_DEFAULT_TIMELIMIT ) {
|
if ( lim->lms_t_soft != SLAPD_DEFAULT_TIMELIMIT ) {
|
||||||
|
|
||||||
|
/* If same as global limit, drop it */
|
||||||
|
if ( lim != &frontendDB->be_def_limit &&
|
||||||
|
lim->lms_t_soft == frontendDB->be_def_limit.lms_t_soft )
|
||||||
|
goto t_hard;
|
||||||
|
|
||||||
/* If there's also a hard limit, fully qualify this one */
|
/* If there's also a hard limit, fully qualify this one */
|
||||||
if ( lim->lms_t_hard )
|
else if ( lim->lms_t_hard )
|
||||||
ptr = lutil_strcopy( ptr, " time.soft=" );
|
ptr = lutil_strcopy( ptr, " time.soft=" );
|
||||||
|
|
||||||
/* If doing both size & time, qualify this */
|
/* If doing both size & time, qualify this */
|
||||||
else if ( which & SLAP_LIMIT_SIZE )
|
else if ( which & SLAP_LIMIT_SIZE )
|
||||||
ptr = lutil_strcopy( ptr, " time=" );
|
ptr = lutil_strcopy( ptr, " time=" );
|
||||||
|
|
||||||
/* Otherwise, if same as global limit, drop it */
|
|
||||||
else if ( lim != &frontendDB->be_def_limit &&
|
|
||||||
lim->lms_t_soft == frontendDB->be_def_limit.lms_t_soft )
|
|
||||||
return;
|
|
||||||
|
|
||||||
if ( lim->lms_t_soft == -1 )
|
if ( lim->lms_t_soft == -1 )
|
||||||
ptr = lutil_strcopy( ptr, "unlimited" );
|
ptr = lutil_strcopy( ptr, "unlimited" );
|
||||||
else
|
else
|
||||||
ptr += sprintf( ptr, "%d", lim->lms_t_soft );
|
ptr += sprintf( ptr, "%d", lim->lms_t_soft );
|
||||||
*ptr++ = ' ';
|
*ptr++ = ' ';
|
||||||
}
|
}
|
||||||
|
t_hard:
|
||||||
if ( lim->lms_t_hard ) {
|
if ( lim->lms_t_hard ) {
|
||||||
ptr = lutil_strcopy( ptr, " time.hard=" );
|
ptr = lutil_strcopy( ptr, " time.hard=" );
|
||||||
if ( lim->lms_t_hard == -1 )
|
if ( lim->lms_t_hard == -1 )
|
||||||
|
Loading…
Reference in New Issue
Block a user