Author Topic: Um, oops.  (Read 1227 times)

Paladin9

  • VIP
  • Member
  • ***
  • Posts: 696
  • Kudos: 263
Um, oops.
« on: 11 May 2004, 21:35 »
I fucked up the permissions on my linux machine.  Is there a way to reset the permissions or set them back to a previous state?  I am using slackware 9.1
_________________________________________________
 
To create a new standard, it takes something that's not just a little bit different; it takes something that's really new and really captures people's imagination

savet

  • Member
  • **
  • Posts: 52
  • Kudos: 228
Um, oops.
« Reply #1 on: 11 May 2004, 11:05 »
You can us chmod to set permissions on files and directories.

But it might help to know a little bit more about the problem.  Which permissions specifically?
You're just jealous cause the voices only talk to me...

Paladin9

  • VIP
  • Member
  • ***
  • Posts: 696
  • Kudos: 263
Um, oops.
« Reply #2 on: 11 May 2004, 11:27 »
I know how to set permissions.  Its just that (please forgive my stupidity) I set certian permissions on the usr directory and said "apply to all"
_________________________________________________
 
To create a new standard, it takes something that's not just a little bit different; it takes something that's really new and really captures people's imagination

savet

  • Member
  • **
  • Posts: 52
  • Kudos: 228
Um, oops.
« Reply #3 on: 11 May 2004, 11:51 »
Unfortunately, I don't know of an easy way to restore default permissions.

I don't know if this is a viable option for you, but  if you have a spare partition, you could do another slackware install, mount your first install partition, and do a cp -r * to overwrite all of the default files.

Assuming you have the space to do a 2nd install....this presents a few problems.  First, the non-standard files in /usr will still have the permissions you set.  And second...you will lose any special settings you may have in any of these files.

Again...assuming this is even a viable option for you, the slower but safer way to fix the permissions is to browse the new /usr directory applying the appropriate chmod commands to the tainted directory.

Looking at my slackware /usr directory...it appears the vast majority of files and directories are 755 (rwxr-xr-x).  The quick fix would probably be to chmod everything to 755 and then change the files that need special permissions.

Not sure if it helps...but it's what came to mind at 2am with a lack of adequate rest....
You're just jealous cause the voices only talk to me...

Paladin9

  • VIP
  • Member
  • ***
  • Posts: 696
  • Kudos: 263
Um, oops.
« Reply #4 on: 11 May 2004, 12:00 »
Well, doing all that stuff with another install sounds like too much of a pain in the ass.  I think some directories in /usr were set differently then others because I tried setting the /usr back to the way it was and I still am having problems.  Just to tell you what my problems are:  when it boots, I get wierd messages, but everything works fine.  However, I can only start x with root.  Any other user, and I just get errors.  I used to start x with other users up until I fucked with permissions and then it stopped working.  Now I can not get it to work again.
_________________________________________________
 
To create a new standard, it takes something that's not just a little bit different; it takes something that's really new and really captures people's imagination

savet

  • Member
  • **
  • Posts: 52
  • Kudos: 228
Um, oops.
« Reply #5 on: 11 May 2004, 12:34 »
LOL...ok...I should be kicking myself now.  This should be the simplest solution to find the changes.

run the following command:
ls -l /usr/* > ~/my_usr_file

download MY user file from the web
http://td-solutions.net/usr_directory

then run the following command:
diff -bB ~/usr_directory ~/my_usr_file

This will give you a list of the changes between the two files.

From here, you'll have to do some research and determine which of the changed files might be affecting X.  Thankfully though, the list should be much shorter than before.

Hope this helps.

And an afterthought, if you want to post the changes so we can see 'em....just run the diff statement as follows:
diff -bB ~/usr_directory ~/my_usr_file > ~/changes

Another afterthought....you're gonna have to sift through the results (best done as a file) to find the actual permission differences.  The date/time differences are going to create a difference on a lot of files.  I'm sure there's a way to compare only the permissions....but it's now after 3am and my mind is working less than before :-D

[ May 11, 2004: Message edited by: Rio ]

[ May 11, 2004: Message edited by: Rio ]

You're just jealous cause the voices only talk to me...

insomnia

  • Member
  • **
  • Posts: 587
  • Kudos: 0
Um, oops.
« Reply #6 on: 11 May 2004, 16:53 »
Slackware has a MANIFEST.gz file that list all you installed.

Use smprms to recover permissions.
(Only works for 'out of box' files!)
Download + instructions:
http://homepages.paradise.net.nz/~cameronk/progs.html
(first program you'll see)
Those who can make you believe absurdities can make you commit atrocities.
    Voltaire

Injustice is happening now; suffering is happening now. We have choices to make now. To insist on absolute certainty before starting to apply ethics to life decisions is a way of choosing to be amoral.
R. Stallman

http://www.pvda.be/


flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Um, oops.
« Reply #7 on: 11 May 2004, 17:22 »
Actually if you only want a listing of the files immediately under /usr, you'd have to use ls -ld. If you want to recursively list all files beneath /usr and its subdirectories, you'd use ls -lR.

 
quote:
Originally posted by Rio:
Another afterthought....you're gonna have to sift through the results (best done as a file) to find the actual permission differences.  The date/time differences are going to create a difference on a lot of files.  I'm sure there's a way to compare only the permissions....but it's now after 3am and my mind is working less than before :-D


Not wanting to leave this as an exercise for the reader,

ls -lR /usr |  sed -e 's/\([^\\]\)[ ]\+/\1   /g' | cut -f 1,9

will print just the permissions and file name. Note that the space before the "/g" should actually be a tab character.

[ May 11, 2004: Message edited by: flap ]

"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca


savet

  • Member
  • **
  • Posts: 52
  • Kudos: 228
Um, oops.
« Reply #8 on: 11 May 2004, 19:46 »
Oops, you're right.  I forgot the R option in the instructions.  Thanks
You're just jealous cause the voices only talk to me...

Paladin9

  • VIP
  • Member
  • ***
  • Posts: 696
  • Kudos: 263
Um, oops.
« Reply #9 on: 18 May 2004, 05:28 »
quote:
Originally posted by insomnia:
Slackware has a MANIFEST.gz file that list all you installed.

Use smprms to recover permissions.
(Only works for 'out of box' files!)
Download + instructions:
http://homepages.paradise.net.nz/~cameronk/progs.html
(first program you'll see)



My manifest file is a .bz2 so smprms does not work.

This is the error I get when trying to startx:

Fatal server error:
xf86OpenConsole: Server must be suid root

Here is another error as well:

XIO:  fatal IO error 104 (Connection reset by peer) on X server ":0.0" after 0 requests (0 known rocessed) with 0 events remaining.

[ May 17, 2004: Message edited by: Paladin9 ]

_________________________________________________
 
To create a new standard, it takes something that's not just a little bit different; it takes something that's really new and really captures people's imagination

insomnia

  • Member
  • **
  • Posts: 587
  • Kudos: 0
Um, oops.
« Reply #10 on: 18 May 2004, 16:57 »
You should have both.
MANIFEST.gz is just an index of what's installed(including permissions).

[ May 18, 2004: Message edited by: insomnia ]

Those who can make you believe absurdities can make you commit atrocities.
    Voltaire

Injustice is happening now; suffering is happening now. We have choices to make now. To insist on absolute certainty before starting to apply ethics to life decisions is a way of choosing to be amoral.
R. Stallman

http://www.pvda.be/


Paladin9

  • VIP
  • Member
  • ***
  • Posts: 696
  • Kudos: 263
Um, oops.
« Reply #11 on: 18 May 2004, 22:57 »
quote:
Originally posted by insomnia:
You should have both.
MANIFEST.gz is just an index of what's installed(including permissions).



Great! So, where is it?
_________________________________________________
 
To create a new standard, it takes something that's not just a little bit different; it takes something that's really new and really captures people's imagination

insomnia

  • Member
  • **
  • Posts: 587
  • Kudos: 0
Um, oops.
« Reply #12 on: 19 May 2004, 00:07 »
As root:
find / -name MANIFEST.gz

[ May 18, 2004: Message edited by: insomnia ]

Those who can make you believe absurdities can make you commit atrocities.
    Voltaire

Injustice is happening now; suffering is happening now. We have choices to make now. To insist on absolute certainty before starting to apply ethics to life decisions is a way of choosing to be amoral.
R. Stallman

http://www.pvda.be/


Paladin9

  • VIP
  • Member
  • ***
  • Posts: 696
  • Kudos: 263
Um, oops.
« Reply #13 on: 19 May 2004, 03:20 »
quote:
Originally posted by insomnia:
As root:
find / -name MANIFEST.gz



Nothing.  Is it on the CD? And if so, where?  I got the MANIFEST.bz2 from the CD but I did not see a MANIFEST.gz there.
_________________________________________________
 
To create a new standard, it takes something that's not just a little bit different; it takes something that's really new and really captures people's imagination

flap

  • Member
  • **
  • Posts: 1,268
  • Kudos: 137
Um, oops.
« Reply #14 on: 19 May 2004, 04:22 »
What's wrong with using manifest.bz2? It's the same file but a different compression format. If it's because you need to do this

zcat MANIFEST.gz | smprms > /tmp/restore.sh

then just change that to

bunzip -c MANIFEST.bz2 | smprms > /tmp/restore.sh
"While envisaging the destruction of imperialism, it is necessary to identify its head, which is none other than the United States of America." - Ernesto Che Guevara

http://counterpunch.org
http://globalresearch.ca