Pull request: all: rework file perms
Updates #3198. Squashed commit of the following: commit 3de1ecf4535220cdd769100ef0ea96c166419d12 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri May 28 18:39:52 2021 +0300 all: imp chlog commit f1a46efed917c9b70f047505449a816284d7c71e Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri May 28 18:13:55 2021 +0300 all: rework file perms
This commit is contained in:
@@ -332,7 +332,7 @@ func tarGzFileUnpackOne(outDir string, tr *tar.Reader, hdr *tar.Header) (name st
|
||||
return "", nil
|
||||
}
|
||||
|
||||
err = os.Mkdir(outputName, os.FileMode(hdr.Mode&0o777))
|
||||
err = os.Mkdir(outputName, os.FileMode(hdr.Mode&0o755))
|
||||
if err != nil && !errors.Is(err, os.ErrExist) {
|
||||
return "", fmt.Errorf("os.Mkdir(%q): %w", outputName, err)
|
||||
}
|
||||
@@ -352,7 +352,7 @@ func tarGzFileUnpackOne(outDir string, tr *tar.Reader, hdr *tar.Header) (name st
|
||||
wc, err = os.OpenFile(
|
||||
outputName,
|
||||
os.O_WRONLY|os.O_CREATE|os.O_TRUNC,
|
||||
os.FileMode(hdr.Mode&0o777),
|
||||
os.FileMode(hdr.Mode&0o755),
|
||||
)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("os.OpenFile(%s): %w", outputName, err)
|
||||
|
||||
Reference in New Issue
Block a user