Skip to content

node-tar pack should allow the uid+gid to be overwritten #39

@dnwe

Description

@dnwe

A common use case when creating a tar is to override the source filesystem uid+gid with 0:0 when creating the tar entries, so that when the tar is extracted by a root user it will correctly be written with root:root as the owner/group, rather than inheriting the uid+gid stored with the .tgz

e.g.,

$ tar -zcv --owner=root --group=root --numeric-owner -f /tmp/filename.tgz package/
$ cd /tmp && sudo tar -zxf /tmp/filename.tgz
$ ls -l package/*
-rw-r--r-- 1 root root package/package.json
etc.

Currently if I create a tar using node-tar and distribute it to someone who untars it as root, the files will be written with whatever uid/gid my user happens to have on the machine on which I created the tar

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions