From c80bd0992f0803d6f06f84a5290bc564c59b72fd Mon Sep 17 00:00:00 2001 From: Sujeily Fonseca Date: Sat, 9 Jul 2022 13:55:08 -0400 Subject: [PATCH] fix: Permissions for Argo CD repo server Fixed the directory permissions for the Argo CD repo server. Contributes to: automation-saas/native-AWS#2081 Signed-off-by: Sujeily Fonseca --- go.mod | 1 + go.sum | 3 --- reposerver/repository/repository.go | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 3278795372a03..4ee661e086540 100644 --- a/go.mod +++ b/go.mod @@ -252,6 +252,7 @@ replace ( github.com/Masterminds/goutils => github.com/Masterminds/goutils v1.1.1 // indirect github.com/docker/distribution => github.com/docker/distribution v2.8.1+incompatible // indirect github.com/prometheus/client_golang => github.com/prometheus/client_golang v1.12.2 + go.mongodb.org/mongo-driver => go.mongodb.org/mongo-driver v1.9.1 // indirect golang.org/x/crypto/ssh => golang.org/x/crypto/ssh v0.0.0-20220622213112-05595931fe9d golang.org/x/net => golang.org/x/net v0.0.0-20220708220712-1185a9018129 gopkg.in/square/go-jose.v2 => gopkg.in/square/go-jose.v2 v2.6.0 // indirect diff --git a/go.sum b/go.sum index ecdc5684ebf1e..143e9491293e7 100644 --- a/go.sum +++ b/go.sum @@ -1125,9 +1125,6 @@ go.etcd.io/etcd/client/v3 v3.5.0/go.mod h1:AIKXXVX/DQXtfTEqBryiLTUXwON+GuvO6Z7lL go.etcd.io/etcd/pkg/v3 v3.5.0/go.mod h1:UzJGatBQ1lXChBkQF0AuAtkRQMYnHubxAEYIrC3MSsE= go.etcd.io/etcd/raft/v3 v3.5.0/go.mod h1:UFOHSIvO/nKwd4lhkwabrTD3cqW5yVyYYf/KlD00Szc= go.etcd.io/etcd/server/v3 v3.5.0/go.mod h1:3Ah5ruV+M+7RZr0+Y/5mNLwC+eQlni+mQmOVdCRJoS4= -go.mongodb.org/mongo-driver v1.0.3/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.1/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= -go.mongodb.org/mongo-driver v1.1.2/go.mod h1:u7ryQJ+DOzQmeO7zB6MHyr8jkEQvC8vH7qLUO4lqsUM= go.mongodb.org/mongo-driver v1.9.1 h1:m078y9v7sBItkt1aaoe2YlvWEXcD263e1a4E1fBrJ1c= go.mongodb.org/mongo-driver v1.9.1/go.mod h1:0sQWfOeY63QTntERDJJ/0SuKK0T1uVSgKCuAROlKEPY= go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= diff --git a/reposerver/repository/repository.go b/reposerver/repository/repository.go index 3ffe8f3f9e0db..59e9fb0825a6a 100644 --- a/reposerver/repository/repository.go +++ b/reposerver/repository/repository.go @@ -1840,7 +1840,7 @@ func (s *Service) newHelmClientResolveRevision(repo *v1alpha1.Repository, revisi // a function that can be used to remove all permissions. func directoryPermissionInitializer(rootPath string) goio.Closer { if _, err := os.Stat(rootPath); err == nil { - if err := os.Chmod(rootPath, 0600); err != nil { + if err := os.Chmod(rootPath, 0700); err != nil { log.Warnf("Failed to restore read/write/execute permissions on %s: %v", rootPath, err) } else { log.Debugf("Successfully restored read/write/execute permissions on %s", rootPath)