From 273f898364463cd10165fc82c8c5250a0962c452 Mon Sep 17 00:00:00 2001 From: Sachidananda Date: Sat, 16 Jul 2011 12:54:00 +0000 Subject: Canonicalize path names while creating volumes. When a volume is created resolve symbolic links, delete duplicate slashes in the path name. Signed-off-by: Sachidananda Urs Signed-off-by: Anand Avati BUG: 3183 (When creating volumes brick paths are not handled properly.) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=3183 --- cli/src/cli-cmd-parser.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cli/src/cli-cmd-parser.c') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 0097703f6c9..a767dfc35b7 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -75,13 +75,15 @@ cli_cmd_bricks_parse (const char **words, int wordcount, int brick_index, brick_list_len++; while (brick_index < wordcount) { if (validate_brick_name ((char *)words[brick_index])) { - cli_out ("wrong brick type: %s, use :" + cli_out ("Wrong brick type: %s, use :" "", words[brick_index]); ret = -1; goto out; } else { delimiter = strrchr (words[brick_index], ':'); - cli_path_strip_trailing_slashes (delimiter + 1); + ret = cli_canonicalize_path (delimiter + 1); + if (ret) + goto out; } if ((brick_list_len + strlen (words[brick_index]) + 1) > sizeof (brick_list)) { -- cgit