You are not logged in.

#1 2018-02-17 13:46:36

eleius
Member
Registered: 2017-04-25
Posts: 28

[SOLVED] Sudden permission issues with wget

I use a script to update various local files with the newer versions available online. Suddenly, after many months of use, today it stopped working.

Commands like:
sudo wget ftp://ftp.internic.net/domain/named.cache -O /usr/local/share/named
or
sudo wget https://svn.nmap.org/nmap/nmap-os-db -O /usr/share/nmap/nmap-os-db
fail with a "read-only file system" error, but if I create or edit the same outfile file with "sudo nano" it works.

Same thing with other folders in /usr or /etc. I fsck'ed the partition and there are no errors, nor it's mounted read-only (I can create or delete any file I want).

I noticed those root-owned folders have rwxr-xr-x permission so maybe that's the problem, but I installed Arch months ago and didn't touch permissions, so I don't know if either a recent update (via pacman) changed them, or if it's something else. Any idea?

Last edited by eleius (2018-02-17 16:11:32)

Offline

#2 2018-02-17 14:55:24

opt1mus
Member
From: UK
Registered: 2011-12-31
Posts: 212
Website

Re: [SOLVED] Sudden permission issues with wget

If you're sure it was today that it stopped working; then have a look at what's different, have you updated anything, or made changes to something? Check the pacman log to jog your memory.

Offline

#3 2018-02-17 15:03:32

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,863

Re: [SOLVED] Sudden permission issues with wget

mount
type wget
stat `which wget`

and you may want to strace the call (don't sudo strace, but run it as root. "sudo strace foo" won't work)

Offline

#4 2018-02-17 15:06:39

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: [SOLVED] Sudden permission issues with wget

...why are you running wget as root anyway.

Offline

#5 2018-02-17 15:10:16

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 78,863

Re: [SOLVED] Sudden permission issues with wget

Because he wants it to directly write into a root owned path.
Probably not the smartest of all approaches, but it shouldn't fail this way either.

Offline

#6 2018-02-17 16:09:58

eleius
Member
Registered: 2017-04-25
Posts: 28

Re: [SOLVED] Sudden permission issues with wget

seth wrote:
mount
type wget
stat `which wget`

$ stat `which wget`
File: /usr/local/bin/wget -> /usr/bin/firejail

Ah, that's the culprit! I recently installed firejail and it seems it also has a profile for wget.

Solved, thanks for your help!

Offline

#7 2018-02-17 16:17:59

eleius
Member
Registered: 2017-04-25
Posts: 28

Re: [SOLVED] Sudden permission issues with wget

graysky wrote:

...why are you running wget as root anyway.

You're right, now I changed it to wget to tmp and only use sudo to move the file to the destination directory.

Offline

Board footer

Powered by FluxBB