From bcd628fa6bcf7fedc64752c4bae26e08afe73c9f Mon Sep 17 00:00:00 2001 From: Catherine Date: Sat, 4 Apr 2026 01:17:02 +0000 Subject: [PATCH] Allow `Chmod()` in `PutBlob()` to fail with `-EPERM`. This can happen on an NFSv4 filesystem with POSIX permissions disabled. Fixes #131. --- src/backend_fs.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/backend_fs.go b/src/backend_fs.go index a7f886b..8d1c2b9 100644 --- a/src/backend_fs.go +++ b/src/backend_fs.go @@ -152,7 +152,13 @@ func (fs *FSBackend) PutBlob(ctx context.Context, name string, data []byte) erro } if err := fs.blobRoot.Chmod(tempPath, 0o444); err != nil { - return fmt.Errorf("chmod: %w", err) + if errors.Is(err, os.ErrPermission) { + // NFSv4 configured with ACLs doesn't have a working `chmod` even though it's a Unix + // system. This `chmod` call is done entirely for convenience (to help the system + // administrator avoid accidentally overwriting files), so just skip it. + } else { + return fmt.Errorf("chmod: %w", err) + } } again: