Slackware This Forum is for the discussion of Slackware Linux.
|
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-17-2003, 08:14 AM
|
#1
|
Member
Registered: Apr 2003
Posts: 53
Rep:
|
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?
|
|
|
04-17-2003, 08:23 AM
|
#2
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
Exactly which files are you talking about? And what are their permissions at the moment.
cheers
Jamie...
|
|
|
04-17-2003, 08:38 AM
|
#3
|
Member
Registered: Apr 2003
Posts: 53
Original Poster
Rep:
|
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.
|
|
|
04-17-2003, 08:49 AM
|
#4
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
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...
|
|
|
04-17-2003, 08:59 AM
|
#5
|
Member
Registered: Apr 2003
Posts: 53
Original Poster
Rep:
|
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
|
|
|
04-17-2003, 09:46 AM
|
#6
|
Senior Member
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243
Rep:
|
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...
|
|
|
All times are GMT -5. The time now is 07:14 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|