s3:lib/ctdbd_conn: try ctdbd_init_connection() as root
authorStefan Metzmacher <metze@samba.org>
Fri, 23 Dec 2011 13:45:45 +0000 (14:45 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 23 Dec 2011 17:19:13 +0000 (18:19 +0100)
ctdbd_traverse is only called if the main db_context is already
open. So if we could get to information via dbwrap_fetch,
we should also be able to traverse.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Dec 23 18:19:14 CET 2011 on sn-devel-104

source3/lib/ctdbd_conn.c

index 9d4af18ac59d15fb4280964f802c75a6bb095e5c..9d2b544928e2286d238a4bc9b88d60b6cda12764 100644 (file)
@@ -1537,7 +1537,9 @@ NTSTATUS ctdbd_traverse(uint32 db_id,
        int cstatus;
        struct ctdbd_traverse_state state;
 
        int cstatus;
        struct ctdbd_traverse_state state;
 
+       become_root();
        status = ctdbd_init_connection(NULL, &conn);
        status = ctdbd_init_connection(NULL, &conn);
+       unbecome_root();
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("ctdbd_init_connection failed: %s\n",
                          nt_errstr(status)));
        if (!NT_STATUS_IS_OK(status)) {
                DEBUG(0, ("ctdbd_init_connection failed: %s\n",
                          nt_errstr(status)));