diff options
author | Harshavardhana Ranganath <harsha@gluster.com> | 2010-02-22 04:37:47 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2010-02-22 02:29:38 -0800 |
commit | 7c59c0849e4c54be7473151dd45468c68b957ec4 (patch) | |
tree | 5656139f870dd0d4603967a9e3a3333e8a777dc9 /xlators | |
parent | 85cda442079ba252d3a1e625b1f53ca207887159 (diff) |
Add new gf_strstr dropin replacement for "strstr"
Signed-off-by: Harshavardhana <harsha@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 609 (Add new "conf-dir" option)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=609
Diffstat (limited to 'xlators')
-rw-r--r-- | xlators/protocol/server/src/server-protocol.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index 993323a1d4e..608b3151358 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -5239,7 +5239,8 @@ build_volfile_path (xlator_t *this, const char *key, char *path, /* Make sure that conf-dir doesn't * contain ".." in path */ - if (strstr (conf_dir_data->data, "..")) { + if ((gf_strstr (conf_dir_data->data, + "/", "..")) == -1) { ret = -1; gf_log (this->name, GF_LOG_ERROR, "%s: invalid conf_dir", @@ -5251,7 +5252,7 @@ build_volfile_path (xlator_t *this, const char *key, char *path, * contain "../" in path */ - if (strstr (key, "../")) { + if ((gf_strstr (key, "/", "..")) == -1) { ret = -1; gf_log (this->name, GF_LOG_ERROR, "%s: invalid key", key); |