mirror of
https://codeberg.org/git-pages/git-pages.git
synced 2026-05-14 11:11:35 +00:00
Allow Chmod() in PutBlob() to fail with -EPERM.
This can happen on an NFSv4 filesystem with POSIX permissions disabled. Fixes #131.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user