From 82843893f464f258d31ea3a70977e8b82a72bbb5 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 16 Jul 2013 10:28:01 +0200 Subject: libnetfs: properly respond to file_get_translator requests Properly respond to file_get_translator requests for nodes with a passive translator record. * libnetfs/file-get-translator.c (netfs_S_file_get_translator): Handle passive translator records. --- libnetfs/file-get-translator.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libnetfs/file-get-translator.c b/libnetfs/file-get-translator.c index 59e61020..3e183c14 100644 --- a/libnetfs/file-get-translator.c +++ b/libnetfs/file-get-translator.c @@ -109,6 +109,20 @@ netfs_S_file_get_translator (struct protid *user, *translen = len; err = 0; } + else if (np->nn_translated & S_IPTRANS) + { + char *string = NULL; + size_t len = 0; + err = netfs_get_translator (np, &string, &len); + if (!err) + { + if (len > *translen) + *trans = mmap (0, len, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0); + memmove (*trans, string, len); + *translen = len; + free (string); + } + } else err = EINVAL; -- cgit v1.2.3