fix filemode in tests (#28)
This fixes #20 by using a more restrictive filemode during tests.
This commit is contained in:
+1
-1
@@ -15,7 +15,7 @@ func TestMaintainMode(t *testing.T) {
|
|||||||
|
|
||||||
filename := logFile(dir)
|
filename := logFile(dir)
|
||||||
|
|
||||||
mode := os.FileMode(0770)
|
mode := os.FileMode(0600)
|
||||||
f, err := os.OpenFile(filename, os.O_CREATE|os.O_RDWR, mode)
|
f, err := os.OpenFile(filename, os.O_CREATE|os.O_RDWR, mode)
|
||||||
isNil(err, t)
|
isNil(err, t)
|
||||||
f.Close()
|
f.Close()
|
||||||
|
|||||||
+1
-1
@@ -635,7 +635,7 @@ localtime = true`[1:]
|
|||||||
func makeTempDir(name string, t testing.TB) string {
|
func makeTempDir(name string, t testing.TB) string {
|
||||||
dir := time.Now().Format(name + backupTimeFormat)
|
dir := time.Now().Format(name + backupTimeFormat)
|
||||||
dir = filepath.Join(os.TempDir(), dir)
|
dir = filepath.Join(os.TempDir(), dir)
|
||||||
isNilUp(os.Mkdir(dir, 0777), t, 1)
|
isNilUp(os.Mkdir(dir, 0700), t, 1)
|
||||||
return dir
|
return dir
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user