agendafs

A filesystem for your calendar.

git clone git://mccd.space/agendafs
commit f826e47cf5106cea57b3c46f90f35aa3936df377
parent c0dffa75be26e3ab1fdeec3a86afc1ca9d763ef1
Author: Marc Coquand <marc@coquand.email>
Date:   Fri, 27 Jun 2025 14:52:15 +0100

Impose 60kb limit

Implements: https://todo.sr.ht/~marcc/agendafs/13

Diffstat:
MREADME.md | 4++++
Mmain.c | 4++++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -50,6 +50,10 @@ See also [todo tracker](https://todo.sr.ht/~marcc/agendafs)
 
 Right now attachments are not supported, I don't quite know what happens if you store a file but the behavior is undefined.
 
+File content is limited to 60KB per note. This ensures that it can safely be
+uploaded and also stored as an xattribute (which is where we store descriptions
+for directories).
+
 ## Dependencies
 
 Some C compiler along with libfuse, libical and pkg-config.
diff --git a/main.c b/main.c
@@ -236,6 +236,10 @@ int
 journal_write(const char *path, const char *buf, size_t size, off_t offset,
 	      struct fuse_file_info *fi)
 {
+	if (size > 60 * 1024) {
+		return -EFBIG;
+	}
+
 	pthread_mutex_lock(&entries_mutex);
 	struct journal_entry *entry = get_entry_from_fuse_path(path);
 	if (!entry) {