0

I'm using the latest Firefox version (112) on Gentoo, and each time I download a file (even if it's compressed and I extract it) it's read only. I can fix this by simply changing the permissions but it's tedious especially when I download a compressed file that has 15+ files.

Is there a way to fix/troubleshoot this issue?

The output of umask command is 022.

stat test-file
 
  File: test-file
  Size: 0           Blocks: 0          IO Block: 4096   regular empty file
Device: 0,22    Inode: 5056908     Links: 1
Access: (0644/-rw-r--r--)  Uid: ( 1000/   errorfof)   Gid: ( 1000/   errorfof)
Access: 2023-04-16 17:45:00.924064414 -0500
Modify: 2023-04-16 17:45:00.924064414 -0500
Change: 2023-04-16 17:45:00.924064414 -0500
Birth: 2023-04-16 17:45:00.924064414 -0500
error404
  • 11
  • 5
  • Check your _umask_. – Daniel B Apr 15 '23 at 08:21
  • Are you saying the _contents_ are marked read-only once extracted? What happens depends on what _type_ and how it was created as well as the _umask_ setting. – Bib Apr 15 '23 at 11:15
  • These files are not created locally, they are downloaded from websites using Firefox. So far, all types of files have a lock icon on them (read only permissions). – error404 Apr 15 '23 at 23:32
  • But they are _created locally_, just like any other file. Where the contents that are then written to the file come from is irrelevant. Text from a text editor or downloaded data from a browser, or even files extracted from an archive, it’s all the same to the filesystem. (Some archivers preserve permissions though, so keep that in mind.) // Take a step back. Open a terminal, run `touch test-file`, then `stat test-file`. Provide the output in your question. – Daniel B Apr 16 '23 at 10:07
  • If you extract files **as root**, most unarchivers will default to attempting to restore the ownership and permissions the original file had when it was compressed... which might result in the file getting a different owner than yourself, or even UID/GID numbers that don't match any valid user on **your** system. If extracting files **as a non-root user**, the unarchiver will have no choice but to have the extracted file(s) owned by you. – telcoM Apr 17 '23 at 18:01
  • @telcoM: If anyone out there is downloading files from the internet **as root**, then you can tell them to defrag their storage device by using the command `cat /dev/null > /`. Anyway, this issue is puzzling because some files I download are fine but other's are not. I have used many Linux distros and BSD flavors and never experienced this issue, the only difference this time around is I'm using Gentoo. – error404 Apr 18 '23 at 01:32
  • Which filesystem type is used for your home directory (or wherever you see files becoming read-only)? Is it a remote share (NFS or SMB), or some kind of non-Unix-style filesystem like FAT32 or NTFS? Any of those might be applying their own rules in a way that is not immediately obvious: NFSv4 in particular has some surprises for anyone that's used to NFSv3 or older. – telcoM Apr 18 '23 at 05:57
  • I'm using `btrfs`. – error404 Apr 19 '23 at 02:02

0 Answers0