From 6bb886b92a426f464026f91addae23a920210d10 Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Mon, 14 May 2012 19:38:07 +0200 Subject: [PATCH] If ssh public key data contain forward slashes, the SyncGit cron job did not properly find and update the region which it should have under its control (thanks to Simon Gareste for the fix!) --- NEWS.mdtext | 5 +++++ src/IDF/Plugin/SyncGit/Cron.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/NEWS.mdtext b/NEWS.mdtext index 4d37b1f..7205df9 100644 --- a/NEWS.mdtext +++ b/NEWS.mdtext @@ -7,6 +7,11 @@ for him (but still no one was actually accessible). This has been fixed. +- Fixed a problem where the SyncGit plugin doesn't properly + updates the authorized_keys file when the public key + data contained slashes (thanks to Simon Gareste for the + fix!) + # InDefero 1.3.2 - Wed May 09 20:05 2012 UTC ## Bugfixes diff --git a/src/IDF/Plugin/SyncGit/Cron.php b/src/IDF/Plugin/SyncGit/Cron.php index ffff9d5..bbbf55e 100644 --- a/src/IDF/Plugin/SyncGit/Cron.php +++ b/src/IDF/Plugin/SyncGit/Cron.php @@ -64,7 +64,7 @@ class IDF_Plugin_SyncGit_Cron // We update only the part of the file between IDF_START / IDF_END comment $original_keys = file_get_contents($authorized_keys); if (strstr($original_keys, "# indefero start") && strstr($original_keys, "# indefero end")) { - $out = preg_replace('/(#\sindefero\sstart).+(#\sindefero\send\s\s?)/isU', + $out = preg_replace('%(#\sindefero\sstart).+(#\sindefero\send\s\s?)%isU', $out, $original_keys); } else { $out .= $original_keys;