Skip to content

Commit 8629d27

Browse files
committed
refactor: Update directory permissions to 0700 for enhanced security in download functions
1 parent 6d172fe commit 8629d27

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

internal/downloader/downloader.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,7 +750,7 @@ func (d *EpisodeDownloader) downloadM3U8WithYtDlp(videoURL, destPath string, pro
750750
program.Send(statusMsg("Starting yt-dlp download (using go-ytdlp library)..."))
751751

752752
// Create directory if it doesn't exist
753-
if err := os.MkdirAll(filepath.Dir(destPath), 0755); err != nil {
753+
if err := os.MkdirAll(filepath.Dir(destPath), 0700); err != nil {
754754
return fmt.Errorf("failed to create directory: %w", err)
755755
}
756756

@@ -841,7 +841,7 @@ func (d *EpisodeDownloader) downloadM3U8WithYtDlp(videoURL, destPath string, pro
841841

842842
func (d *EpisodeDownloader) downloadWithYtDlp(url, path string) error {
843843
// Create directory if it doesn't exist
844-
if err := os.MkdirAll(filepath.Dir(path), 0755); err != nil {
844+
if err := os.MkdirAll(filepath.Dir(path), 0700); err != nil {
845845
return fmt.Errorf("failed to create directory: %w", err)
846846
}
847847

0 commit comments

Comments
 (0)