You are not logged in.
Well, I somehow managed chmod my /etc/resolv.conf so that not even when su-ing root can I delete / chmod / chown it. Any ideas?
Last edited by underpenguin (2008-01-17 19:19:02)
Offline
who owns it? ls -l /etc/resolv.conf
Offline
4 -rw-r--r-- 1 root root 68 2008-01-04 21:23 /etc/resolv.conf
Last edited by underpenguin (2008-01-16 20:01:42)
Offline
Those perms are fine - what about /etc? ls -ld /etc
Are you using ACLs?
Offline
drwxr-xr-x 61 root root 4096 2008-01-16 13:42 /etc
(my problem is that my internet is super slow, issues with dorm 'net, so it takes me like 5 min to refresh/google etc)
acl is a filesystem? I'm not that I know of.
Offline
ACLs are access control lists - it's another way to specify permissions. You're probably not using them if you don't know what they are.
What's the exact output trying to chmod /etc/resolv.conf as root?
Offline
$ su
Password:
# chmod 777 resolv.conf
chmod: changing permissions of `resolv.conf': Operation not permitted
Offline
can you edit the file?
the perms are fine, why do you want to change them? but the fact that you cant change them as root is quite strange.
Offline
I know, its really wierd, I have no idea how I did it. I can open/read the file but I can't write to it. And a touch'ed a test file in /etc/ just to make sure it would work, and it did.
Offline
can you chmod the touch'ed file? What're the perms on chmod?
Offline
[ben@hoth ~]$ ls -la `which chmod`
-rwxr-xr-x 1 root root 39376 2007-11-15 10:13 /bin/chmod
[ben@hoth ~]$ touch /etc/test
touch: cannot touch `/etc/test': Permission denied
[ben@hoth ~]$ sudo touch /etc/test
[ben@hoth ~]$ sudo chmod 777 /etc/test
[ben@hoth ~]$ ls -la /etc/test
-rwxrwxrwx 1 root root 0 2008-01-17 09:35 /etc/test
[ben@hoth ~]$ ls -la /etc/resolv.conf
-rw-r--r-- 1 root root 68 2008-01-04 21:23 /etc/resolv.conf
Offline
... well I'm totally baffled.
Offline
Ha, well, thank you for your help. Maybe another l33t hax0r will come by and help
Offline
Just a quickshot: make sure the file /etc/resolv.conf is not opened by any program/process. You can use the lsof utility (pacman -S lsof) to see all opened files. Just run lsof | grep /etc/resolv.conf to see whether the file is opened by some program or not..
-m.
What happened to Arch's KISS? systemd sure is stupid but I must have missed the simple part ...
... and who is general Failure and why is he reading my harddisk?
Offline
Woah. What filesystem do you have? I can think of two possible things here.
a) Your FS is mounted read only
b) You set file attributes to block you from deleting it (such as ext2/3's immutable bit)
Offline
Can you try the following commands as root??
lsattr /etc/resolv.conf # will show you what special attributes are set.
If you see an i or an a surrounded by hyphens, run the respective command:
chattr -i /etc/resolv.conf
chattr -a /etc/resolv.conf
Thank you, and please come again.
Offline
Wow. Phrakture was right (and thanks for saving me the googlin' to find out how to fix it codemac). I probably did that while trying to get various programs from editing it (wanted to use static dns). Thank you very much everyone.
Offline
Huh - cool. I wasn't even aware of chattr. I fail.
Offline
Well, I guess you do learn something new every day. And by you I mean me and Cerebral.
Offline
Wow. Phrakture was right
Pff, this surprises you?!
Hah, kidding!
Offline
underpenguin wrote:Wow. Phrakture was right
Pff, this surprises you?!
Hah, kidding!
LMAO!
Offline
Huh - cool. I wasn't even aware of chattr. I fail.
I didn't know about this either. And thanks to this thread, I can now fix what I am about to break playing around with it!
Offline
Cerebral wrote:Huh - cool. I wasn't even aware of chattr. I fail.
I didn't know about this either. And thanks to this thread, I can now fix what I am about to break playing around with it!
There's a long standing pacman bug regarding "immutable files". It's a chattr thing. I can't recall all the details, but basically the only way to change an immutable file (even as root) is to get rid of the immutable bit first. It's scary
Offline