[PATCHES] Two small fixes for ctdb command

Christof Schmitt cs at samba.org
Fri Dec 7 21:48:22 UTC 2018


From d0b081f07d20183d3ad13fd710be20f7fa68b35d Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Mon, 22 May 2017 12:31:35 -0700
Subject: [PATCH 1/2] ctdb: Fix hex to int conversion in h2i

Signed-off-by: Christof Schmitt <cs at samba.org>
---
 ctdb/tools/ctdb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index f96167f9366..1844f1ff196 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -587,7 +587,7 @@ static int h2i(char h)
 		return h - 'a' + 10;
 	}
 	if (h >= 'A' && h <= 'F') {
-		return h - 'f' + 10;
+		return h - 'A' + 10;
 	}
 	return h - '0';
 }
-- 
2.17.0


From 18c12e428dcfd2d831ba02db5a9ba1b1c7a4719b Mon Sep 17 00:00:00 2001
From: Christof Schmitt <cs at samba.org>
Date: Mon, 22 May 2017 16:28:40 -0700
Subject: [PATCH 2/2] ctdb: Remove <file> parameter from pfetch usage info

The code does not implement saving the record data to a file, so update
the usage info accordingly.

Signed-off-by: Christof Schmitt <cs at samba.org>
---
 ctdb/tools/ctdb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index 1844f1ff196..b598a866c9b 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -4804,7 +4804,7 @@ static int control_pfetch(TALLOC_CTX *mem_ctx, struct ctdb_context *ctdb,
 	TDB_DATA key, data;
 	int ret;
 
-	if (argc < 2 || argc > 3) {
+	if (argc != 2) {
 		usage("pfetch");
 	}
 
@@ -5973,7 +5973,7 @@ static const struct ctdb_cmd {
 	{ "setdbsticky", control_setdbsticky, false, true,
 		"enable sticky records", "<dbname|dbid>"},
 	{ "pfetch", control_pfetch, false, false,
-		"fetch record from persistent database", "<dbname|dbid> <key> [<file>]" },
+		"fetch record from persistent database", "<dbname|dbid> <key>" },
 	{ "pstore", control_pstore, false, false,
 		"write record to persistent database", "<dbname|dbid> <key> <value>" },
 	{ "pdelete", control_pdelete, false, false,
-- 
2.17.0



More information about the samba-technical mailing list