From: Howard Chu Date: Sun, 17 May 2009 22:23:33 +0000 (+0000) Subject: ITS#6109 fix readonly restriction X-Git-Tag: ACLCHECK_0~556 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=01b0ca760380663fcdd7f9814b19f01bceb2f7f0;p=openldap ITS#6109 fix readonly restriction --- diff --git a/servers/slapd/backend.c b/servers/slapd/backend.c index 7e0dbce7d9..ac9dda235f 100644 --- a/servers/slapd/backend.c +++ b/servers/slapd/backend.c @@ -1296,7 +1296,8 @@ backend_check_restrictions( } if( ( restrictops & opflag ) - || ( exopflag && ( restrictops & exopflag ) ) ) { + || ( exopflag && ( restrictops & exopflag ) ) + || (( restrictops & SLAP_RESTRICT_READONLY ) && updateop )) { if( ( restrictops & SLAP_RESTRICT_OP_MASK) == SLAP_RESTRICT_OP_READS ) { rs->sr_text = "read operations restricted"; } else if ( restrictops & exopflag ) { diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 7979dc57f5..395fcd77e2 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -896,8 +896,7 @@ config_generic(ConfigArgs *c) { if ( !c->rvalue_vals ) rc = 1; break; case CFG_RO: - c->value_int = (c->be->be_restrictops & SLAP_RESTRICT_OP_WRITES) == - SLAP_RESTRICT_OP_WRITES; + c->value_int = (c->be->be_restrictops & SLAP_RESTRICT_READONLY); break; case CFG_AZPOLICY: c->value_string = ch_strdup( slap_sasl_getpolicy()); @@ -1469,9 +1468,9 @@ config_generic(ConfigArgs *c) { case CFG_RO: if(c->value_int) - c->be->be_restrictops |= SLAP_RESTRICT_OP_WRITES; + c->be->be_restrictops |= SLAP_RESTRICT_READONLY; else - c->be->be_restrictops &= ~SLAP_RESTRICT_OP_WRITES; + c->be->be_restrictops &= ~SLAP_RESTRICT_READONLY; break; case CFG_AZPOLICY: