From: Amitay Isaacs Date: Tue, 8 Mar 2016 04:12:42 +0000 (+1100) Subject: ctdb-tunables: Fix the implementation of LIST_TUNABLES control X-Git-Tag: tdb-1.3.9~448 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd23b43bfe9abe586a222673bede4414b6299518;p=thirdparty%2Fsamba.git ctdb-tunables: Fix the implementation of LIST_TUNABLES control Do not assume the first tunable is not obsolete. Signed-off-by: Amitay Isaacs Reviewed-by: Martin Schwenke --- diff --git a/ctdb/server/ctdb_tunables.c b/ctdb/server/ctdb_tunables.c index ef552bd6973..87dc58ca751 100644 --- a/ctdb/server/ctdb_tunables.c +++ b/ctdb/server/ctdb_tunables.c @@ -199,18 +199,20 @@ int32_t ctdb_control_list_tunables(struct ctdb_context *ctdb, TDB_DATA *outdata) int i; struct ctdb_control_list_tunable *t; - list = talloc_strdup(outdata, tunable_map[0].name); - CTDB_NO_MEMORY(ctdb, list); - - for (i=1;idsize = offsetof(struct ctdb_control_list_tunable, data) + + outdata->dsize = offsetof(struct ctdb_control_list_tunable, data) + strlen(list) + 1; outdata->dptr = talloc_size(outdata, outdata->dsize); CTDB_NO_MEMORY(ctdb, outdata->dptr); @@ -221,5 +223,5 @@ int32_t ctdb_control_list_tunables(struct ctdb_context *ctdb, TDB_DATA *outdata) memcpy(t->data, list, t->length); talloc_free(list); - return 0; + return 0; }