-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from chrissawer/zip-permissions-fixes
Zip permissions fixes
- Loading branch information
Showing
11 changed files
with
180 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
big.tar.gz | ||
big.zip | ||
|
||
filesbeforedirectories.zip |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build !windows | ||
|
||
package extract_test | ||
|
||
import "golang.org/x/sys/unix" | ||
|
||
func UnixUmaskZero() int { | ||
return unix.Umask(0) | ||
} | ||
|
||
func UnixUmask(userUmask int) { | ||
unix.Umask(userUmask) | ||
} | ||
|
||
func OsFilePerms(unixPerms uint64) uint64 { | ||
return unixPerms | ||
} | ||
|
||
func OsDirPerms(unixPerms uint64) uint64 { | ||
return unixPerms | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
//go:build windows | ||
|
||
package extract_test | ||
|
||
func UnixUmaskZero() int { | ||
return 0 | ||
} | ||
|
||
func UnixUmask(userUmask int) { | ||
} | ||
|
||
func OsFilePerms(unixPerms uint64) uint64 { | ||
// Go on Windows just uses 666/444 for files depending on whether "read only" is set | ||
globalPerms := unixPerms >> 6 | ||
return globalPerms | (globalPerms << 3) | (globalPerms << 6) | ||
} | ||
|
||
func OsDirPerms(unixPerms uint64) uint64 { | ||
// Go on Windows just uses 777 for directories | ||
return 0777 | ||
} |