4
submitted 3 months ago by lorty@lemmy.ml to c/linux@lemmy.ml

That was a "fun" debugging session...

top 6 comments
sorted by: hot top controversial new old
[-] cmnybo@discuss.tchncs.de 3 points 3 months ago

That's what an archiving program is supposed to do.

[-] Lemmchen@feddit.org 2 points 2 months ago

That's a feature, not a bug. It's an archive after all.

[-] syklemil@discuss.tchncs.de 1 points 2 months ago

It's even a tape archiving tool. Just pretty much nobody uses it in the original way any more.

Very much one of those "if it ain't broke, don't replace it" tools.

[-] lorty@lemmy.ml 1 points 2 months ago

I just assumed that whenever it would be expanded that the contents would have the default permissions for that user.

It's actually a cool feature I just feel dumb for how long it took me to realize this was the issue.

[-] IsoKiero@sopuli.xyz 2 points 2 months ago* (last edited 2 months 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 1 points 2 months ago* (last edited 2 months 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

this post was submitted on 16 Sep 2025
4 points (100.0% liked)

Linux

57274 readers
690 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 6 years ago
MODERATORS