LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 08-03-2010, 07:14 PM   #1
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 273

Rep: Reputation: 48
Question When can access("blah", R_OK) succeed and open("blah", O_RDONLY) fail?


Here are two sequential lines of an strace of evince.
access("/home/me/.Xauthority", R_OK) = 0
open("/home/me/.Xauthority", O_RDONLY) = -1 EACCES (Permission denied)

Very strangely the corresponding snippet of any other X program I run has...
access("/home/me/.Xauthority", R_OK) = 0
open("/home/me/.Xauthority", O_RDONLY) = 4

Reading The Fine Man pages I cannot understand how access() can succeed and open() fail.
 
Old 08-03-2010, 07:33 PM   #2
kakaka
Member
 
Registered: Sep 2003
Posts: 382

Rep: Reputation: 86
The interpretation of the *_OK modes can be affected by what sort of User, and the kernel version. Also if the file system is NFS
mounted, NFS can have it's own access mechanisms.

So we could use some additional info. to try to help you.

Does the User "me" or whatever User is using the home directory "/home/me", have root privileges?
Is the kernel version newer than version 2.6.3?
Is "/home/me" on an NFS mounted file system?
 
Old 08-03-2010, 09:53 PM   #3
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 273

Original Poster
Rep: Reputation: 48
Both programs are run as user "me", and the file is owned by me, and has permissions -rw------- and the file system is ext4 on a Lucid Ubuntu system.
 
Old 08-03-2010, 10:01 PM   #4
cyent
Member
 
Registered: Aug 2001
Location: ChristChurch New Zealand
Distribution: Ubuntu
Posts: 273

Original Poster
Rep: Reputation: 48
Meh! I have found it.

apparmor is to blame.

I had moved my home directory off the smaller solid state root disk to a 500gb harddrive and mounted at it via a symlink.

ie. My home dir is really /disk_1/home/me and I have a symnik /home/me -> /disk_1/home/me

The solution is to run
sudo dpkg-reconfigure apparmor
 
  


Reply

Tags
apparmor, evince, lucid


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
Hardy won't startup, stops with a "fail" and I have to "ctrl+alt+del" to boot. brjoon1021 Ubuntu 10 12-15-2008 07:29 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 11:18 PM
LXer: Displaying "MyComputer", "Trash", "Network Servers" Icons On A GNOME Desktop LXer Syndicated Linux News 0 04-02-2007 09:31 AM
C++ system("blah"); enragedchip Programming 1 05-27-2004 04:19 PM
"X-MS" cant open because "x-Multimedia System" cant access files at "smb&qu ponchy5 Linux - Networking 0 03-30-2004 12:18 AM


All times are GMT -5. The time now is 06:51 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration