Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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. 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 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, 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

Replies are listed 'Best First'.
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?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://603102]
Approved by dorko
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (3)
As of 2018-03-20 00:45 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (247 votes). Check out past polls.