aboutsummaryrefslogtreecommitdiffstats
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/autoconfigbackup/crypt_acb.php6
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");