diff options
-rw-r--r-- | libnetfs/file-get-translator.c | 14 |
1 files changed, 14 insertions, 0 deletions
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; |