From the sounds of things, the issue is the permissions that the CGI runs as. If you can get the administrator to install a progrqam for you, I would suggest that you either get suEXEC (if you're running Apache), or CGIwrap (if you're running anything else).

Basically, these programs run the CGI as a particular user, so that the files that are created as the script's user, and not the user that the webserver is running as.

If the issue is just the permissions of the file, and not the ownership, then you can set a umask within your Perl script, or chmod files that have been created. (and, you won't need to involve your sysadmin)

Other options include setting up a cron job to keep forcing the permissions of files in the directory in question (which is a hack...I don't suggest it, if any of the other suggestions will work, especially as your sysadmin may restrict cron usage), or some file systems may have ways to specify the ownership and permissions of files created within a directory. (eg, setfacl in Solaris)


In reply to Re: switch user by jhourcle
in thread switch user by henry214

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.