From 01b0ca760380663fcdd7f9814b19f01bceb2f7f0 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sun, 17 May 2009 22:23:33 +0000 Subject: [PATCH] ITS#6109 fix readonly restriction --- servers/slapd/backend.c | 3 ++- servers/slapd/bconfig.c | 7 +++---- 2 files changed, 5 insertions(+), 5 deletions(-) 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: -- 2.39.5