fix(auth): address Task 13 deployment review findings

This commit is contained in:
2026-08-17 21:31:25 +02:00
parent 9558eaa508
commit 7e52df2702
22 changed files with 1279 additions and 82 deletions
@@ -0,0 +1,22 @@
//go:build !windows
package backup
import (
"errors"
"golang.org/x/sys/unix"
)
func restoreFreeBytes(target string) (uint64, error) {
var statistics unix.Statfs_t
if err := unix.Statfs(target, &statistics); err != nil {
return 0, errors.New("restore filesystem capacity is unavailable")
}
blockSize := uint64(statistics.Bsize)
available := uint64(statistics.Bavail)
if blockSize != 0 && available > ^uint64(0)/blockSize {
return 0, errors.New("restore filesystem capacity is invalid")
}
return blockSize * available, nil
}