From f460a2f14505341979f6b8b27ceed9d5e6ed77b4 Mon Sep 17 00:00:00 2001 From: Tanner Collin Date: Sun, 8 Oct 2017 15:30:46 -0600 Subject: [PATCH] Disallow creation of hidden files --- sn_fuse.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sn_fuse.py b/sn_fuse.py index eec0b8e..1830fe9 100644 --- a/sn_fuse.py +++ b/sn_fuse.py @@ -81,6 +81,11 @@ class StandardNotesFUSE(LoggingMixIn, Operations): def create(self, path, mode): path_parts = path.split('/') note_name = path_parts[1] + + # disallow hidden files (usually editor / OS files) + if note_name[0] == '.': + raise FuseOSError(errno.EPERM) + now = datetime.utcnow().isoformat()[:-3] + 'Z' # hack self.item_manager.createNote(note_name, now)