Cleanup lchmod logic in archive
Move to single lchmod interface mirroring other implementations. Separate logic for freebsd which supports symlink no follow flag. Signed-off-by: Derek McGowan <derek@mcg.dev>
This commit is contained in:
@@ -393,9 +393,8 @@ func createTarFile(ctx context.Context, path, extractDir string, hdr *tar.Header
|
||||
}
|
||||
}
|
||||
|
||||
// There is no LChmod, so ignore mode for symlink. Also, this
|
||||
// must happen after chown, as that can modify the file mode
|
||||
if err := handleLChmod(hdr, path, hdrInfo); err != nil {
|
||||
// call lchmod after lchown since lchown can modify the file mode
|
||||
if err := lchmod(path, hdrInfo.Mode()); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user