LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 11-18-2005, 08:50 PM   #1
sunman
Member
 
Registered: Jun 2005
Distribution: Slackware64 13.0 (multilib)
Posts: 67

Rep: Reputation: 15
permissions question


Kind of strange problem I just ran into that maybe someone can help me out with. I was just being curious and playing with some commands (still quite learning my linux). I went into the /usr/doc directory and entered - du -sh just to see. To my surprise I got some permission denied's reported:
du: `./krename-3.0.8/doc': Permission denied
du: `./libgphoto2-2.1.6/linux-hotplug': Permission denied
du: `./transcode-1.0.0/html': Permission denied
du: `./transcode-1.0.0/release-notes': Permission denied
264M .

So being curious about this I moved into the krename directory to investigate.
ls -ld doc showed me this:
drw-r--r-- 3 root root 160 2005-09-24 22:10 doc/
lsattr -d doc showed me:
------------- doc

Now am I wrong in assuming that I should be able, as a normal user, to actually read the contents of that directory? It sure isn't letting me.

tim@shadyvale:/usr/doc/krename-3.0.8$ cd doc
-bash: cd: doc: Permission denied

I can read all fine as root of course, but what gives not being able to read it and the others as a normal user?
 
Old 11-18-2005, 08:58 PM   #2
FreeThinkerJim
Member
 
Registered: Apr 2005
Location: Las Vegas, Nevada, USA
Distribution: Ubntu Intrepid Ibex (8.10)
Posts: 129

Rep: Reputation: 15
It looks like the permissions on /usr/doc are wrong for some reason. I just tried what you did on my computer as a normal user, and it works fine. Try this as root:

Code:
chmod a+rwx /usr/doc -R
 
Old 11-18-2005, 09:04 PM   #3
sunman
Member
 
Registered: Jun 2005
Distribution: Slackware64 13.0 (multilib)
Posts: 67

Original Poster
Rep: Reputation: 15
I could try that, but the permissions for /usr/doc seem to be alright actually.

tim@shadyvale:/usr$ ls -ld /usr/doc
drwxr-xr-x 741 root root 25136 2005-11-18 21:13 /usr/doc/
 
Old 11-18-2005, 09:14 PM   #4
FreeThinkerJim
Member
 
Registered: Apr 2005
Location: Las Vegas, Nevada, USA
Distribution: Ubntu Intrepid Ibex (8.10)
Posts: 129

Rep: Reputation: 15
Not quite. It seems that only the onwner (probably root) of /usr/doc has all permissions, and then the root group has execute and read. Everybody else can only execute, but not read or write. Chances are your user isn't in the root group, so you should set it so that you at least have execute and read permission (don't know about writing though. My computer allows me to write to this folder but I'm not sure if that's really the best way to go.)

HTH
 
Old 11-18-2005, 09:32 PM   #5
sunman
Member
 
Registered: Jun 2005
Distribution: Slackware64 13.0 (multilib)
Posts: 67

Original Poster
Rep: Reputation: 15
Erm, maybe I'm thick, but let me dissect this...

drwxr-xr-x 741 root root 25136 2005-11-18 21:13 /usr/doc/

this is the is the ls -ld /usr/doc on my system.

The permissions (drwxr-xr-x 741 root root) as far as I understand it, means:
the directory is owned by root, and the group is root also.

the first four letters of the permissions (drwx) mean that it's a directory, and the owner (which is root) has read, write and execution permissions for this directory.

the next three places (r-x) mean that that users belonging to the group of the directory (which is root) has read and execution permissions for this directory.

the last three places (r-x) mean that all other users also have read and execution permissions in this directory...

(could someone comment as to whether I'm understanding and relating this right just to make sure I'm understanding what the permissions mean...so as not to just be looking at things wrong)

So...my user account should have no problem reading it, and doesn't for the most part, except for these directories:
tim@shadyvale:/usr/doc$ du -sh
du: `./krename-3.0.8/doc': Permission denied
du: `./libgphoto2-2.1.6/linux-hotplug': Permission denied
du: `./transcode-1.0.0/html': Permission denied
du: `./transcode-1.0.0/release-notes': Permission denied

Checking out these directories with ls -ld yields:
tim@shadyvale:/usr/doc$ ls -ld /usr/doc/krename-3.0.8/doc
drw-r--r-- 3 root root 160 2005-09-24 22:10 /usr/doc/krename-3.0.8/doc/

with the same permissions on all of the above that du -sh gets a permission denied error on. I've done chmod a+r /usr/doc/kderename-3.0.8/doc as root and still get the same results. I also tried chmod a+r /usr/doc -R as root just to try to make sure everything was set as readable to all users but still get the same results as well...Hence my confusion.

Last edited by sunman; 11-18-2005 at 09:50 PM.
 
Old 11-18-2005, 09:53 PM   #6
spooon
Senior Member
 
Registered: Aug 2005
Posts: 1,755

Rep: Reputation: 51
Let me describe how permissions work for directories:
* Read permission (r) allows you to list the directory, i.e. see the names of the files and directories within
* Write permission (w) allows you to create, move and delete files and directories within
* Execute permission (x) allows you to access the directory; which includes the ability to change into that directory and access the files and directories inside, see the attributes of those files, etc.

According to your "ls -l" output, you have a directory that doesn't have execute permission. Without execute permission, a directory is useless, since you have absolutely no access to the stuff inside the directory. On the other hand, if a directory has execute permissions, even if there is no read permission, it is still very useful because you can still access its contents if you know their names.
 
Old 11-18-2005, 09:55 PM   #7
elyk
Member
 
Registered: Jun 2004
Distribution: Slackware
Posts: 241

Rep: Reputation: 49
Try giving the directories execute permission. (chmod 755 directory_name)
 
Old 11-18-2005, 10:00 PM   #8
sunman
Member
 
Registered: Jun 2005
Distribution: Slackware64 13.0 (multilib)
Posts: 67

Original Poster
Rep: Reputation: 15
Ah! Thank you very much for the post spooon and elyk. It's just the missing execute permissions that I wasn't understanding. I was newbie-ishly assuming that read permissions for the directories was what I was looking for, thanks for clearing that up

Last edited by sunman; 11-18-2005 at 10:06 PM.
 
  


Reply



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
Another permissions question BajaNick Linux - Software 2 01-21-2004 11:40 AM
Permissions Question dragin33 *BSD 1 01-05-2004 06:35 PM
Permissions question sammckee Linux - Newbie 3 09-23-2003 10:55 AM
Permissions question... phil1076 Linux - General 3 09-03-2003 10:50 AM
Permissions Question? gsmonk Linux - General 3 08-27-2003 03:30 PM

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

All times are GMT -5. The time now is 08:56 AM.

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