Password: Fix kpasswd and smb drivers' double-escaping bug (#7092)

bnet/additions
Aleksander Machniak 5 years ago
parent 38f1727515
commit 132be945bd

@ -4,6 +4,7 @@ CHANGELOG Roundcube Webmail
- Managesieve: Replace "Filter disabled" with "Filter enabled" (#7028)
- Managesieve: Fix so modifier type select wasn't hidden after hiding modifier select on header change
- Managesieve: Fix filter selection after removing a first filter (#7079)
- Password: Fix kpasswd and smb drivers' double-escaping bug (#7092)
- Enigma: Add script to import keys from filesystem to the db storage (for multihost)
- Installer: Fix DB Write test on SQLite database ("database is locked" error) (#7064)
- Installer: Fix so SQLite DSN with a relative path to the database file works in Installer

@ -19,8 +19,8 @@ class rcube_kpasswd_password
{
public function save($currpass, $newpass, $username)
{
$bin = rcmail::get_instance()->config->get('password_kpasswd_cmd', '/usr/bin/kpasswd');
$cmd = $bin . ' "' . escapeshellarg($username) . '" 2>&1';
$bin = rcmail::get_instance()->config->get('password_kpasswd_cmd', '/usr/bin/kpasswd');
$cmd = $bin . ' ' . escapeshellarg($username) . ' 2>&1';
$handle = popen($cmd, "w");
fwrite($handle, $currpass."\n");

@ -32,7 +32,7 @@ class rcube_pw_usermod_password
{
public function save($currpass, $newpass, $username)
{
$cmd = rcmail::get_instance()->config->get('password_pw_usermod_cmd');
$cmd = rcmail::get_instance()->config->get('password_pw_usermod_cmd', 'sudo /usr/sbin/pw usermod -h 0 -n');
$cmd .= ' ' . escapeshellarg($username) . ' > /dev/null';
$handle = popen($cmd, 'w');

@ -41,11 +41,11 @@ class rcube_smb_password
public function save($currpass, $newpass, $username)
{
$host = rcmail::get_instance()->config->get('password_smb_host','localhost');
$bin = rcmail::get_instance()->config->get('password_smb_cmd','/usr/bin/smbpasswd');
$host = rcmail::get_instance()->config->get('password_smb_host', 'localhost');
$bin = rcmail::get_instance()->config->get('password_smb_cmd', '/usr/bin/smbpasswd');
$host = rcube_utils::parse_host($host);
$tmpfile = tempnam(sys_get_temp_dir(),'smb');
$cmd = $bin . ' -r ' . escapeshellarg($host) . ' -s -U "' . escapeshellarg($username) . '" > ' . $tmpfile . ' 2>&1';
$tmpfile = tempnam(sys_get_temp_dir(), 'smb');
$cmd = $bin . ' -r ' . escapeshellarg($host) . ' -s -U ' . escapeshellarg($username) . ' > ' . $tmpfile . ' 2>&1';
$handle = @popen($cmd, 'w');
fwrite($handle, $currpass."\n");

Loading…
Cancel
Save