]> git.sur5r.net Git - openldap/commitdiff
ITS#6109 fix readonly restriction
authorHoward Chu <hyc@openldap.org>
Sun, 17 May 2009 22:23:33 +0000 (22:23 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 17 May 2009 22:23:33 +0000 (22:23 +0000)
servers/slapd/backend.c
servers/slapd/bconfig.c

index 7e0dbce7d99f9a6648ecc5c486afdb40fd6ea947..ac9dda235f1bd2361d0c8d3c4e9a5dcf86e5ded1 100644 (file)
@@ -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 ) {
index 7979dc57f5ce4da084ed99b0b7008cf752bd1ce3..395fcd77e26a483e6c7504be93d7a40b1a6b7240 100644 (file)
@@ -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: