Falko Timme
2014-06-19 117ecd60c809bbc19a3c1f795f6db9e53465cdec
install/lib/installer_base.lib.php
@@ -690,7 +690,7 @@
      if(!is_user($cf['vmail_username'])) caselog("$command &> /dev/null", __FILE__, __LINE__, "EXECUTED: $command", "Failed to execute the command $command");
      //* These postconf commands will be executed on installation and update
      $server_ini_rec = $this->db->queryOneRecord("SELECT config FROM server WHERE server_id = ".$conf['server_id']);
      $server_ini_rec = $this->db->queryOneRecord("SELECT config FROM `" . $this->db->quote($conf["mysql"]["database"]) . "`.`server` WHERE server_id = ".$conf['server_id']);
      $server_ini_array = ini_to_array(stripslashes($server_ini_rec['config']));
      unset($server_ini_rec);
@@ -750,8 +750,13 @@
      if(!stristr($options, 'dont-create-certs')) {
         //* Create the SSL certificate
         $command = 'cd '.$config_dir.'; '
            .'openssl req -new -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509';
         if(is_file('autoinstall.conf.php')){
            $command = 'cd '.$config_dir.'; '
               .'openssl req -new -subj \'/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd\' -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509';
         } else {
            $command = 'cd '.$config_dir.'; '
               .'openssl req -new -outform PEM -out smtpd.cert -newkey rsa:4096 -nodes -keyout smtpd.key -keyform PEM -days 3650 -x509';
         }
         exec($command);
         $command = 'chmod o= '.$config_dir.'/smtpd.key';
@@ -1683,7 +1688,11 @@
      $ssl_pw = substr(md5(mt_rand()), 0, 6);
      exec("openssl genrsa -des3 -passout pass:$ssl_pw -out $ssl_key_file 4096");
      exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -out $ssl_csr_file");
      if(is_file('autoinstall.conf.php')){
         exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -subj '/C=AU/ST=Some-State/O=Internet Widgits Pty Ltd' -key $ssl_key_file -out $ssl_csr_file");
      } else {
         exec("openssl req -new -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -out $ssl_csr_file");
      }
      exec("openssl req -x509 -passin pass:$ssl_pw -passout pass:$ssl_pw -key $ssl_key_file -in $ssl_csr_file -out $ssl_crt_file -days 3650");
      exec("openssl rsa -passin pass:$ssl_pw -in $ssl_key_file -out $ssl_key_file.insecure");
      rename($ssl_key_file, $ssl_key_file.'.secure');