APM: RE: chmod doesn't die

Bob Richards bob at blacklab.com
Mon Apr 28 12:29:37 CDT 2003


It's probably a ownership issue.
On my servers the script must be owned by the same person
who owns the file for this program to work.

On the server you are on you may need the server to own the
files.

Bob Richards
http://www.blacklab.com
888-654-8860
512-275-0099
bob at blacklab.com


-----Original Message-----
From: austin-admin at mail.pm.org [mailto:austin-admin at mail.pm.org]On
Behalf Of Goldilox
Sent: Monday, April 28, 2003 11:37 AM
To: austin-pm at pm.org
Subject: APM: chmod doesn't die


this script keeps dieing. the chmod failsafe is not working and the chmod
fails
everytime (since the files were uploaded by the site owner via ftp and are
not
owned by Perl? those files are all 0644 before this script runs). Do I need
to
have Perl take ownership of the files to be able to chmod them (the files
are
picture files)? But more importantly, why does the chmod fail and then
continue
on as if it hasn't failed? Let me know if I am not providing enough info
(This
is perl, v5.8.0 built for aix)

Thanks again

Rhett


#!/usr/bin/perl
use CGI;
$cg=new CGI;


$thumbsfile="/path";
chmod 0766,$thumbsfile || no_way();#die "Can't chmod 766 $thumbsfile: $!";
unlink ($thumbsfile) || die "Can't unlink $thumbsfile: $!";

print $cg->redirect("/path");

sub no_way{print $cg->header;print qq~<html><head><title>Feature Not
Available</title>
<meta name=refresh http-equiv=refresh content="5;url=/path">
</head><body bgcolor=white>
<p>This feature is not available. Please send an email to the <a
href="mailto:">webmaster</a> requesting this feature.</p>
<p><a href="javascript:history.go(-1);">Go back</a> or wait and this page
will
automatically take you somewhere.</p></body></html>~;exit(0);}

_______________________________________________
Austin mailing list
Austin at mail.pm.org
http://mail.pm.org/mailman/listinfo/austin




More information about the Austin mailing list