From 5c93f0844f2482d597411c47e0e75849d59491c6 Mon Sep 17 00:00:00 2001 From: Till Brehm Date: Tue, 1 Apr 2014 11:08:48 +0200 Subject: [PATCH] Fixed: FS#3420 - SSH user keys get replaced in website Fixed a bug in Opensuse installer (permissions of squirrelmail files) Fixed a issue in smtp-authentication on courier-imap systems when custom usernames are used. --- install/dist/lib/opensuse.lib.php | 3 +++ install/tpl/sasl_smtpd2.conf.master | 2 +- server/plugins-available/shelluser_base_plugin.inc.php | 10 +++++++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/install/dist/lib/opensuse.lib.php b/install/dist/lib/opensuse.lib.php index fdb7af0358..35f60db9cc 100644 --- a/install/dist/lib/opensuse.lib.php +++ b/install/dist/lib/opensuse.lib.php @@ -1094,6 +1094,9 @@ class installer_dist extends installer_base { $command = 'usermod -a -G ispapps '.$conf['nginx']['user']; caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); } + // add nobody user to www group, as the default php-fpm pool from opensuse runs as nobody + $command = 'usermod -a -G www nobody'; + caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command"); } //* Make the shell scripts executable diff --git a/install/tpl/sasl_smtpd2.conf.master b/install/tpl/sasl_smtpd2.conf.master index f24b998d88..85d192e721 100644 --- a/install/tpl/sasl_smtpd2.conf.master +++ b/install/tpl/sasl_smtpd2.conf.master @@ -7,4 +7,4 @@ sql_hostnames: {mysql_server_ip} sql_user: {mysql_server_ispconfig_user} sql_passwd: {mysql_server_ispconfig_password} sql_database: {mysql_server_database} -sql_select: select password from mail_user where login = '%u@%r' and postfix = 'y' +sql_select: select password from mail_user where (login = '%u' or login = '%u@%r') and postfix = 'y' diff --git a/server/plugins-available/shelluser_base_plugin.inc.php b/server/plugins-available/shelluser_base_plugin.inc.php index 6df3d06cfe..0ceced99d0 100755 --- a/server/plugins-available/shelluser_base_plugin.inc.php +++ b/server/plugins-available/shelluser_base_plugin.inc.php @@ -246,7 +246,15 @@ class shelluser_base_plugin { unset($client_data); // ssh-rsa authentication variables - $sshrsa = $this->data['new']['ssh_rsa']; + //$sshrsa = $this->data['new']['ssh_rsa']; + $sshrsa = ''; + $ssh_users = $app->db->queryAllRecords("SELECT ssh_rsa FROM shell_user WHERE parent_domain_id = ".intval($this->data['new']['parent_domain_id'])); + if(is_array($ssh_users)) { + foreach($ssh_users as $sshu) { + if($sshu['ssh_rsa'] != '') $sshrsa .= "\n".$sshu['ssh_rsa']; + } + } + $sshrsa = trim($sshrsa); $usrdir = escapeshellcmd($this->data['new']['dir']); $sshdir = $usrdir.'/.ssh'; $sshkeys= $usrdir.'/.ssh/authorized_keys'; -- GitLab