From 8c8234fe522ba4154c4ae73a73f93cc830aab74d Mon Sep 17 00:00:00 2001
From: Brian Canini <canini.16@osu.edu>
Date: Fri, 3 Apr 2020 10:43:06 -0400
Subject: [PATCH] Fixing SSO config file used by composer

---
 composer.lock                                       |  5 ++++-
 config/simplesamlphp/config/config.php              | 13 +++++++++++--
 .../simplesamlphp/simplesamlphp/config/config.php   | 13 +++++++++++--
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/composer.lock b/composer.lock
index ecc4c6fa52..d61ecec2e4 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
         "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
         "This file is @generated automatically"
     ],
-    "content-hash": "0aa82f90fabcef16c98c4cd3de1941ee",
+    "content-hash": "8086d330dc9c96db5ffdc91d54b984b5",
     "packages": [
         {
             "name": "alchemy/zippy",
@@ -5228,6 +5228,9 @@
                         "status": "covered",
                         "message": "Covered by Drupal's security advisory policy"
                     }
+                },
+                "patches_applied": {
+                    "2811189": "https://www.drupal.org/files/issues/2019-08-08/honeypot_field_weight_2811189-18.patch"
                 }
             },
             "notification-url": "https://packages.drupal.org/8/downloads",
diff --git a/config/simplesamlphp/config/config.php b/config/simplesamlphp/config/config.php
index c4b5de123a..578d36b001 100644
--- a/config/simplesamlphp/config/config.php
+++ b/config/simplesamlphp/config/config.php
@@ -6,7 +6,7 @@
 if (empty($_SERVER['PATH_INFO']) && !empty($_SERVER['DOCUMENT_URI'])) {
     $index = strpos($_SERVER['DOCUMENT_URI'], '.php');
     if($index) {
-            $_SERVER['PATH_INFO'] = substr($_SERVER['DOCUMENT_URI'], $index+4);
+      $_SERVER['PATH_INFO'] = substr($_SERVER['DOCUMENT_URI'], $index+4);
     }
 }
 
@@ -22,6 +22,15 @@
 $drop_id = $ps['conf']['pantheon_binding'];
 $db = $ps['databases']['default']['default'];
 
+
+if($_SERVER['HOME'] == '/') {
+  $temp_path = '/tmp';
+}
+else {
+  $temp_path = $_SERVER['HOME'] . '/tmp/simplesaml';
+}
+// error_log("temp_path: " . $temp_path);
+
 //  Set metadata path
 $metadata_folder = __DIR__ . '/../../../../web/sites/default/files/private/simplesamlphp/metadata';
 // error_log("config.php - metadata_folder: $metadata_folder");
@@ -126,7 +135,7 @@
     'certdir' => $cert_folder,
     'loggingdir' => 'log/',
     'datadir' => 'data/',
-    'tempdir'               =>  '/srv/bindings/' . $drop_id . '/tmp/simplesaml',
+    'tempdir'               =>  $temp_path,
     'supressportnumber'     => TRUE,
     'cronkey'				=> '5nvD3MgHLDDStnEKgK0au3vhqEjNNnvkHLmbVWvObIl2lpx0guXx5h',
 
diff --git a/vendor/simplesamlphp/simplesamlphp/config/config.php b/vendor/simplesamlphp/simplesamlphp/config/config.php
index c4b5de123a..578d36b001 100644
--- a/vendor/simplesamlphp/simplesamlphp/config/config.php
+++ b/vendor/simplesamlphp/simplesamlphp/config/config.php
@@ -6,7 +6,7 @@
 if (empty($_SERVER['PATH_INFO']) && !empty($_SERVER['DOCUMENT_URI'])) {
     $index = strpos($_SERVER['DOCUMENT_URI'], '.php');
     if($index) {
-            $_SERVER['PATH_INFO'] = substr($_SERVER['DOCUMENT_URI'], $index+4);
+      $_SERVER['PATH_INFO'] = substr($_SERVER['DOCUMENT_URI'], $index+4);
     }
 }
 
@@ -22,6 +22,15 @@
 $drop_id = $ps['conf']['pantheon_binding'];
 $db = $ps['databases']['default']['default'];
 
+
+if($_SERVER['HOME'] == '/') {
+  $temp_path = '/tmp';
+}
+else {
+  $temp_path = $_SERVER['HOME'] . '/tmp/simplesaml';
+}
+// error_log("temp_path: " . $temp_path);
+
 //  Set metadata path
 $metadata_folder = __DIR__ . '/../../../../web/sites/default/files/private/simplesamlphp/metadata';
 // error_log("config.php - metadata_folder: $metadata_folder");
@@ -126,7 +135,7 @@
     'certdir' => $cert_folder,
     'loggingdir' => 'log/',
     'datadir' => 'data/',
-    'tempdir'               =>  '/srv/bindings/' . $drop_id . '/tmp/simplesaml',
+    'tempdir'               =>  $temp_path,
     'supressportnumber'     => TRUE,
     'cronkey'				=> '5nvD3MgHLDDStnEKgK0au3vhqEjNNnvkHLmbVWvObIl2lpx0guXx5h',
 
-- 
GitLab