diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-11-21 02:49:29 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-11-21 02:49:29 +0100 |
commit | f88d4616a25175c42c10334491054d54310262db (patch) | |
tree | adc55a505b67c6c0364b8af0fab07bbae19ce250 | |
parent | fa108a1e6f15946aa72cd8edd09f3c08255b76fd (diff) |
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.
-rw-r--r-- | libdiskfs/dir-lookup.c | 11 |
1 files changed, 10 insertions, 1 deletions
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; } |