From f2fcb77808a72d3a62a0d922ee3fea8d878bf2ed Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Sun, 28 Feb 2021 16:20:47 -0800 Subject: [PATCH] local file sink: create backup files with permission 0755 --- weed/replication/sink/localsink/local_sink.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/replication/sink/localsink/local_sink.go b/weed/replication/sink/localsink/local_sink.go index c76647fcc..2b9b3e69a 100644 --- a/weed/replication/sink/localsink/local_sink.go +++ b/weed/replication/sink/localsink/local_sink.go @@ -78,13 +78,13 @@ func (localsink *LocalSink) CreateEntry(key string, entry *filer_pb.Entry, signa if _, err := os.Stat(dir); os.IsNotExist(err) { glog.V(4).Infof("Create Direcotry key: %s", dir) - if err = os.MkdirAll(dir, 0); err != nil { + if err = os.MkdirAll(dir, 0755); err != nil { return err } } writeFunc := func(data []byte) error { - writeErr := ioutil.WriteFile(key, data, 0) + writeErr := ioutil.WriteFile(key, data, 0755) return writeErr }