Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbb2007c

Browse files
committed
Set correct permissions when downloading tool
The extraction of some tools failed because the parent folder ofsome files wasn't created with useful permissions.Here we correctly set the permission such as the folder hasexec and write permission for the current user
1 parenta064c29 commitbb2007c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

‎tools/download.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,8 @@ func extractTarGz(body []byte, location string) (string, error) {
423423
info:=header.FileInfo()
424424

425425
// Create parent folder
426-
iferr=os.MkdirAll(filepath.Dir(path),info.Mode());err!=nil {
426+
dirmode:=info.Mode()|os.ModeDir|0700
427+
iferr=os.MkdirAll(filepath.Dir(path),dirmode);err!=nil {
427428
returnlocation,err
428429
}
429430

@@ -514,6 +515,12 @@ func extractBz2(body []byte, location string) (string, error) {
514515
path:=filepath.Join(location,strings.Replace(header.Name,basedir,"",-1))
515516
info:=header.FileInfo()
516517

518+
// Create parent folder
519+
dirmode:=info.Mode()|os.ModeDir|0700
520+
iferr=os.MkdirAll(filepath.Dir(path),dirmode);err!=nil {
521+
returnlocation,err
522+
}
523+
517524
ifinfo.IsDir() {
518525
iferr=os.MkdirAll(path,info.Mode());err!=nil {
519526
returnlocation,err

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp