Log info message when unable to chown file #1521

This commit is contained in:
Mike Farah 2023-01-15 11:36:52 +11:00
parent ec40a1a08a
commit 473be23153
2 changed files with 12 additions and 1 deletions

View File

@ -12,7 +12,14 @@ func changeOwner(info fs.FileInfo, file *os.File) error {
if stat, ok := info.Sys().(*syscall.Stat_t); ok { if stat, ok := info.Sys().(*syscall.Stat_t); ok {
uid := int(stat.Uid) uid := int(stat.Uid)
gid := int(stat.Gid) gid := int(stat.Gid)
return os.Chown(file.Name(), uid, gid)
err := os.Chown(file.Name(), uid, gid)
if err != nil {
// this happens with snap confinement
// not really a big issue as users can chown
// the file themselves if required.
log.Info("Skipping chown: %v", err)
}
} }
return nil return nil
} }

View File

@ -1,3 +1,7 @@
4.30.8:
- Log info message when unable to chown file in linux (e.g. snap confinement) #1521
4.30.7: 4.30.7:
- Fixed bug in splice operator #1511 - Fixed bug in splice operator #1511
- Fixed value operator bug #1515 - Fixed value operator bug #1515