[gvfs/gnome-2-28] Correctly report -ENOSYS for readline in FUSE



commit 95711768d3e079952d4e127e3291caf8e9ef62f4
Author: Matt McCutchen <matt mattmccutchen net>
Date:   Thu Nov 19 15:09:26 2009 +0100

    Correctly report -ENOSYS for readline in FUSE
    
    The readlink vfunc is not implemented in the FUSE module so we should
    not report success but an error (-ENOSYS). We also don't implement the
    vfunc for now since that might lead to a security issue (see the
    added comment). This fixes bug #601361.
    
    Signed-off-by: Christian Kellner <gicmo gnome org>

 client/gvfsfusedaemon.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/client/gvfsfusedaemon.c b/client/gvfsfusedaemon.c
index 68e4ca0..6e82e15 100644
--- a/client/gvfsfusedaemon.c
+++ b/client/gvfsfusedaemon.c
@@ -892,7 +892,12 @@ vfs_readlink (const gchar *path, gchar *target, size_t size)
 {
   debug_print ("vfs_readlink: %s\n", path);
 
-  return 0;
+  /* This is not implemented because it would allow remote servers to launch
+   * symlink attacks on the local machine.  There's not much of a use for
+   * "readlink" anyway since we don't pass G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
+   * so non-broken symlinks will be followed transparently. */
+
+  return -ENOSYS;
 }
 
 static gint



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]