Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
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.


In reply to File::Inplace module is altering file permissions/ownership by mojodaddy

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others imbibing at the Monastery: (12)
    As of 2014-07-23 10:11 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (139 votes), past polls