summaryrefslogtreecommitdiff
path: root/ctdb/tools
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2017-09-07 11:38:41 +1000
committerAmitay Isaacs <amitay@samba.org>2017-09-09 10:53:10 +0200
commit83039d6a5c98683ed2ba96c2be0f5490d22799ce (patch)
tree077e352b815309b2ebac7cd8b20adab31991daa1 /ctdb/tools
parenteb16d4a61cecb0c3d44a344045b0856d7c040cb1 (diff)
downloadsamba-83039d6a5c98683ed2ba96c2be0f5490d22799ce.tar.gz
ctdb-tools: Fix CID 1414746
Signed-off-by: Amitay Isaacs <amitay@gmail.com> Reviewed-by: Martin Schwenke <martin@meltin.net>
Diffstat (limited to 'ctdb/tools')
-rw-r--r--ctdb/tools/ctdb.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 752902d49c6..52e4ea8ccb4 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -4142,6 +4142,7 @@ static int control_restoredb(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
ssize_t n;
int fd, i;
int count, ret;
+ uint8_t db_flags;
if (argc < 1 || argc > 2) {
usage("restoredb");
@@ -4185,8 +4186,9 @@ static int control_restoredb(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
localtime(&db_hdr.timestamp));
printf("Restoring database %s from backup @ %s\n", db_name, timebuf);
+ db_flags = db_hdr.flags & 0xff;
ret = ctdb_attach(ctdb->ev, ctdb->client, TIMEOUT(), db_name,
- db_hdr.flags, &db);
+ db_flags, &db);
if (ret != 0) {
fprintf(stderr, "Failed to attach to DB %s\n", db_name);
close(fd);