From 6fb487a39a7fab3d568122caf4b1c1d9a17adad8 Mon Sep 17 00:00:00 2001 From: Michael Larson Date: Mon, 5 Oct 2009 13:59:14 -0700 Subject: escape value slash in leaf value--followon fix to suppression of leaf value with slash in jenner. --- src/common/unionfs.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/common/unionfs.c b/src/common/unionfs.c index 3f42e5b..6642c05 100644 --- a/src/common/unionfs.c +++ b/src/common/unionfs.c @@ -1034,15 +1034,23 @@ dlist_test_func(GQuark key_id,gpointer data,gpointer user_data) //g_node_insert(node, -1, new_node); insert_sibling_in_order(node,new_node); new_vn->_config._def = vn->_config._def; - // strcat(new_vn->_data._path,"/value"); } else { new_vn = vn; - // strcat(new_vn->_data._path,"/"); strcat(new_vn->_data._path,"/value:"); if (vn_parent->_config._def.multi == FALSE) { char *tmp = (char*)g_quark_to_string(key_id); - if (strchr(tmp,'/') == NULL) { + char *slash = strchr(tmp,'/'); + if (slash == NULL) { + strcat(new_vn->_data._path,tmp); + } + else { + do { //escape '/' to %2F + strncat(new_vn->_data._path,tmp,slash - tmp); + strncat(new_vn->_data._path,"%2F",3); + ++slash; + tmp = slash; + } while ((slash = strchr(slash,'/')) != NULL); strcat(new_vn->_data._path,tmp); } } -- cgit v1.2.3