s3: fail db_open_ctdb if ctdb is not around
authorVolker Lendecke <vl@samba.org>
Fri, 6 Aug 2010 10:32:30 +0000 (12:32 +0200)
committerVolker Lendecke <vl@samba.org>
Fri, 6 Aug 2010 12:15:04 +0000 (14:15 +0200)
source3/lib/dbwrap_ctdb.c

index 321a071aaab957ad24c398dd9ef39beb02536f4d..ceaadd225697418273e6914811190fc88a68c7dd 100644 (file)
@@ -1292,6 +1292,11 @@ struct db_context *db_open_ctdb(TALLOC_CTX *mem_ctx,
        db_ctdb->db = result;
 
        conn = messaging_ctdbd_connection(procid_self());
+       if (conn == NULL) {
+               DEBUG(1, ("Could not connect to ctdb\n"));
+               TALLOC_FREE(result);
+               return NULL;
+       }
 
        if (!NT_STATUS_IS_OK(ctdbd_db_attach(conn, name, &db_ctdb->db_id, tdb_flags))) {
                DEBUG(0, ("ctdbd_db_attach failed for %s\n", name));