From c97156833355697a381e5e6a1c14142d8c9f3593 Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 26 Aug 2010 12:17:37 +0000 Subject: cli, mgmt/glusterd: validate brick Signed-off-by: Pranith Kumar K Signed-off-by: Vijay Bellur --- xlators/mgmt/glusterd/src/glusterd-utils.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'xlators/mgmt/glusterd') diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c index a6f9082a801..9c767da30a9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-utils.c +++ b/xlators/mgmt/glusterd/src/glusterd-utils.c @@ -670,8 +670,13 @@ glusterd_brickinfo_get (char *brick, glusterd_volinfo_t *volinfo, hostname = strtok (dup_brick, ":"); path = strtok (NULL, ":"); - GF_ASSERT (hostname); - GF_ASSERT (path); + if (!hostname || !path) { + gf_log ("", GF_LOG_ERROR, + "brick %s is not of form :", + brick); + ret = -1; + goto out; + } list_for_each_entry (tmp, &volinfo->bricks, brick_list) { -- cgit