diff --git a/doc/bookmarkfs.texi b/doc/bookmarkfs.texi index 040b713..24de643 100644 --- a/doc/bookmarkfs.texi +++ b/doc/bookmarkfs.texi @@ -291,6 +291,8 @@ a trailing newline is automatically removed (if one exists). Max file size limit. Defaults to @t{32768}. +This limit also applies to extended attribute values. + @item -o no_sandbox Do not enable sandboxing features (@pxref{Sandboxing}). diff --git a/src/fs_ops.c b/src/fs_ops.c index cc0e44e..72ddec2 100644 --- a/src/fs_ops.c +++ b/src/fs_ops.c @@ -2350,7 +2350,11 @@ fs_op_setxattr ( size_t val_len, int UNUSED_VAR(flags) ) { - int status = -ENOATTR; + int status = -ERANGE; + if (val_len > ctx.file_max) { + goto end; + } + status = -ENOATTR; switch (INODE_SUBSYS_TYPE(ino)) { case SUBSYS_TYPE_BOOKMARK: @@ -2358,6 +2362,7 @@ fs_op_setxattr ( break; } + end: send_reply(err, req, -status); }