Skip to content

Commit 03bff7c

Browse files
committed
- Added a fix for opensuse regarding issue: FS#1250 - smtp file in pam.d directory on some distributions is world readable.
1 parent 9287065 commit 03bff7c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

install/dist/lib/fedora.lib.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,8 @@ public function configure_pam()
232232
$content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content);
233233
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
234234
wf("$pam/smtp", $content);
235+
// On some OSes smtp is world readable which allows for reading database information. Removing world readable rights should have no effect.
236+
if(is_file("$pam/smtp")) exec("chmod o= $pam/smtp");
235237
//exec("chmod 660 $pam/smtp");
236238
//exec("chown root:root $pam/smtp");
237239

install/dist/lib/opensuse.lib.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ public function configure_pam()
271271
$content = str_replace('{mysql_server_database}', $conf['mysql']['database'], $content);
272272
$content = str_replace('{mysql_server_ip}', $conf['mysql']['ip'], $content);
273273
wf("$pam/smtp", $content);
274+
// On some OSes smtp is world readable which allows for reading database information. Removing world readable rights should have no effect.
275+
if(is_file("$pam/smtp")) exec("chmod o= $pam/smtp");
274276
//exec("chmod 660 $pam/smtp");
275277
//exec("chown root:root $pam/smtp");
276278

0 commit comments

Comments
 (0)