From 81ce4688df366e6ba977ccd56b9573b935ad1d7a Mon Sep 17 00:00:00 2001 From: Thomas Keller Date: Sat, 28 May 2011 01:05:10 +0200 Subject: [PATCH] Let the SVN command line client not store the login credentials we give him. --- NEWS.mdtext | 1 + src/IDF/Scm/Svn.php | 32 ++++++++++++++++---------------- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/NEWS.mdtext b/NEWS.mdtext index 8d6df37..8820900 100644 --- a/NEWS.mdtext +++ b/NEWS.mdtext @@ -11,6 +11,7 @@ - Timeline only displays filter options for items a user has actually access to (issue 655) - The log, tags and branches parsers for Mercurial are more robust now (issue 663) - Fix SSH public key parsing issues and improve the check for existing, uploaded keys (issue 679) +- Let the SVN command line client not store the login credentials we give him as arguments ## Documentation diff --git a/src/IDF/Scm/Svn.php b/src/IDF/Scm/Svn.php index 9195a4b..791624f 100644 --- a/src/IDF/Scm/Svn.php +++ b/src/IDF/Scm/Svn.php @@ -48,7 +48,7 @@ class IDF_Scm_Svn extends IDF_Scm public function isAvailable() { - $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --xml --username=%s --password=%s %s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s %s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo)); @@ -163,7 +163,7 @@ class IDF_Scm_Svn extends IDF_Scm return IDF_Scm::REVISION_VALID; } - $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo), @@ -191,7 +191,7 @@ class IDF_Scm_Svn extends IDF_Scm } // Else, test the path on revision - $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --xml --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/'.self::smartEncode($path)), @@ -218,7 +218,7 @@ class IDF_Scm_Svn extends IDF_Scm public function getTree($commit, $folder='/', $branch=null) { - $cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --xml --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --xml --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/'.self::smartEncode($folder)), @@ -260,7 +260,7 @@ class IDF_Scm_Svn extends IDF_Scm if (isset($this->cache['commitmess'][$rev])) { return $this->cache['commitmess'][$rev]; } - $cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml --limit 1 --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml --limit 1 --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo), @@ -281,7 +281,7 @@ class IDF_Scm_Svn extends IDF_Scm if ($rev == null) { $rev = 'HEAD'; } - $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --xml --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/'.self::smartEncode($filename)), @@ -308,7 +308,7 @@ class IDF_Scm_Svn extends IDF_Scm public function getFile($def, $cmd_only=false) { - $cmd = sprintf(Pluf::f('svn_path', 'svn').' cat --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' cat --no-auth-cache --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/'.self::smartEncode($def->fullpath)), @@ -329,7 +329,7 @@ class IDF_Scm_Svn extends IDF_Scm return $this->cache['branches']; } $res = array(); - $cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --username=%s --password=%s %s@HEAD', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --username=%s --password=%s %s@HEAD', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/branches')); @@ -344,7 +344,7 @@ class IDF_Scm_Svn extends IDF_Scm } } ksort($res); - $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --username=%s --password=%s %s@HEAD', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --username=%s --password=%s %s@HEAD', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/trunk')); @@ -368,7 +368,7 @@ class IDF_Scm_Svn extends IDF_Scm return $this->cache['tags']; } $res = array(); - $cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --username=%s --password=%s %s@HEAD', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' ls --no-auth-cache --username=%s --password=%s %s@HEAD', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/tags')); @@ -426,7 +426,7 @@ class IDF_Scm_Svn extends IDF_Scm return false; } $res = array(); - $cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml --limit 1 -v --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml --limit 1 -v --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo), @@ -473,7 +473,7 @@ class IDF_Scm_Svn extends IDF_Scm private function getDiff($rev='HEAD') { $res = array(); - $cmd = sprintf(Pluf::f('svn_path', 'svn').' diff -c %s --username=%s --password=%s %s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' diff --no-auth-cache -c %s --username=%s --password=%s %s', escapeshellarg($rev), escapeshellarg($this->username), escapeshellarg($this->password), @@ -498,7 +498,7 @@ class IDF_Scm_Svn extends IDF_Scm $branch = 'HEAD'; } $res = array(); - $cmd = sprintf(Pluf::f('svn_path', 'svn').' log --xml -v --limit %s --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' log --no-auth-cache --xml -v --limit %s --username=%s --password=%s %s@%s', escapeshellarg($n), escapeshellarg($this->username), escapeshellarg($this->password), @@ -531,7 +531,7 @@ class IDF_Scm_Svn extends IDF_Scm public function getProperties($rev, $path='') { $res = array(); - $cmd = sprintf(Pluf::f('svn_path', 'svn').' proplist --xml --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' proplist --no-auth-cache --xml --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo.'/'.self::smartEncode($path)), @@ -566,7 +566,7 @@ class IDF_Scm_Svn extends IDF_Scm private function getProperty($property, $rev, $path='') { $res = array(); - $cmd = sprintf(Pluf::f('svn_path', 'svn').' propget --xml %s --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' propget --no-auth-cache --xml %s --username=%s --password=%s %s@%s', escapeshellarg($property), escapeshellarg($this->username), escapeshellarg($this->password), @@ -590,7 +590,7 @@ class IDF_Scm_Svn extends IDF_Scm public function getLastCommit($rev='HEAD') { $xmlInfo = ''; - $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --xml --username=%s --password=%s %s@%s', + $cmd = sprintf(Pluf::f('svn_path', 'svn').' info --no-auth-cache --xml --username=%s --password=%s %s@%s', escapeshellarg($this->username), escapeshellarg($this->password), escapeshellarg($this->repo),