http://www.perlmonks.org?node_id=789250


in reply to mod_perl2 interactive startup

Why don't you just check to see if the variable where you put the password has been filled in yet, and skip the terminal if you already have it?

Incidentally, it's not really more secure to enter the password this way than to just keep it in a file that only the web server startup user can read.

Replies are listed 'Best First'.
Re^2: mod_perl2 interactive startup
by amino (Initiate) on Aug 18, 2009 at 01:46 UTC
    > Why don't you just check to see if the variable where you put the password has been filled in yet, and skip the terminal if you already have it?

    Because the mod_perl app restarts completely, so at least in the perl (as far as I know), no variables or structures persist.
    Is it possible to store stuff in the apache object?

    >Incidentally, it's not really more secure to enter the password this way than to just keep it in a file that only the web server startup user can read.

    I disagree. If the startup user account gets compromised its very easy to read a file and get a password. I believe the bar is a lot higher to extract data from a running program.
    How would you go about retrieving a password from a running program?
      The perl interpreter is not reset. If you put something in a global, it will still be there during the restart.
        How do you do that?

        I tried saving data in a global in the startup.pl and in a package global but when the restart happens they are uninitialized.

        My tests and this line, "During the restart, Perl is completely destroyed and started again." from here leave me at a loss to how to do that.
        It is just as trivial. Cleartext Passwords in Linux Memory

        "...that data from memory can be recovered with physical access to systems in a very short period of time." from the abstract of the paper that appears in the first few search results.

        That leads me to believe it is not as trivial b/c an intruder needs physical access.