diff options
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/features/index/src/index.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c index 152b52dfc3..931d8344d7 100644 --- a/xlators/features/index/src/index.c +++ b/xlators/features/index/src/index.c @@ -841,6 +841,15 @@ index_entry_create (xlator_t *this, inode_t *inode, char *filename) ctx->state[ENTRY_CHANGES] = IN; } + if (strchr (filename, '/')) { + gf_msg (this->name, GF_LOG_ERROR, EINVAL, + INDEX_MSG_INDEX_ADD_FAILED, + "Got invalid entry (%s) for pargfid path (%s)", + filename, pgfid_path); + op_errno = EINVAL; + goto out; + } + op_errno = 0; snprintf (entry_path, sizeof(entry_path), "%s/%s", pgfid_path, @@ -870,6 +879,16 @@ index_entry_delete (xlator_t *this, uuid_t pgfid, char *filename) make_gfid_path (priv->index_basepath, ENTRY_CHANGES_SUBDIR, pgfid, pgfid_path, sizeof (pgfid_path)); + + if (strchr (filename, '/')) { + gf_msg (this->name, GF_LOG_ERROR, EINVAL, + INDEX_MSG_INDEX_DEL_FAILED, + "Got invalid entry (%s) for pargfid path (%s)", + filename, pgfid_path); + op_errno = EINVAL; + goto out; + } + snprintf (entry_path, sizeof(entry_path), "%s/%s", pgfid_path, filename); |