From e2d477cde4e87d13ebc6b99e7f95022f75ca075e Mon Sep 17 00:00:00 2001 From: yyykt <38282449+yyykt@users.noreply.github.com> Date: Wed, 3 Jan 2024 08:40:17 +0900 Subject: [PATCH] fix: tar permissions when `ziextract` ran as root user (#557) --- zinit-install.zsh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zinit-install.zsh b/zinit-install.zsh index b53408dea..e3c1db669 100644 --- a/zinit-install.zsh +++ b/zinit-install.zsh @@ -1719,19 +1719,19 @@ ziextract() { →zinit-extract() { →zinit-check unrar "$file" || return 1; command unrar x "$file"; } ;; ((#i)*.tar.bz2|(#i)*.tbz|(#i)*.tbz2) - →zinit-extract() { →zinit-check bzip2 "$file" || return 1; command bzip2 -dc "$file" | command tar -xf -; } + →zinit-extract() { →zinit-check bzip2 "$file" || return 1; command bzip2 -dc "$file" | command tar --no-same-owner -xf -; } ;; ((#i)*.tar.gz|(#i)*.tgz) - →zinit-extract() { →zinit-check gzip "$file" || return 1; command gzip -dc "$file" | command tar -xf -; } + →zinit-extract() { →zinit-check gzip "$file" || return 1; command gzip -dc "$file" | command tar --no-same-owner -xf -; } ;; ((#i)*.tar.xz|(#i)*.txz) - →zinit-extract() { →zinit-check xz "$file" || return 1; command xz -dc "$file" | command tar -xf -; } + →zinit-extract() { →zinit-check xz "$file" || return 1; command xz -dc "$file" | command tar --no-same-owner -xf -; } ;; ((#i)*.tar.7z|(#i)*.t7z) - →zinit-extract() { →zinit-check 7z "$file" || return 1; command 7z x -so "$file" | command tar -xf -; } + →zinit-extract() { →zinit-check 7z "$file" || return 1; command 7z x -so "$file" | command tar --no-same-owner -xf -; } ;; ((#i)*.tar) - →zinit-extract() { →zinit-check tar "$file" || return 1; command tar -xf "$file"; } + →zinit-extract() { →zinit-check tar "$file" || return 1; command tar --no-same-owner -xf "$file"; } ;; ((#i)*.gz|(#i)*.gzip) if [[ $file != (#i)*.gz ]] {