mirror of
https://github.com/ceph/ceph-csi.git
synced 2024-11-25 07:40:19 +00:00
07b05616a0
Bumps [k8s.io/kubernetes](https://github.com/kubernetes/kubernetes) from 1.26.2 to 1.27.2. - [Release notes](https://github.com/kubernetes/kubernetes/releases) - [Commits](https://github.com/kubernetes/kubernetes/compare/v1.26.2...v1.27.2) --- updated-dependencies: - dependency-name: k8s.io/kubernetes dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
20 lines
396 B
Go
20 lines
396 B
Go
package lumberjack
|
|
|
|
import (
|
|
"os"
|
|
"syscall"
|
|
)
|
|
|
|
// os_Chown is a var so we can mock it out during tests.
|
|
var os_Chown = os.Chown
|
|
|
|
func chown(name string, info os.FileInfo) error {
|
|
f, err := os.OpenFile(name, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, info.Mode())
|
|
if err != nil {
|
|
return err
|
|
}
|
|
f.Close()
|
|
stat := info.Sys().(*syscall.Stat_t)
|
|
return os_Chown(name, int(stat.Uid), int(stat.Gid))
|
|
}
|