summaryrefslogtreecommitdiffstats
path: root/xlators/features/index/src/index.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/index/src/index.c')
-rw-r--r--xlators/features/index/src/index.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/features/index/src/index.c b/xlators/features/index/src/index.c
index 08785f21a2a..f3b12595631 100644
--- a/xlators/features/index/src/index.c
+++ b/xlators/features/index/src/index.c
@@ -841,6 +841,14 @@ 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;
+ }
+
len = snprintf(entry_path, sizeof(entry_path), "%s/%s", pgfid_path,
filename);
if ((len < 0) || (len >= sizeof(entry_path))) {
@@ -875,6 +883,15 @@ 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;
+ }
+
len = snprintf(entry_path, sizeof(entry_path), "%s/%s", pgfid_path,
filename);
if ((len < 0) || (len >= sizeof(entry_path))) {