Skip to content

Commit 5c93f08

Browse files
author
Till Brehm
committed
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.
1 parent ac7ef78 commit 5c93f08

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

install/dist/lib/opensuse.lib.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,6 +1094,9 @@ public function install_ispconfig()
10941094
$command = 'usermod -a -G ispapps '.$conf['nginx']['user'];
10951095
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10961096
}
1097+
// add nobody user to www group, as the default php-fpm pool from opensuse runs as nobody
1098+
$command = 'usermod -a -G www nobody';
1099+
caselog($command.' &> /dev/null', __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
10971100
}
10981101

10991102
//* Make the shell scripts executable

install/tpl/sasl_smtpd2.conf.master

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ sql_hostnames: {mysql_server_ip}
77
sql_user: {mysql_server_ispconfig_user}
88
sql_passwd: {mysql_server_ispconfig_password}
99
sql_database: {mysql_server_database}
10-
sql_select: select password from mail_user where login = '%u@%r' and postfix = 'y'
10+
sql_select: select password from mail_user where (login = '%u' or login = '%u@%r') and postfix = 'y'

server/plugins-available/shelluser_base_plugin.inc.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,15 @@ private function _setup_ssh_rsa() {
246246
unset($client_data);
247247

248248
// ssh-rsa authentication variables
249-
$sshrsa = $this->data['new']['ssh_rsa'];
249+
//$sshrsa = $this->data['new']['ssh_rsa'];
250+
$sshrsa = '';
251+
$ssh_users = $app->db->queryAllRecords("SELECT ssh_rsa FROM shell_user WHERE parent_domain_id = ".intval($this->data['new']['parent_domain_id']));
252+
if(is_array($ssh_users)) {
253+
foreach($ssh_users as $sshu) {
254+
if($sshu['ssh_rsa'] != '') $sshrsa .= "\n".$sshu['ssh_rsa'];
255+
}
256+
}
257+
$sshrsa = trim($sshrsa);
250258
$usrdir = escapeshellcmd($this->data['new']['dir']);
251259
$sshdir = $usrdir.'/.ssh';
252260
$sshkeys= $usrdir.'/.ssh/authorized_keys';

0 commit comments

Comments
 (0)