LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-17-2003, 08:14 AM   #1
cyberia_2ooo
Member
 
Registered: Apr 2003
Posts: 53

Rep: Reputation: 15
file premission problem. (URGENT)


well, I have tried to install a driver for my ATI graphics card.
the official RPM (which i converted to TGZ) didn't want to get installed, so i got an unofficial one.
converted it, installed it, tried to run, didn't run, uninstalled it.
(all of that, i have done under roor)
Then, I restarted my machine, logged in as a regular user, and couldn't run nothing.
after an investigation i figured out that all the files an folders premmisions were messed up.

does anyone have any idea what to do?
maybe someone here has a script, or can make script, that will change back to defaule file premissions?
 
Old 04-17-2003, 08:23 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Exactly which files are you talking about? And what are their permissions at the moment.

cheers

Jamie...
 
Old 04-17-2003, 08:38 AM   #3
cyberia_2ooo
Member
 
Registered: Apr 2003
Posts: 53

Original Poster
Rep: Reputation: 15
that's it, it's one or two files

i noticed that the directory /usr's premissions were drwx------
and many subfolders and files of it were with the same premission.

I noticed the problems when i couldn't run anything from regular users....
after i changed some permissions so i could start x (which was one of the programs i couldn't run) it gave an error because it couldn't read a file, after changing the file's premissions, it gave me a new error about another file....

now, i want to change back to default file permissions.
 
Old 04-17-2003, 08:49 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
If you are in a situation where all the files and directories in the current directory and below are 700 when you want them to be 755 and 600 where you want them to be 644 you can use a little perl script like this...
Code:
#!/usr/bin/perl -w
use File::Find;

@ARGV = ('.') unless @ARGV;

find(\&process_file, @ARGV);

sub process_file {

   if ( -d ) {
     chmod 0755, "$_";
     print("chmod'ed $_/ to 755\n");
     return;
   }

   if ( -x ) {
     chmod 0755, "$_";
     print("chmod'ed $_ to 755\n");
   }
   else {
     chmod 0644, "$_" ;
     print("chmod'ed $_ to 644\n");
   }
}
You'll need to save that to a file, chmod the file to 700 then run
Code:
theFileNameYouChose /someDir
If you don't give it a directory then you'll end up chmod'ing the current dir.

HTH

Jamie...
 
Old 04-17-2003, 08:59 AM   #5
cyberia_2ooo
Member
 
Registered: Apr 2003
Posts: 53

Original Poster
Rep: Reputation: 15
thanx alot
but' it's not exactly what i wanted....
see, there are files which are not supposed to be accessible for regular users in the folders like usr or var

but, there are files there which are accissble and even writeble by all users...

I don't wanna have any security holes
 
Old 04-17-2003, 09:46 AM   #6
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
That script will only be suitable if you want root with read/write and everyone else with read. If you need anything more complex then I recon' you'll need to do it by hand.

good luck!

Jamie...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Rescue file from disk - urgent yallu Linux - Software 3 04-18-2005 06:11 AM
Cant read windows file URGENT! the mac 13 Linux - Software 6 01-08-2005 03:22 AM
Folder Premission Problem jrmontg Linux - Security 2 01-06-2005 02:07 PM
premission access problem in apache . appas Linux - Software 5 10-22-2004 10:34 AM
How do I change premission? brynjarh Linux - Newbie 2 06-29-2004 11:02 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration