From 3c41bd80ba3fee7950165a392d70f3f4078610bb Mon Sep 17 00:00:00 2001 From: cajus Date: Tue, 12 Oct 2010 07:15:17 +0000 Subject: [PATCH] Applied patch from bcooksley to handle key uploads git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19985 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/ssh/personal/ssh/class_sshPublicKey.inc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gosa-plugins/ssh/personal/ssh/class_sshPublicKey.inc b/gosa-plugins/ssh/personal/ssh/class_sshPublicKey.inc index e478d329b..610e4d4a5 100644 --- a/gosa-plugins/ssh/personal/ssh/class_sshPublicKey.inc +++ b/gosa-plugins/ssh/personal/ssh/class_sshPublicKey.inc @@ -122,7 +122,13 @@ class sshPublicKey extends plugin msg_dialog::display(_("Upload error"), _("Error uploading the key!")." (".$_FILES['key']['error'].")", ERROR_DIALOG); } else { - $lines= file($_FILES['key']['tmp_name']); + // On some systems we can not operate on this tmp file. We need to + // explicitely copy it first + $tempfile= tempnam(sys_get_temp_dir(), 'GOsa'); + move_uploaded_file($_FILES['key']['tmp_name'], $tempfile); + $lines= file($tempfile); + unlink($tempfile); + foreach ($lines as $line) { if (preg_match('/^(ssh-(dss|rsa))\s+([a-zA-Z0-9+\/.=]+)\s+([[:print:]]+)$/', $line, $match)) { $fingerprint= $this->fingerprint(base64_decode($match[3])); -- 2.30.2