From f4f6855c61150282295ec0b10233d9b1585153e3 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Tue, 6 Sep 2022 20:20:23 +0500 Subject: [PATCH] avoid SIGSEGV on localFilerSocket (#3609) https://github.com/seaweedfs/seaweedfs/issues/3607 --- weed/command/s3.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/weed/command/s3.go b/weed/command/s3.go index d69ac214c..33dc7482a 100644 --- a/weed/command/s3.go +++ b/weed/command/s3.go @@ -184,7 +184,10 @@ func (s3opt *S3Options) startS3Server() bool { go stats_collect.LoopPushingMetric("s3", stats_collect.SourceName(uint32(*s3opt.port)), metricsAddress, metricsIntervalSec) router := mux.NewRouter().SkipClean(true) - + var localFilerSocket string + if s3opt.localFilerSocket != nil { + localFilerSocket = *s3opt.localFilerSocket + } s3ApiServer, s3ApiServer_err := s3api.NewS3ApiServer(router, &s3api.S3ApiServerOption{ Filer: filerAddress, Port: *s3opt.port, @@ -194,7 +197,7 @@ func (s3opt *S3Options) startS3Server() bool { GrpcDialOption: grpcDialOption, AllowEmptyFolder: *s3opt.allowEmptyFolder, AllowDeleteBucketNotEmpty: *s3opt.allowDeleteBucketNotEmpty, - LocalFilerSocket: *s3opt.localFilerSocket, + LocalFilerSocket: localFilerSocket, DataCenter: *s3opt.dataCenter, }) if s3ApiServer_err != nil {