Infinite Loop

Julian Field MailScanner at ecs.soton.ac.uk
Sun Aug 24 11:22:03 IST 2008



Caza Henha wrote:
> Hi Everyone,
>  
> I seemed to have solved the problem with my own bit of perl debugging. 
> I changed the line of code to
>  
> $handle = IO::File->new_tmpfile or die "Unable to make new temporary 
> file: $!";
>
> I'm not sure why the code is not like this in the first place as it 
> seems to stall the progam, however it return "Invalid Argument". I 
> checked the permissions on Unbuntu JeOS's tmp directory and it was 
> only writable by root so I changed it by:
>  
> sudo chmod o+w /tmp/
Your /tmp should be set to
chmod 1777 /tmp

The call to new_tmpfile should never fail unless there is something 
wrong with your system, as was the case for you. I'm not wholly 
convinced saying "Invalid Argument" is going to help anyone fix 
anything, it's a pretty useless error message. But I could add the "or 
die" I guess. The only difference is the error message that gets 
printed, I guess I will write a rather better error message than yours.

How about this instead:
    $handle = IO::File->new_tmpfile or die "Your /tmp needs to be set to 
\"chmod 1755 /tmp\"";
That would actually print something useful.

Jules

-- 
Julian Field MEng CITP CEng
www.MailScanner.info
Buy the MailScanner book at www.MailScanner.info/store

MailScanner customisation, or any advanced system administration help?
Contact me at Jules at Jules.FM

PGP footprint: EE81 D763 3DB0 0BFD E1DC 7222 11F6 5947 1415 B654
PGP public key: http://www.jules.fm/julesfm.asc


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.



More information about the MailScanner mailing list