Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Other Things Gentoo
  • Search

did chmod a-x * as root

Still need help with Gentoo, and your question doesn't fit in the above forums? Here is your last bastion of hope.
Post Reply
Advanced search
8 posts • Page 1 of 1
Author
Message
Grom33
n00b
n00b
Posts: 9
Joined: Mon Sep 05, 2005 10:17 pm

did chmod a-x * as root

  • Quote

Post by Grom33 » Sat Sep 10, 2005 6:03 pm

Well, the title explains it all... I really messed things up with that typo. I can`t even boot up the system now.
I can`t even boot an old kernel because the display is all messy until I`m booted up.

Anyway I can fix this crisis without reinstalling?
Top
tomvollerthun
Guru
Guru
User avatar
Posts: 316
Joined: Sat Mar 19, 2005 2:56 pm

  • Quote

Post by tomvollerthun » Sat Sep 10, 2005 6:46 pm

Perhaps installing would be simpler, but as an interesting experiment, you could try to boot from a liveCD and change the permissions by hand.

But more interesting than that would be to have it automatically done. P.e. change the permissions of all EFL-executables (compiled programs) could be done with

Code: Select all

find -exec file '{}' ';' | grep ELF | sed "s/:.*$//" | xargs chmod ug+x
To reset the permissions of other file types you'd have to think yourself.
As well you may want to change the permission depending on the file, but at least this finds many files that should be executable.

hth, tom
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Top
aceFruchtsaft
Guru
Guru
User avatar
Posts: 438
Joined: Sun May 16, 2004 12:56 pm
Location: Vienna, Austria

  • Quote

Post by aceFruchtsaft » Sat Sep 10, 2005 7:04 pm

BTW, did you really NOT use the -R option as your title implies?
In that case restoring correct permission would be trivial...
Top
tomvollerthun
Guru
Guru
User avatar
Posts: 316
Joined: Sat Mar 19, 2005 2:56 pm

  • Quote

Post by tomvollerthun » Sun Sep 11, 2005 10:32 am

aceFruchtsaft wrote:BTW, did you really NOT use the -R option as your title implies?
In that case restoring correct permission would be trivial...
Hey, I didn't see that!?!
You're right, but since Grom33 is not able to boot, it think -R actually *was* there, just not in the posting.

cu, tom
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Top
Gothmog
n00b
n00b
Posts: 10
Joined: Sun Sep 11, 2005 2:31 pm
Location: Germany
Contact:
Contact Gothmog
Website

  • Quote

Post by Gothmog » Mon Sep 12, 2005 11:08 am

tomvollerthun wrote:

Code: Select all

find -exec file '{}' ';' | grep ELF | sed "s/:.*$//" | xargs chmod ug+x
That's a nice idea, but I think directories and many text executables like shell scripts also have to be executable... so, to get the system working again, something like

Code: Select all

find / \( -type d -o -exec perl -e 'exit 1 unless `file {}` =~ /executable/' \; \) -exec chmod +x '{}' \;
could be more appropriate to make the system work again...

But there probably are many more issues to solve.
perl -e '$i++, print $1 while
"\nrekcah lreP rehtona tsuJ" =~ /(.)(??{"."x$i})$/s'
Top
tomvollerthun
Guru
Guru
User avatar
Posts: 316
Joined: Sat Mar 19, 2005 2:56 pm

  • Quote

Post by tomvollerthun » Mon Sep 12, 2005 1:13 pm

Gothmog wrote:

Code: Select all

<snip> =~ /executable/ </snip>
That's nice.
So the regex "executable" tests if something *should* be executable and does not rely on the actual permission of the file?
Didn't know that and in fact that's quite impressive.

Well, to be really honest, this is so impressive that I can hardly believe that, could you explain it for me, please?

cu, tom
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Top
Gothmog
n00b
n00b
Posts: 10
Joined: Sun Sep 11, 2005 2:31 pm
Location: Germany
Contact:
Contact Gothmog
Website

  • Quote

Post by Gothmog » Mon Sep 12, 2005 2:03 pm

tomvollerthun wrote:
Gothmog wrote:

Code: Select all

<snip> =~ /executable/ </snip>
That's nice.
So the regex "executable" tests if something *should* be executable and does not rely on the actual permission of the file?
Didn't know that and in fact that's quite impressive.

Well, to be really honest, this is so impressive that I can hardly believe that, could you explain it for me, please?
cu, tom
You snipped to late, I suppose. :-) `file {}` executes "file FILENAME" and returns its output. The regex matches on it, and since file returns something like "...shell executable..." it should match on all files where file thinks (and says) that they are executable. Actually, if you'd replace (in your line) "grep ELF" through "grep executable" it should have pretty much the same effect, except on dirs.
perl -e '$i++, print $1 while
"\nrekcah lreP rehtona tsuJ" =~ /(.)(??{"."x$i})$/s'
Top
tomvollerthun
Guru
Guru
User avatar
Posts: 316
Joined: Sat Mar 19, 2005 2:56 pm

  • Quote

Post by tomvollerthun » Mon Sep 12, 2005 3:09 pm

Oh, that's clever.
Thanks for clearing that up for me.
Computer science is no more about computers than astronomy is about telescopes.
Dijsktra
---------------
Don't believe my "Guru" status!
Top
Post Reply

8 posts • Page 1 of 1

Return to “Other Things Gentoo”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic