Weird file permission problem with File::Temp
[prev]
[thread]
[next]
[Date index for 2004/11/22]
-------------8<---------- Start Bug Report ------------8<----------
1. Problem Description:
I'm trying to create temp file in PerlFixupHandler using File::Temp,
write to it, send it to the client and get the temp file automatically
unlinked upon the end of the request.
I keep getting file permission error.
Relevant part of the handler
use File::Temp ();
$fh = new File::Temp( DIR => '/tmp/aimcache', UNLINK => 1 );
chmod 0777, $fh;
my @ll = split '\n', `ls -la /tmp/aimcache`;
$r->log_error("$_") foreach @ll;
print $fh "test";
$tmpnam = $fh -> filename;
$r -> filename ($tmpnam) ;
return OK;
Error log
[Mon Nov 22 21:34:10 2004] [error] total 8
[Mon Nov 22 21:34:10 2004] [error] drwxrwxrwx 2 apache apache 36
Nov 22 21:34 .
[Mon Nov 22 21:34:10 2004] [error] drwxrwxrwt 10 root root 4096
Nov 22 20:48 ..
[Mon Nov 22 21:34:10 2004] [error] -rwxrwxrwx 1 apache apache 0
Nov 22 21:34 kGs2AahFrA
[Mon Nov 22 21:34:10 2004] [error] Apache::ImageMagick: Write
/tmp/aimcache/kGs2AahFrA ()
[Mon Nov 22 21:34:10 2004] [error] [client 81.0.228.181] (2)No such file
or directory: file permissions deny server access: /tmp/aimcache/kGs2AahFrA
2. Used Components and their Configuration:
*** mod_perl version 1.9916
*** using
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux/Apache2/Apache/BuildConfig.pm
*** Makefile.PL options:
MP_APR_LIB => aprext
MP_APXS => /usr/sbin/apxs2
MP_COMPAT_1X => 1
MP_DEBUG => 1
MP_GENERATE_XS => 1
MP_INST_APACHE2 => 1
MP_LIBNAME => mod_perl
MP_TRACE => 1
MP_USE_DSO => 3
*** The httpd binary was not found
*** (apr|apu)-config linking info
-L/usr/lib -lapr-0 -lrt -lm -lcrypt -lnsl -lpthread -ldl
-L/usr/lib -laprutil-0 -lgdbm -ldb-4.1 -lexpat
*** /usr/bin/perl -V
Summary of my perl5 (revision 5 version 8 subversion 4) configuration:
Platform:
osname=linux, osvers=2.6.7, archname=i386-linux
uname='linux knoppix 2.6.7 #2 smp wed jul 28 04:25:36 cest 2004 i686
intel(r) pentium(r) 4 cpu 3.00ghz genuineintel gnulinux '
config_args='-des -Darchname=i386-linux -Dcccdlflags=-fPIC
-Dccdlflags=-rdynamic -Dcc=gcc -Dprefix=/usr -Dvendorprefix=/usr
-Dsiteprefix=/usr -Dlocincpth= -Doptimize=-O2 -mcpu=i686
-fomit-frame-pointer -pipe -Duselargefiles -Dd_semctl_semun
-Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1
-Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1
-Dinstallman3dir=/var/tmp/portage/perl-5.8.4-r1/image//usr/share/man/man3
-Dman1ext=1 -Dman3ext=3pm -Dcf_by=Gentoo -Ud_csh -Di_ndbm -Di_gdbm -Di_db'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
Compiler:
cc='gcc', ccflags ='-fno-strict-aliasing -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64',
optimize='-O2 -mcpu=i686 -fomit-frame-pointer -pipe',
cppflags='-DPERL5 -fno-strict-aliasing'
ccversion='', gccversion='3.3.4 20040623 (Gentoo Linux 3.3.4-r1,
ssp-3.3.2-2, pie-8.7.6)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=8
alignbytes=4, prototype=define
Linker and Libraries:
ld='gcc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lpthread -lnsl -lndbm -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc
perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc
libc=/lib/libc-2.3.4.so, so=so, useshrplib=false, libperl=libperl.a
gnulibc_version='2.3.4'
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'
cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib'
Characteristics of this binary (from libperl):
Compile-time options: USE_LARGE_FILES
Built under linux
Compiled at Oct 12 2004 09:16:58
%ENV:
PERL_LWP_USE_HTTP_10="1"
@INC:
/etc/perl
/usr/lib/perl5/site_perl/5.8.4/i386-linux
/usr/lib/perl5/site_perl/5.8.4
/usr/lib/perl5/site_perl
/usr/lib/perl5/vendor_perl/5.8.4/i386-linux
/usr/lib/perl5/vendor_perl/5.8.4
/usr/lib/perl5/vendor_perl
/usr/lib/perl5/5.8.4/i386-linux
/usr/lib/perl5/5.8.4
/usr/local/lib/site_perl
.
3. This is the core dump trace: (if you get a core dump):
[CORE TRACE COMES HERE]
This report was generated by -e on Mon Nov 22 20:24:42 2004 GMT.
-------------8<---------- End Bug Report --------------8<----------
--
Report problems: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html
List etiquette: http://perl.apache.org/maillist/email-etiquette.html
 |
Weird file permission problem with File::Temp
RobertCZ 20:33 on 22 Nov 2004
|