ctdb-daemon: Do not allow database detach if AllowClientDBAttach=1
authorAmitay Isaacs <amitay@gmail.com>
Tue, 15 Apr 2014 02:23:42 +0000 (12:23 +1000)
committerMichael Adam <obnox@samba.org>
Wed, 23 Apr 2014 12:49:07 +0000 (14:49 +0200)
This avoids the server detaching a database if clients are allowed to
connect to databases.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
ctdb/server/ctdb_ltdb_server.c

index 3d8772fc887c8c82845b2b9a133c92a18fda11df..fe8636949d53d7a0cc3e5dd55a65dcdb8872f8f3 100644 (file)
@@ -1182,9 +1182,10 @@ int32_t ctdb_control_db_detach(struct ctdb_context *ctdb, TDB_DATA indata,
                return -1;
        }
 
-       if (ctdb->tunable.allow_client_db_attach == 0) {
-               DEBUG(DEBUG_ERR, ("DB detach from database %s denied by "
-                                 "tunable AllowClientDBAccess == 0\n",
+       if (ctdb->tunable.allow_client_db_attach == 1) {
+               DEBUG(DEBUG_ERR, ("DB detach from database %s denied. "
+                                 "Clients are allowed access to databases "
+                                 "(AllowClientDBAccess == 1)\n",
                                  ctdb_db->db_name));
                return -1;
        }