in reply to Re: Why Perl misses installed modules ?
in thread Why Perl misses installed modules ?

Hi,

thanks for the tip. That solved particular problem...I thought this will help also in other cases, but I still get weird results (although am pretty much sure I'm wrong again)...

I've change chmod a+r on other directories and files too, but still get error on other file:
sudo -u asterisk ./zoip.agi /usr/share/asterisk/agi-bin/ZORK1.DAT Can't locate Asterisk/Games/Zork/StoryFile.pm in @INC (@INC contains: +/usr/share/asterisk/agi-bin/lib /etc/perl /usr/local/lib/perl/5.8.8 / +usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/p +erl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .) at ./zoip.agi + line 18. BEGIN failed--compilation aborted at ./zoip.agi line 18.
but I've checked path and file :
# ls -l /usr/local/share/perl/5.8.8/Asterisk/Games/Zork/StoryFile.pm -rwxr-xr-- 1 root root 83289 2008-09-26 02:07 /usr/local/share/perl/5. +8.8/Asterisk/Games/Zork/StoryFile.pm dcerouter_79506:/usr/share/asterisk/agi-bin# ls -l /usr/local/share/pe +rl/5.8.8/Asterisk/Games/Zork total 124 -rwxr-xr-- 1 root root 83289 2008-09-26 02:07 StoryFile.pm -rwxr-xr-- 1 root root 14431 2008-09-26 02:07 ZInterpreter.pm -rwxr-xr-- 1 root root 9275 2008-09-26 02:07 ZIO_Asterisk.pm -rwxr-xr-- 1 root root 4932 2008-09-26 02:07 ZIO_StrippedDown.pm dcerouter_79506:/usr/share/asterisk/agi-bin# ls -l /usr/local/share/pe +rl/5.8.8/Asterisk/Games total 4 drwxr-xr-- 2 root root 4096 2008-09-26 02:07 Zork dcerouter_79506:/usr/share/asterisk/agi-bin# ls -l /usr/local/share/pe +rl/5.8.8/Asterisk total 44 -r--r--r-- 1 root root 13274 2003-08-07 20:04 AGI.pm drwxr-xr-- 3 root root 4096 2008-09-26 02:07 Games -r--r--r-- 1 root root 6193 2003-06-14 08:35 Manager.pm -r--r--r-- 1 root root 1968 2003-06-09 22:02 Outgoing.pm -r--r--r-- 1 root root 1138 2002-09-26 09:47 QCall.pm -r--r--r-- 1 root root 5533 2003-06-09 22:02 Voicemail.pm dcerouter_79506:/usr/share/asterisk/agi-bin# ls -l /usr/local/share/pe +rl/5.8.8 total 536 drwxrwxr-x 3 root root 4096 2008-07-02 17:50 App drwxr-xr-x 4 root root 4096 2008-07-02 17:54 Archive drwxr-xr-x 3 root root 4096 2008-09-26 02:07 Asterisk -r--r--r-- 1 root root 261 2003-08-07 20:23 Asterisk.pm drwxr-xr-x 3 root root 4096 2008-07-02 17:54 auto drwxr-xr-x 2 root root 4096 2008-07-02 17:54 Compress drwxr-xr-x 4 root root 4096 2008-07-02 17:58 CPAN -r--r--r-- 1 root root 443080 2007-11-11 12:45 CPAN.pm drwxrwxr-x 6 root root 4096 2008-07-02 17:51 ExtUtils drwxr-xr-x 3 root root 4096 2008-07-02 17:53 File drwxr-xr-x 3 root root 4096 2008-09-26 01:55 Games drwxr-xr-x 4 root root 4096 2008-07-02 17:54 IO drwxr-xr-x 3 root root 4096 2008-07-02 17:51 Module drwxr-xr-x 3 root root 4096 2008-07-02 17:55 Net drwxr-xr-x 3 root root 4096 2008-07-02 17:59 RRD drwxrwxr-x 4 root root 4096 2008-07-02 17:50 TAP drwxr-xr-x 3 root root 4096 2008-07-02 17:55 Term drwxrwxr-x 3 root root 4096 2008-07-02 17:56 Test drwxr-xr-x 4 root root 4096 2008-07-02 17:56 YAML -r--r--r-- 1 root root 23904 2007-09-27 10:45 YAML.pm


It must be my mistake again, but have no clue what I did wrong...

Thanks in advance,

regards,

Rob.


Replies are listed 'Best First'.
Re^3: Why Perl misses installed modules ?
by jethro (Monsignor) on Sep 26, 2008 at 02:17 UTC

    Ah, the mysteries of unix file permissions ;-). Check out the chmod lines in my previous answer. I used a+r for the file, but a+rx for the directories.

    For a directory the flags r and x have different meaning than for files. The r-flag allows access to files in the directory (if you already know the name). The x-flag allows you to read or search the directory. So except for special cases you normally want both flags either on or off

    In your case both Games and Zork need another x.

      You have it backwards.

      The x-flag allows access to files in the directory, which is why you need it at a minimum.
      The r-flag allows you to read the directory.

        I'm sure I'm right with this. This was the way on Solaris and when I use 'man 2 chmod' on linux, I find the following sentence (translated from german):

        S_IXOTH 00001 Execute rights for others, on directories: others + are allowed to search directory

        I also used this effect a few times to make dirs unreadable, but allowed the files in it to be read (security by obscurity, but better than nothing).

        UPDATE: Sure I was, but wrong. As wrong as the man page.