summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorFelix Dörre <felix@dogcraft.de>2014-06-15 11:48:10 +0200
committerFelix Dörre <felix@dogcraft.de>2014-06-15 11:48:10 +0200
commitfdd9deca5f34f034c726fbeb6951b4ec707c35a5 (patch)
tree9534b513a50c6190509a11c1451f9e203ece436a /includes
parentb6ee5404b9dcc3df6ace5f640f522118d18b818d (diff)
downloadcacert-devel-fdd9deca5f34f034c726fbeb6951b4ec707c35a5.tar.gz
cacert-devel-fdd9deca5f34f034c726fbeb6951b4ec707c35a5.tar.xz
cacert-devel-fdd9deca5f34f034c726fbeb6951b4ec707c35a5.zip
bug 1273: use runCommand where former "echo"-syntax was used
Diffstat (limited to 'includes')
-rw-r--r--includes/account.php13
1 files changed, 9 insertions, 4 deletions
diff --git a/includes/account.php b/includes/account.php
index 0f2f05d..a5d1eef 100644
--- a/includes/account.php
+++ b/includes/account.php
@@ -2812,8 +2812,10 @@ function buildSubjectFromSession() {
{
$CSR = clean_csr($CSR);
$_SESSION['_config']['CSR'] = $CSR;
- $_SESSION['_config']['subject'] = trim(shell_exec("echo \"$CSR\"|/usr/bin/openssl req -text -noout|tr -d \"\\0\"|grep \"Subject:\""));
- $bits = explode(",", trim(shell_exec("echo \"$CSR\"|/usr/bin/openssl req -text -noout|tr -d \"\\0\"|grep -A1 'X509v3 Subject Alternative Name:'|grep DNS:")));
+ runCommand("/usr/bin/openssl req -text -noout|tr -d \"\\0\"|grep \"Subject:\"", $CSR, $CSRSubjects);
+ runCommand("/usr/bin/openssl req -text -noout|tr -d \"\\0\"|grep -A1 'X509v3 Subject Alternative Name:'|grep DNS:", $CSR, $CSRAlts);
+ $_SESSION['_config']['subject'] = trim($CSRSubjects);
+ $bits = explode(",", trim($CSRAlts));
foreach($bits as $val)
{
$_SESSION['_config']['subject'] .= "/subjectAltName=".trim($val);
@@ -2837,8 +2839,11 @@ function buildSubjectFromSession() {
if($process != "" && $oldid == 46)
{
$CSR = clean_csr($_SESSION['_config']['CSR']);
- $_SESSION['_config']['subject'] = trim(shell_exec("echo \"$CSR\"|/usr/bin/openssl req -text -noout|tr -d \"\\0\"|grep \"Subject:\""));
- $bits = explode(",", trim(shell_exec("echo \"$CSR\"|/usr/bin/openssl req -text -noout|tr -d \"\\0\"|grep -A1 'X509v3 Subject Alternative Name:'|grep DNS:")));
+ runCommand("/usr/bin/openssl req -text -noout|tr -d \"\\0\"|grep \"Subject:\"", $CSR, $CSRSubjects);
+ runCommand("/usr/bin/openssl req -text -noout|tr -d \"\\0\"|grep -A1 'X509v3 Subject Alternative Name:'|grep DNS:", $CSR, $CSRAlts);
+
+ $_SESSION['_config']['subject'] = trim($CSRSubjects);
+ $bits = explode(",", trim($CSRAlts));
foreach($bits as $val)
{
$_SESSION['_config']['subject'] .= "/subjectAltName=".trim($val);