From f88d4616a25175c42c10334491054d54310262db Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Fri, 21 Nov 2014 02:49:29 +0100 Subject: Fix recording complete path of passive relative translators * libdiskfs/dir-lookup.c (diskfs_S_dir_lookup): Prepend current path to the relative path before recording the active translator. --- libdiskfs/dir-lookup.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'libdiskfs') diff --git a/libdiskfs/dir-lookup.c b/libdiskfs/dir-lookup.c index 3950bf9c..e2287451 100644 --- a/libdiskfs/dir-lookup.c +++ b/libdiskfs/dir-lookup.c @@ -314,6 +314,7 @@ diskfs_S_dir_lookup (struct protid *dircred, if (register_translator) { char *translator_path = strdupa (relpath); + char *complete_path; if (nextname != NULL) { /* This was not the last path component. @@ -326,9 +327,17 @@ diskfs_S_dir_lookup (struct protid *dircred, translator_path[end - path_start] = '\0'; } + if (dircred->po->path == NULL) + /* dircred is the root directory. */ + complete_path = translator_path; + else + asprintf (&complete_path, "%s/%s", dircred->po->path, translator_path); + error = fshelp_set_active_translator (&newpi->pi, - translator_path, + complete_path, np->transbox.active); + if (complete_path != translator_path) + free(complete_path); if (error) goto out; } -- cgit v1.2.3