Skip to content

Possible bug in uid/gid value #40

@casatir

Description

@casatir

Environment

Typescript, Webpack, Browser.

Reproduction

tar -cpf home.tar ~/
tar --numeric-owner -tvf home.tar
console.log(parseTar(home));

Describe the bug

According to https://www.gnu.org/software/tar/manual/html_node/Standard.html, uid and gid are octal numbers encoded in ASCII.

const uid = Number.parseInt(_readString(buffer, offset + 108, 8));

Shouldn't it be

const uid = _readNumber(buffer, offset + 108, 8);

? Same for gid ?

A tar file created using GNU tar shows 1001/1001 with tar --numeric-owner -tvf and 1751/1751 with nanotar (0o1751 === 1001).

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions