Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

File::Inplace module is altering file permissions/ownership

by mojodaddy (Pilgrim)
on Mar 04, 2007 at 03:44 UTC ( #603102=perlquestion: print w/ replies, xml ) Need Help??
mojodaddy has asked for the wisdom of the Perl Monks concerning the following question:

Greetings o wise ones,

I have script that uses the File::Inplace and WWW::Mechanize modules. Inplace.pm opens and edits an html file and saves it as /var/www/mypage.html (i.e. Apache's server root), whereupon Mechanize browses to it and attempts to interact with it. Instead, it gets a 403 Forbidden error.

Upon investigating I find that the file permissions on mypage.html are set to 600. If I chmod it to 777 and then just have Mechanize browse to it (without Inplace.pm editing it first) it loads fine. But after Inplace is finished with it, the permissions are back to 600 again and Mechanize gets the 403 error. So, what is Inplace doing and how and why is it changing permissions? And how can I stop it?

(By the way, if I chown the file to any UID I want, even root, the file still comes back chmoded to 600 and owned by mojodaddy.)

Hey -- just thought of this: maybe I could somehow have the script change the permissions on the file before Mechanize browses to it... (but this seems kind of like putting "use warnings" in your script but then commenting it out when you get warnings...), and I'm sure I could do this without Inplace.pm, but I'd really rather understand what's going on and see if there's an easier fix before rewriting the whole script.

My thanks, wise ones, for any assistance you may be willing to bestow.

Comment on File::Inplace module is altering file permissions/ownership
Re: File::Inplace module is altering file permissions/ownership
by Anonymous Monk on Mar 04, 2007 at 05:56 UTC
      Thank you, o inscrutable one. I shall ponder this until its meaning is revealed to me.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://603102]
Approved by dorko
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (9)
As of 2014-08-27 08:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (232 votes), past polls