Skip to content

Commit

Permalink
Update backup_s3.go
Browse files Browse the repository at this point in the history
  • Loading branch information
RMartinOscar authored Jul 12, 2024
1 parent d411477 commit 2d399dc
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions server/backup/backup_s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"io"
"net/http"
"os"
"path/filepath"
"strconv"
"time"

Expand Down Expand Up @@ -58,6 +59,12 @@ func (s *S3Backup) Generate(ctx context.Context, fsys *filesystem.Filesystem, ig
}

s.log().WithField("path", s.Path()).Info("creating backup for server")
if _, err := os.Stat(filepath.Dir(s.Path())); os.IsNotExist(err) {

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
err := os.Mkdir(filepath.Dir(s.Path()), 0o700)

Check failure

Code scanning / CodeQL

Uncontrolled data used in path expression High

This path depends on a
user-provided value
.
if err != nil {
return nil, err
}
}
if err := a.Create(ctx, s.Path()); err != nil {
return nil, err
}
Expand Down

0 comments on commit 2d399dc

Please sign in to comment.