Skip to content

Commit d9d6bd2

Browse files
committed
Never retain ownership during installation
By default, tar will retain ownership when run as root. Even if built as a user, the install phase should not install binaries owned by that user. To suppress this, we pass `--no-same-owner` to tar. While at it, I made it use the `TAR` environment variable during installation as well. Signed-off-by: Dan Villiom Podlaski Christiansen <[email protected]>
1 parent 45c727f commit d9d6bd2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ docs/lima-sequence-diagram.png: docs/images/lima-sequence-diagram.puml
209209
install: uninstall
210210
mkdir -p "$(DEST)"
211211
# Use tar rather than cp, for better symlink handling
212-
( cd _output && tar c * | tar Cxv "$(DEST)" )
212+
( cd _output && $(TAR) c * | $(TAR) -xv --no-same-owner -C "$(DEST)" )
213213
if [ "$(shell uname -s )" != "Linux" -a ! -e "$(DEST)/bin/nerdctl" ]; then ln -sf nerdctl.lima "$(DEST)/bin/nerdctl"; fi
214214
if [ "$(shell uname -s )" != "Linux" -a ! -e "$(DEST)/bin/apptainer" ]; then ln -sf apptainer.lima "$(DEST)/bin/apptainer"; fi
215215

0 commit comments

Comments
 (0)