From 09875fe1603307080f3a4172985c5dca3bd9912d Mon Sep 17 00:00:00 2001 From: Duco van Amstel Date: Sun, 18 Nov 2018 17:55:05 +0000 Subject: Update direct dependencies where possible --- .../gopkg.in/natefinch/lumberjack.v2/chown_linux.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go (limited to 'vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go') diff --git a/vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go b/vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go new file mode 100644 index 00000000..2758ec9c --- /dev/null +++ b/vendor/gopkg.in/natefinch/lumberjack.v2/chown_linux.go @@ -0,0 +1,19 @@ +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)) +} -- cgit v1.2.3