From de2ce14e3b9e93c033e4c4bd67b748a7b7d0b1a3 Mon Sep 17 00:00:00 2001 From: Amit Margalit Date: Fri, 19 Feb 2016 18:06:07 +0200 Subject: [PATCH 1/2] Made GDFuse ignore the fstab option "user". This lets us add the user option into fstab, so anyone can mount the filesystem, if they have access to the creds file... --- gdrivefs/gdfs/gdfuse.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gdrivefs/gdfs/gdfuse.py b/gdrivefs/gdfs/gdfuse.py index 4bd7f0e..d78ef36 100644 --- a/gdrivefs/gdfs/gdfuse.py +++ b/gdrivefs/gdfs/gdfuse.py @@ -852,6 +852,10 @@ def mount(auth_storage_filepath, mountpoint, debug=None, nothreads=None, else: v = True + # ignore the "user" option so we can put in fstab easily + if k == "user": + continue + # We have a list of provided options. See which match against our # application options. From d6d8055553d4f1d8e7c491c731b76bbfcfd6e80b Mon Sep 17 00:00:00 2001 From: Amit Margalit Date: Fri, 19 Feb 2016 18:26:06 +0200 Subject: [PATCH 2/2] Changed calls to str.encode() to use utf8 allowing non-ASCII filenames. --- gdrivefs/gdfs/opened_file.py | 2 +- gdrivefs/gdtool/normal_entry.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gdrivefs/gdfs/opened_file.py b/gdrivefs/gdfs/opened_file.py index 1a05f7c..67c0a41 100644 --- a/gdrivefs/gdfs/opened_file.py +++ b/gdrivefs/gdfs/opened_file.py @@ -197,7 +197,7 @@ def __init__(self, entry_id, path, filename, is_hidden, mime_type): self.__is_loaded = False self.__is_dirty = False - temp_filename = self.__entry_id.encode('ASCII') + temp_filename = self.__entry_id.encode('utf8') om = get_om() self.__temp_filepath = os.path.join(om.temp_path, temp_filename) diff --git a/gdrivefs/gdtool/normal_entry.py b/gdrivefs/gdtool/normal_entry.py index 11a4527..60486df 100644 --- a/gdrivefs/gdtool/normal_entry.py +++ b/gdrivefs/gdtool/normal_entry.py @@ -213,7 +213,7 @@ def __convert(self, data): return data def get_data(self): - original = dict([(key.encode('ASCII'), value) + original = dict([(key.encode('utf8'), value) for key, value in self.__raw_data.iteritems()])