From 9746ee75865162af1827337f22a553ea0c3ba2ed Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Tue, 29 Mar 2016 19:06:46 +0530 Subject: features/changelog: Don't modify 'pargfid' in 'resolve_pargfid_to_path' If 'changelog' is enabled and 'changelog.capture-del-path' option is on it calls 'resolve_pargfid_to_path' which modifies 'pargfid' sent by caller. 'changelog_unlink' calls this routine directly with 'loc->pargfid' resulting it being modified and point to root instead of actual pargfid. This is a nasty bug and could cause the deletion of entry on root directory instead on actual parent when 'loc->path' is not present. Hence this fix to make 'pargfid' a const pointer and 'resolve_pargfid' to work on copy of pargfid. Glusterfind session creation enables these options by default to capture deleted entry path in changelog. Thanks Pranith for root causing this. Change-Id: I1d275a86f91c981b6889bedef93401c039d01d71 BUG: 1321955 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/13845 Smoke: Gluster Build System NetBSD-regression: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri Reviewed-by: Venky Shankar Reviewed-by: Ravishankar N CentOS-regression: Gluster Build System --- libglusterfs/src/compat-uuid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libglusterfs') diff --git a/libglusterfs/src/compat-uuid.h b/libglusterfs/src/compat-uuid.h index 4161b958508..8dac6990388 100644 --- a/libglusterfs/src/compat-uuid.h +++ b/libglusterfs/src/compat-uuid.h @@ -28,7 +28,7 @@ gf_uuid_compare (uuid_t u1, uuid_t u2) } static inline void -gf_uuid_copy (uuid_t dst, uuid_t src) +gf_uuid_copy (uuid_t dst, const uuid_t src) { uuid_copy (dst, src); } -- cgit