diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-08 18:08:55 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-08 18:08:55 +0000 |
commit | a4af287985031a66174c2c91f152d8aa90c83f85 (patch) | |
tree | ca07da900a26073fd0626b931f8f01f656ea4dd6 | |
parent | ed4fa6f84bfbc11da71522ada3ce411876d6ea61 (diff) | |
download | pfsense-packages-a4af287985031a66174c2c91f152d8aa90c83f85.tar.gz pfsense-packages-a4af287985031a66174c2c91f152d8aa90c83f85.tar.bz2 pfsense-packages-a4af287985031a66174c2c91f152d8aa90c83f85.zip |
Write out file using fopen so that newlines are capable
-rw-r--r-- | packages/autoconfigbackup/crypt_acb.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/packages/autoconfigbackup/crypt_acb.php b/packages/autoconfigbackup/crypt_acb.php index 6c2dfa04..3fdfb4f2 100644 --- a/packages/autoconfigbackup/crypt_acb.php +++ b/packages/autoconfigbackup/crypt_acb.php @@ -30,8 +30,10 @@ */ function crypt_data($val, $pass, $opt) { - $file = tempnam('','php-encrypt-'); - exec("echo -E '$val' > $file.dec"); + $file = tempnam("/tmp", "php-encrypt"); + $fd = fopen("$file.dec", "w"); + fwrite($fd, $val); + fclose($fd); exec("/usr/bin/openssl enc {$opt} -aes-256-cbc -in $file.dec -out $file.enc -k {$pass}"); $myfile = file("$file.enc"); exec("rm $file"); |