That was a “fun” debugging session…

  • IsoKiero@sopuli.xyz
    link
    fedilink
    English
    arrow-up
    1
    ·
    6 days ago

    Since no one has yet mentioned, by default if you’re running tar as a non-root user it extracts files with owner/umask of the current user and if you run it as root (or superuser) it’ll preserve ownership and permissions. From tar man page:

    –no-same-owner

    Extract files as yourself (default for ordinary users).

    –no-same-permissions

    Apply the user’s umask when extracting permissions from the archive (default for ordinary users).

    As mentioned, with root the defaults are to keep UID/permissions as they are in the archive. (–preserve-permissions and --same-owner).

  • tetris11@lemmy.ml
    link
    fedilink
    arrow-up
    1
    ·
    7 days ago

    Just bear in mind that uid 1001 on one machine is not generally uid 1001 on another, and that if you copy the tar off machine you’re more than likely giving permission to somebody other than the intended target