You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Nick Tonkin <pu...@rlnt.net> on 2001/02/03 04:06:25 UTC

Doh; StatINC can't find files?

Hi folks,

Maybe I'm just rusty after 8 months off, but my StatINC can't find files 
that exist on the system:

wm ~>tail ~wm/wm/logs/errorlog
Apache::StatINC: Can't locate /home/wm/wm/perl/WM/Class.pm

wm ~>perl -e '$file="/home/wm/wm/perl/WM/Class.pm"; $mtime = (stat 
$file)[9]; warn $mtime;'
963258607 at -e line 1.

I thought it might be perms, but:

wm ~>ls -la /home/wm/wm/perl/WM/Class.pm
-rwxrwxr-x    1 wm       wm          10357 Jul 20  2000 
/home/wm/wm/perl/WM/Class.pm

And the same thing happens with Apache::Reload ...

I'm sure I'm missing something obvious; any clues?

Thanks

-nick



RE: Doh; StatINC can't find files?

Posted by Robert Landrum <rl...@capitoladvantage.com>.
My mistake.  I misread the orginial message.  It was referring to the 
/home/USER directory, not the /home/USER/public_html directory.

If you set /home/USER to 701, and /home/USER/public_html to 755, then 
everything is works great and things stay more secure than having 
/home/USER 755.

Double Doh!

Rob

> >>>>> "RL" == Robert Landrum <rl...@capitoladvantage.com> writes:
>
>RL> Under Linux, 'x' does mean execute... from the chmod manpage
>
>RL>         The letters `rwxXstugo' select the new permissions for the
>RL>         affected users: read (r), write (w),  execute  (or  access
>RL>         for directories) (x), execute only if the file is a direc-
>
>But it is a directory, so it means "access".  If you know the file
>name, you can access it.
>
>You just need to ensure that you don't need to read the directory
>itself, if you don't want "r" permissions.


Robert L. Landrum
Senior Programmer
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It's working correctly.  It's simply working in contrast to what you have
perceived to be correct."

RE: Doh; StatINC can't find files?

Posted by Vivek Khera <kh...@kciLink.com>.
>>>>> "RL" == Robert Landrum <rl...@capitoladvantage.com> writes:

RL> Under Linux, 'x' does mean execute... from the chmod manpage
 
RL>         The letters `rwxXstugo' select the new permissions for the
RL>         affected users: read (r), write (w),  execute  (or  access
RL>         for directories) (x), execute only if the file is a direc-

But it is a directory, so it means "access".  If you know the file
name, you can access it.

You just need to ensure that you don't need to read the directory
itself, if you don't want "r" permissions.

RE: Doh; StatINC can't find files?

Posted by Robert Landrum <rl...@capitoladvantage.com>.
Neither of the following combinations worked for me:

drwx--x--x    3 rlandrum devel        4096 Jan 30 14:14 public_html
(711, Forbidden)
drwx-----x    3 rlandrum devel        4096 Jan 30 14:14 public_html
(701, Forbidden)

The only one that worked was:

drwxr-xr-x    3 rlandrum devel        4096 Jan 30 14:14 public_html
(755)

I didn't try 705, but I'm pretty sure it would work.

Under Linux, 'x' does mean execute... from the chmod manpage
 
        The letters `rwxXstugo' select the new permissions for the
        affected users: read (r), write (w),  execute  (or  access
        for directories) (x), execute only if the file is a direc-
        tory or already has execute permission for some user  (X),
        set  user  or group ID on execution (s), save program text
        on swap device (t), the permissions that the user who owns
        the  file  currently  has for it (u), the permissions that
        other users in the file's group have for it (g),  and  the
        permissions  that other users not in the file's group have
        for it (o).

Without the x bit, a user does not have permission to execute 
anything from within the scope of that directory.  Nor can the user 
change into that directory.

Robert Landrum



At 10:49 AM -0800 2/6/01, Rob Bloodgood wrote:
> > wm looks like a home directory.  The default perms on the home
>> directory are usually 700.  Try changing that to something like 755
>> or even 744 (it may not need execute).
>
>Actually, the x bit on directory perms means "accessible," meaning if you
>KNOW the name of the file, U can reach it at all... I ran into this when
>trying to allow ~/public_html.
>
>701 is the correct mask.
>
>L8r,
>Rob


Robert L. Landrum
Senior Programmer
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"It's working correctly.  It's simply working in contrast to what you have
perceived to be correct."

RE: Doh; StatINC can't find files?

Posted by Rob Bloodgood <ro...@empire2.com>.
> wm looks like a home directory.  The default perms on the home
> directory are usually 700.  Try changing that to something like 755
> or even 744 (it may not need execute).

Actually, the x bit on directory perms means "accessible," meaning if you
KNOW the name of the file, U can reach it at all... I ran into this when
trying to allow ~/public_html.

701 is the correct mask.

L8r,
Rob


Re: Doh; StatINC can't find files?

Posted by Robert Landrum <rl...@capitoladvantage.com>.
wm looks like a home directory.  The default perms on the home 
directory are usually 700.  Try changing that to something like 755 
or even 744 (it may not need execute).

Robert Landrum

>Hi folks,
>
>Maybe I'm just rusty after 8 months off, but my StatINC can't find 
>files that exist on the system:
>
>wm ~>tail ~wm/wm/logs/errorlog
>Apache::StatINC: Can't locate /home/wm/wm/perl/WM/Class.pm
>
>wm ~>perl -e '$file="/home/wm/wm/perl/WM/Class.pm"; $mtime = (stat 
>$file)[9]; warn $mtime;'
>963258607 at -e line 1.
>
>I thought it might be perms, but:
>
>wm ~>ls -la /home/wm/wm/perl/WM/Class.pm
>-rwxrwxr-x    1 wm       wm          10357 Jul 20  2000 
>/home/wm/wm/perl/WM/Class.pm
>
>And the same thing happens with Apache::Reload ...
>
>I'm sure I'm missing something obvious; any clues?
>
>Thanks
>
>-nick


RE: Doh; StatINC can't find files?

Posted by Harald Meier <ha...@rts.at>.
Hi,

do you have a startup.pl with something like

	$ENV{MOD_PERL} or die "not running under mod_perl!";
	use lib qw( /your-path-to-your-libs );

which is registred in your httpd.conf with something like 

    PerlRequire /etc/httpd/startup.pl
    PerlInitHandler Apache::StatINC
    PerlSetVar StatINC_UndefOnReload On
    PerlSetVar StatINC_Debug 1

or did you add your lib path directly in httpd?

you have to set your (%INC) BEFORE running your scripts.


regards,

Harald



-----Original Message-----
From: Nick Tonkin [mailto:publicn@rlnt.net]
Sent: Samstag, 03. Februar 2001 04:06
To: modperl@apache.org
Subject: Doh; StatINC can't find files?



Hi folks,

Maybe I'm just rusty after 8 months off, but my StatINC can't find files 
that exist on the system:

wm ~>tail ~wm/wm/logs/errorlog
Apache::StatINC: Can't locate /home/wm/wm/perl/WM/Class.pm

wm ~>perl -e '$file="/home/wm/wm/perl/WM/Class.pm"; $mtime = (stat 
$file)[9]; warn $mtime;'
963258607 at -e line 1.

I thought it might be perms, but:

wm ~>ls -la /home/wm/wm/perl/WM/Class.pm
-rwxrwxr-x    1 wm       wm          10357 Jul 20  2000 
/home/wm/wm/perl/WM/Class.pm

And the same thing happens with Apache::Reload ...

I'm sure I'm missing something obvious; any clues?

Thanks

-nick