LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 06-19-2008, 04:21 PM   #1
wilsonsamm
Member
 
Registered: Aug 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 105

Rep: Reputation: 15
ls intray/ shows nothing, but sudo ls intray/ gives correct output


So, something has happened to a folder called /home/sam/intray. This folder is on a ReiserFS filesystem, one terabyte in size, mounted under /home. fsck /dev/sdb1 (the devnode of said device) shows no problems.
First of all I copied some files there from a DVD which had a corrupt filesystem, but I wasn't permitted to write to the files there so I did
sudo chown -R sam.user /home/sam/intray
sudo chmod -R 666 /home/sam/intray

Now, none of the files there appear to apps running as sam. But apps running as root see these files just fine. What is up with my system?
 
Old 06-19-2008, 05:50 PM   #2
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
In order to see a file, you need read permissions on the directory the file is in, not on the file itself.

What are the permissions on /home/sam?

Also, if you run
Code:
ls -al /home/sam/intray
do you see the entries for . and ..?
 
Old 06-20-2008, 02:24 AM   #3
wilsonsamm
Member
 
Registered: Aug 2005
Location: Sheffield, UK
Distribution: Gentoo
Posts: 105

Original Poster
Rep: Reputation: 15
It's very strange. I need 766 permissions in order to make any changes to that folder. 666 will not cut it for some reason. Why could this be?

GDM with KDE on Debian Etch requires all contents of ~ to be owned by the user and ~/.dmrc to have 644 permissions. Now, what about KDM with KDE on Ubuntu 8.04 LTS? What is the deal? Is KDE running as a separate user or something?
 
Old 06-20-2008, 02:42 PM   #4
rjlee
Senior Member
 
Registered: Jul 2004
Distribution: Ubuntu 7.04
Posts: 1,994

Rep: Reputation: 76
It's rather difficult to help you if you don't answer questions intended to track down the problem.

However, I can answer some of your new questions.

Permissions on directories are not very intuitive. In theory, a directory is a special file which, rather than containing data, contains a list of other files (which may include directories). However, permissions behave slightly differently on directories than they do on regular files.

666 gives all users read and write access to a file or directory. In the case of a directory, read access is just the ability to see the list of files in the directory (which is, after all, just a list of files), but not to use them in any way (you need permissions on the file for that).

7 is 6 with the execute bit set. The execute bit lets you run a file as a command. In the case of a directory, this lets you traverse the directory to act on sub-directories. With directories, the read permission only gives you the names of the files in the directory, which execute lets you see all the files' meta-data.

For more, see http://en.wikipedia.org/wiki/File_system_permissions

As to GDM, it's probably just a security check. To make sure that you aren't giving any random user (and hence, any server process) the chance to trash your files if it gets compromised. Giving anyone other than the owner of a file in /home anything more than read access (read+execute for directories) is probably a bad idea for just this reason; typically, group-shared files would go somewhere under /var.

Hope that helps,

—Robert J Lee
 
  


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
interpreting aide output -- sudo changed?! shjrgray Linux - Security 2 05-29-2007 11:11 PM
Which ldd output is correct? kaz2100 Linux - General 1 08-24-2006 01:35 PM
Is the output of (chapter 6)gcc-3.3.3 make -k check correct?????? linuxbh Linux From Scratch 1 09-05-2004 08:37 AM
correct sudo logging in RedHat sancho5 Linux - General 1 05-07-2004 08:52 AM
ver_linux doesn't shows correct binutils version s.lessing Linux - Software 1 01-16-2004 02:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 01:47 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