Giter Club home page Giter Club logo

Comments (6)

junegunn avatar junegunn commented on May 28, 2024

Currently, I need a post-installation step to correct this

Can you show the exact steps, and how things look before and after the steps?

What do you think?

Maybe. We can use the options if

  1. either when gtar is available on then system
  2. or when $TAR | grep -qF no-same-owner succeeds

FWIW, these days I don't think install script is that important, because most users just use a package manager (brew on macOS), and because the binary now embeds the shell integration scripts (but not fzf-tmux though).

from fzf.

rseichter avatar rseichter commented on May 28, 2024

My post-installation steps consist of forcibly changing attributes via Ansible. I don't have the playbook at hand right now, but here is what things look like immediately after a fresh Fzf installation:

❯ ls -ln /usr/local/bin
total 4.7M
-rwxr-xr-x 1 501 50 3.5M May  1 05:36 fzf*
-rwxr-xr-x 1   0  0 1.2M May  6 18:57 zoxide*

Non-root-owned executables in /usr/local/bin obviously pose a security risk. In bash, the step to fix things would be simply chown root:root /usr/local/bin/fzf.

As for the importance of install.sh versus package managers, I'll just say it depends. Multi-platform provisioning using tools like Ansible has its perks, and package names vary across platforms, while /usr/local/bin can usually be relied on.

Regarding the implementation, I guess this would work:

tar --no-same-owner --no-xattrs -xf foo.tar || tar -xf foo.tar

from fzf.

junegunn avatar junegunn commented on May 28, 2024

Regarding the implementation, I guess this would work:

tar --no-same-owner --no-xattrs -xf foo.tar || tar -xf foo.tar

We're currently using tar with the standard input pipe (curl -fL $1 | tar -xzf -), so I don't think || trick will do unless we change it to save to a temporary file.

from fzf.

junegunn avatar junegunn commented on May 28, 2024

Looks like tar of macOS Sonoma understands --no-same-owner and --no-xattrs, so we can just add it?

By the way, why do we need --no-xattrs?

from fzf.

rseichter avatar rseichter commented on May 28, 2024

Explicitly disabling support for extended file attributes is merely another precaution against possible surprises. GNU Tar behaves like this by default, but I am uncertain about other platforms.

I guess that considering the peculiarities of different tar implementations goes to show how old I have become. These things really mattered, back in the day. 😉

In any case, thank you for the update, that was quick indeed.

from fzf.

junegunn avatar junegunn commented on May 28, 2024

No problem. Thanks for the explanation. Let's see if anyone complains.

from fzf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.