diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-11-21 02:52:18 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2014-11-21 02:54:21 +0100 |
commit | 9a56d8f0803d40dacb92eb366b534bbbd5438096 (patch) | |
tree | a48ec0e4f110b9fb9217fc7ff2f261f33c2550a8 /libnetfs | |
parent | f88d4616a25175c42c10334491054d54310262db (diff) |
Fix recording complete path of passive relative translators
* libnetfs/dir-lookup.c (netfs_S_dir_lookup): Prepend current path to
the relative path before recording the active translator.
Diffstat (limited to 'libnetfs')
-rw-r--r-- | libnetfs/dir-lookup.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libnetfs/dir-lookup.c b/libnetfs/dir-lookup.c index 99a8746e..2d3da947 100644 --- a/libnetfs/dir-lookup.c +++ b/libnetfs/dir-lookup.c @@ -297,6 +297,7 @@ netfs_S_dir_lookup (struct protid *diruser, if (register_translator) { char *translator_path = strdupa (relpath); + char *complete_path; if (nextname != NULL) { /* This was not the last path component. @@ -309,9 +310,17 @@ netfs_S_dir_lookup (struct protid *diruser, translator_path[end - filename_start] = '\0'; } + if (diruser->po->path == NULL) + /* diruser is the root directory. */ + complete_path = translator_path; + else + asprintf (&complete_path, "%s/%s", diruser->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) { ports_port_deref (newpi); |