summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index a46530c532c..1bf682d4fd3 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1541,6 +1541,15 @@ glusterd_validate_and_create_brickpath (glusterd_brickinfo_t *brickinfo,
goto out;
}
+ if (sizeof(GLUSTERD_DEFAULT_WORKDIR) <= (strlen(brickinfo->path) + 1) &&
+ !strncmp(brickinfo->path, GLUSTERD_DEFAULT_WORKDIR,
+ (sizeof(GLUSTERD_DEFAULT_WORKDIR) - 1))) {
+ len = snprintf (msg, sizeof (msg), "Brick isn't allowed to be "
+ "created inside glusterd's working directory.");
+ ret = -1;
+ goto out;
+ }
+
if (!is_force) {
if (brick_st.st_dev != parent_st.st_dev) {
len = snprintf (msg, sizeof (msg), "The brick %s:%s "