[Pkg-owncloud-commits] [owncloud] 35/90: Prevent leaking db connection info in the stacktrace

David Prévot taffit at moszumanska.debian.org
Fri Feb 6 21:10:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository owncloud.

commit bf1f9df590e45de4bb9a02c3f472ffdbe702bc69
Author: Robin Appelman <icewind at owncloud.com>
Date:   Tue Jan 6 16:54:41 2015 +0100

    Prevent leaking db connection info in the stacktrace
---
 lib/private/db/connection.php | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lib/private/db/connection.php b/lib/private/db/connection.php
index b7981fc..21c12f4 100644
--- a/lib/private/db/connection.php
+++ b/lib/private/db/connection.php
@@ -7,6 +7,7 @@
  */
 
 namespace OC\DB;
+use Doctrine\DBAL\DBALException;
 use Doctrine\DBAL\Driver;
 use Doctrine\DBAL\Configuration;
 use Doctrine\DBAL\Cache\QueryCacheProfile;
@@ -23,6 +24,15 @@ class Connection extends \Doctrine\DBAL\Connection {
 	 */
 	protected $adapter;
 
+	public function connect() {
+		try {
+			return parent::connect();
+		} catch (DBALException $e) {
+			// throw a new exception to prevent leaking info from the stacktrace
+			throw new DBALException($e->getMessage(), $e->getCode());
+		}
+	}
+
 	/**
 	 * @var \Doctrine\DBAL\Driver\Statement[] $preparedQueries
 	 */

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list