Hello!

HTML::Template failed trying to process file with ACL ( can't read _readable_ file )

The reason is "-r $filename" expression - it doesn't work with ACL.
It's the common perl problem or we could use another expression to determine readable 
file or not?

What's the best way to fix it?

Thanks in advance.
    Aleksey
       


> uname -a
Linux 2.6.7-1-k7 i686 GNU/Linux

> mount -l | grep /home
/dev/hda2 on /home type ext3 (rw,acl) []

> perl -MHTML::Template -e 'print $HTML::Template::VERSION'
2.7

> pwd
/home/hosting/project/cgi-bin/

> cat test.cgi
------------------------------------------
#!/usr/bin/perl
use CGI;
use HTML::Template;

print CGI::header();
print 'Whoami: '.`whoami`;
print 'Current Directory: '.`pwd`;
print 'Template file: '.`cat test.txt`."\n";
my $template = HTML::Template->new(
    filename => 'test.txt'
);
$template->param( { param1 => 'blah' } );
print "Template output: ".$template->output()."\n";
------------------------------------------

> cat test.txt
------------------------------------------
<TMPL_VAR NAME="param1">
------------------------------------------

> getfacl test.txt
------------------------------------------
# file: test.txt
# owner: aleksey
# group: aleksey
user::rw-
user:www-data:rwx               #effective:rw-
group::---
mask::rw-
other::---
------------------------------------------

> ./test.cgi
------------------------------------------
Content-Type: text/html; charset=ISO-8859-1

Whoami: aleksey
Current Directory: /home/hosting/project/cgi-bin
Template file: <TMPL_VAR NAME="param1">
Template output: blah
------------------------------------------

> lwp-request project.com/cgi-bin/test.cgi
------------------------------------------
Whoami: www-data
Current Directory: /home/hosting/project/cgi-bin
Template file: <TMPL_VAR NAME="param1">
------------------------------------------

> tail error.log
------------------------------------------
HTML::Template : template file test.txt does not exist or is unreadable at 
/usr/local/share/perl/5.8.4/HTML/Template.pm
line 1574
\tHTML::Template::_mtime('HTML::Template=HASH(0x82214a0)', 'test.txt') called at
/usr/local/share/perl/5.8.4/HTML/Template.pm line 1624
\tHTML::Template::_init_template('HTML::Template=HASH(0x82214a0)') called at 
/usr/local/share/perl/5.8.4/HTML/Template.pm
line 1189
\tHTML::Template::_init('HTML::Template=HASH(0x82214a0)') called at 
/usr/local/share/perl/5.8.4/HTML/Template.pm line 1083
\tHTML::Template::new('HTML::Template', 'filename', 'test.txt') called at 
/home/hosting/others/e3e5.com/cgi-bin/test.cgi
line 9
------------------------------------------

> su www-data
> cat test.txt
<TMPL_VAR NAME="param1">
> perl -e '$filepath="./test.txt"; (-r $filepath) or print "Error" '
Error



-------------------------------------------------------
This SF.Net email is sponsored by OSTG. Have you noticed the changes on
Linux.com, ITManagersJournal and NewsForge in the past few weeks? Now,
one more big change to announce. We are now OSTG- Open Source Technology
Group. Come see the changes on the new OSTG site. www.ostg.com
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to