You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Paul Murphy <pm...@bloxx.com> on 2005/05/25 16:46:45 UTC

Newbie question re: opendir

Hi,

Please excuse the newbie-ish nature of this question, but I have
searched the mailing list archives and can't find an answer to my
question.

I've downloaded and installed LXR 0.9.4 on a Fedora Core 3 box to index
our source here at our company, and there's a problem when I run the
script named 'source' which tries to access a directory to list its
contents. The mod_perl version is 2.0.0 (I upgraded to see if that would
resolve the issue).

The script is failing on an opendir call, stating that permission was
denied. I've inserted some test code manually to try and confirm this
and it seems to conform to my theory.

Embedding the following line 

opendir(DIR, '/usr/local/src/') or die ('Failed because of $!'); 

Gives

...[error] Can't open directory because of Permission denied.

If I run the same code from the command as both a root and non-root user
i.e. perl -Te " opendir(DIR, '/usr/local/src/') or die ('Failed because
of $!');" I see no errors. I've loosened the permissions on the entire
directory path to 777 to make sure that they're really is no permission
issue as well.

Looking through the archives for this list I've seem mails that mention
checking if calls to glob() fail in a similar fashion. I've check and
they don't - glob() works fine.

Cheers
 	
Paul

Re: Newbie question re: opendir

Posted by Simon Perreault <no...@lqt.ca>.
On Wednesday 25 May 2005 10:46, Paul Murphy wrote:
> [...] Fedora Core 3 [...]
>
> opendir(DIR, '/usr/local/src/') or die ('Failed because of $!');
>
> Gives
>
> ...[error] Can't open directory because of Permission denied.

I guess that it's because of SELinux, which is enabled by default on FC3. See 
http://fedora.redhat.com/docs/selinux-apache-fc3/