next up previous
Next: About this document ... Up: Real life examples Previous: Installing RSA authentication files

Execution of perl code within configuration files

Here at Network Division, we have a very handy script to restart critical services via Web, just in case SSH is down on a given server. Of course, it has a secret password to allow access only to authorized administrators.

Before PICA, we had to manually create the password's MD5 hash using the crypt perl function, and include the hash in the source file. Now, we can resort to something as elegant as this:

$passwd='<# crypt('secret-key-that-you-wont-ever-figure-out','salt') #>';

This way, just before sending the data, the command is executed and the encrypted key is put automagically in the distributed file. This saves time and work, and is a perfect example of the inmense power of PICA (and Perl, of course).

Esteban Manchado Velázquez 2002-12-13