Skip to content

Infer ownership of _all_ unpacked files (like cacache does for cache) #2

@isaacs

Description

@isaacs

As originally reported in https://github.com/zkat/pacote/issues/175, pacote will leave user-owned files in the global (typically root-owned) install space. This is arguably much less bad than leaving root-owned files in ~, but still not ideal.

Proposal:

  • abstract out the infer-owner.js util from cacache into its own module.
  • Infer ownership of all files that pacote unpacks.
  • Drop the uid or gid option entirely.

Thereafter, installing in a root-owned prefix will produce root-owned files. (Or fail with EACCES if the user doesn't have permission to write there.) Installing in a user-owned folder will produce user-owned files. No config juggling or baton-passing required. (Well, Pacote will have to infer the ownership and then pass the uid/gid configs to tar, but that seems pretty reasonable.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions