From 91fbc6ea1f1475d5b4cc2eef0c5a5b9b2bfd186f Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Wed, 3 May 2017 17:19:57 +0530 Subject: gfapi: fix handling of dot and double dot in path This patch is to handle "." and ".." in file path. Which means this special dentry names will be resolved before sending fops on the path. Backport of> >Change-Id: I5e92f6d1ad1412bf432eb2488e53fb7731edb013 >BUG: 1447266 >Signed-off-by: Mohammed Rafi KC >Reviewed-on: https://review.gluster.org/17177 >Smoke: Gluster Build System >Reviewed-by: Niels de Vos >CentOS-regression: Gluster Build System >NetBSD-regression: NetBSD Build System >Reviewed-by: Jeff Darcy Change-Id: I5e92f6d1ad1412bf432eb2488e53fb7731edb013 BUG: 1463528 Signed-off-by: Mohammed Rafi KC Reviewed-on: https://review.gluster.org/17237 Smoke: Gluster Build System Tested-by: Shyamsundar Ranganathan CentOS-regression: Gluster Build System Reviewed-by: Shyamsundar Ranganathan --- libglusterfs/src/inode.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'libglusterfs/src/inode.h') diff --git a/libglusterfs/src/inode.h b/libglusterfs/src/inode.h index cdc2095a0e8..253196378a8 100644 --- a/libglusterfs/src/inode.h +++ b/libglusterfs/src/inode.h @@ -286,4 +286,21 @@ inode_has_dentry (inode_t *inode); size_t inode_ctx_size (inode_t *inode); +/* + * This function is used to change the dentry from a path + * if it contains any "." or ".." . + * + * It replaces "." and ".." to proper bname after resolving + * and will change the component accordingly. + * + * This fucntion also replaces the parent inode based on the + * bname. + * + * We should give a allocated memory as a third argument to store + * the component in case if we are modifying it. + */ + +void +glusterfs_normalize_dentry (inode_t **parent, char **component, + char *dentry_name); #endif /* _INODE_H */ -- cgit