Ok, I am still tackling the problem of hiding DBI passwords, and other data for perl scripts... I have come up with the idea of compiling them into a C program, which can be chmod'd non readable... which calls the proper perl script and passes the data in somehow. Now I am trying to find a safe unobtrusive way of passing that data to the perl script... I figure I can either do a system call to run the perl script or possibly do an exec and blow the C program away once it has done its thing (preferrable). Now, I am pretty sure you are able to pass filehandles across programs, yes? Though I am not sure how to do it... something about the file descriptor and a < and an & and the file descriptor... so my thought was maybe to open a temporary file for readwrite and immediately unlink it, which I believe still leaves me a filehandle I can use (on unix anyway) but no one else can access since the filesystem thinks it is gone pretty much... Is this actually feasible and safe? Is there a better way? I know the environment and ARGV are not safe, since they are visible in /proc

Any monky thoughts?
                - Ant


In reply to Question of safe data passing... by suaveant

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.