summaryrefslogtreecommitdiff
path: root/plugins/password/drivers/sql.php
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/password/drivers/sql.php')
-rw-r--r--plugins/password/drivers/sql.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/plugins/password/drivers/sql.php b/plugins/password/drivers/sql.php
index 70e564396..33469ec62 100644
--- a/plugins/password/drivers/sql.php
+++ b/plugins/password/drivers/sql.php
@@ -33,7 +33,7 @@ function password_save($curpass, $passwd)
if ($err = $db->is_error())
return PASSWORD_ERROR;
-
+
// crypted password
if (strpos($sql, '%c') !== FALSE) {
$salt = '';
@@ -56,7 +56,11 @@ function password_save($curpass, $passwd)
$dovecotpw = 'dovecotpw';
if (!($method = $rcmail->config->get('password_dovecotpw_method')))
$method = 'CRAM-MD5';
- $tmpfile = tempnam('/tmp', 'roundcube-');
+
+ // use common temp dir
+ $tmp_dir = $rcmail->config->get('temp_dir');
+ $tmpfile = tempnam($tmp_dir, 'roundcube-');
+
$pipe = popen("'$dovecotpw' -s '$method' > '$tmpfile'", "w");
if (!$pipe) {
unlink($tmpfile);