提交 39c0ca78 编写于 作者: O openeuler-ci-bot 提交者: Gitee

!3 make log file permissions more restrictive

Merge pull request !3 from wangkang101/master
...@@ -30,7 +30,7 @@ bin: bep ...@@ -30,7 +30,7 @@ bin: bep
.PHONY: install .PHONY: install
install: install:
install -m 0750 ./bin/isula-transform /usr/bin/isula-transform install -m 0550 ./bin/isula-transform /usr/bin/isula-transform
.PHONY: binclean .PHONY: binclean
binclean: binclean:
......
...@@ -32,7 +32,7 @@ require ( ...@@ -32,7 +32,7 @@ require (
google.golang.org/grpc v1.29.0 google.golang.org/grpc v1.29.0
google.golang.org/protobuf v1.21.0 google.golang.org/protobuf v1.21.0
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/natefinch/lumberjack.v2 v2.0.1-0.20190411184413-94d9e492cc53
gotest.tools v2.2.0+incompatible // indirect gotest.tools v2.2.0+incompatible // indirect
) )
......
...@@ -161,6 +161,8 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33 ...@@ -161,6 +161,8 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8=
gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/natefinch/lumberjack.v2 v2.0.1-0.20190411184413-94d9e492cc53 h1:3sU6EgF8Xi+t59u4g5ALV5dHlPMujDJ1EtnRtGJ7W4E=
gopkg.in/natefinch/lumberjack.v2 v2.0.1-0.20190411184413-94d9e492cc53/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k=
gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo= gotest.tools v2.2.0+incompatible h1:VsBPFP1AI068pPrMxtb/S8Zkgf9xEmTLJjfM+P5UIEo=
......
...@@ -513,7 +513,7 @@ License: BSD-2-Clause ...@@ -513,7 +513,7 @@ License: BSD-2-Clause
Please see above. Please see above.
Software: Software:
gopkg.in/natefinch/lumberjack.v2 v2.0.0 gopkg.in/natefinch/lumberjack.v2 v2.0.1-0.20190411184413-94d9e492cc53
Copyright notice: Copyright notice:
Copyright (c) 2014 Nate Finch Copyright (c) 2014 Nate Finch
License: MIT License: MIT
......
...@@ -206,13 +206,13 @@ func (l *Logger) rotate() error { ...@@ -206,13 +206,13 @@ func (l *Logger) rotate() error {
// openNew opens a new log file for writing, moving any old log file out of the // openNew opens a new log file for writing, moving any old log file out of the
// way. This methods assumes the file has already been closed. // way. This methods assumes the file has already been closed.
func (l *Logger) openNew() error { func (l *Logger) openNew() error {
err := os.MkdirAll(l.dir(), 0744) err := os.MkdirAll(l.dir(), 0755)
if err != nil { if err != nil {
return fmt.Errorf("can't make directories for new logfile: %s", err) return fmt.Errorf("can't make directories for new logfile: %s", err)
} }
name := l.filename() name := l.filename()
mode := os.FileMode(0644) mode := os.FileMode(0600)
info, err := os_Stat(name) info, err := os_Stat(name)
if err == nil { if err == nil {
// Copy the mode off the old logfile. // Copy the mode off the old logfile.
...@@ -288,7 +288,7 @@ func (l *Logger) openExistingOrNew(writeLen int) error { ...@@ -288,7 +288,7 @@ func (l *Logger) openExistingOrNew(writeLen int) error {
return nil return nil
} }
// genFilename generates the name of the logfile from the current time. // filename generates the name of the logfile from the current time.
func (l *Logger) filename() string { func (l *Logger) filename() string {
if l.Filename != "" { if l.Filename != "" {
return l.Filename return l.Filename
......
...@@ -170,5 +170,5 @@ google.golang.org/protobuf/runtime/protoimpl ...@@ -170,5 +170,5 @@ google.golang.org/protobuf/runtime/protoimpl
google.golang.org/protobuf/types/known/anypb google.golang.org/protobuf/types/known/anypb
google.golang.org/protobuf/types/known/durationpb google.golang.org/protobuf/types/known/durationpb
google.golang.org/protobuf/types/known/timestamppb google.golang.org/protobuf/types/known/timestamppb
# gopkg.in/natefinch/lumberjack.v2 v2.0.0 # gopkg.in/natefinch/lumberjack.v2 v2.0.1-0.20190411184413-94d9e492cc53
gopkg.in/natefinch/lumberjack.v2 gopkg.in/natefinch/lumberjack.v2
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册