Skip to content

Commit 4c794a5

Browse files
author
Florian Schaal
committed
Suppress output from exec
1 parent 06787de commit 4c794a5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

interface/web/mail/mail_domain_dkim_create.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function get_public_key($private_key) {
8080
require_once('../../lib/classes/validate_dkim.inc.php');
8181
$validate_dkim=new validate_dkim ();
8282
if($validate_dkim->validate_post('private',$private_key)) { /* validate the $_POST-value */
83-
exec('echo '.escapeshellarg($private_key).'|openssl rsa -pubout -outform PEM',$pubkey,$result);
83+
exec('echo '.escapeshellarg($private_key).'|openssl rsa -pubout -outform PEM 2> /dev/null',$pubkey,$result);
8484
$public_key=pub_key($pubkey);
8585
} else {
8686
$public_key='invalid key';
@@ -92,8 +92,8 @@ function get_public_key($private_key) {
9292

9393
switch ($_POST['action']) {
9494
case 'create': /* create DKIM Private-key */
95-
exec('openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096', $output, $result);
96-
exec('openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024', $privkey, $result);
95+
exec('openssl rand -out /usr/local/ispconfig/server/temp/random-data.bin 4096 2> /dev/null', $output, $result);
96+
exec('openssl genrsa -rand /usr/local/ispconfig/server/temp/random-data.bin 1024 2> /dev/null', $privkey, $result);
9797
unlink("/usr/local/ispconfig/server/temp/random-data.bin");
9898
foreach($privkey as $values) $private_key=$private_key.$values."\n";
9999
break;

server/plugins-available/mail_plugin_dkim.inc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ function write_dkim_key($key_file, $key_value, $key_domain) {
181181
$app->log('Saved DKIM Private-key to '.$key_file.'.private', LOGLEVEL_DEBUG);
182182
$success=true;
183183
/* now we get the DKIM Public-key */
184-
exec('cat '.escapeshellarg($key_file.'.private').'|openssl rsa -pubout', $pubkey, $result);
184+
exec('cat '.escapeshellarg($key_file.'.private').'|openssl rsa -pubout 2> /dev/null', $pubkey, $result);
185185
$public_key='';
186186
foreach($pubkey as $values) $public_key=$public_key.$values."\n";
187187
/* save the DKIM Public-key in dkim-dir */

0 commit comments

Comments
 (0)