diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-07 09:46:37 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-11-17 10:48:14 +0100 |
commit | 39ae569c5cafda5e15865699ff17b9734020329e (patch) | |
tree | cf21bbbc54bac468fe47c2a245e9b6186a8517a5 | |
parent | b228226700965c696f6fc7196ef7f8f067885958 (diff) | |
download | nextcloud-server-39ae569c5cafda5e15865699ff17b9734020329e.tar.gz nextcloud-server-39ae569c5cafda5e15865699ff17b9734020329e.zip |
Correctly close handle of directory when listing certificates
-rw-r--r-- | lib/private/security/certificatemanager.php | 1 | ||||
-rw-r--r-- | tests/lib/security/certificatemanager.php | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/security/certificatemanager.php b/lib/private/security/certificatemanager.php index cae9730eb26..a2a4c8b83d2 100644 --- a/lib/private/security/certificatemanager.php +++ b/lib/private/security/certificatemanager.php @@ -49,6 +49,7 @@ class CertificateManager implements ICertificateManager { } catch(\Exception $e) {} } } + closedir($handle); return $result; } diff --git a/tests/lib/security/certificatemanager.php b/tests/lib/security/certificatemanager.php index 5baf9e16e81..01b3afb03ee 100644 --- a/tests/lib/security/certificatemanager.php +++ b/tests/lib/security/certificatemanager.php @@ -8,7 +8,7 @@ use \OC\Security\CertificateManager; -class CertificateManagerTest extends \PHPUnit_Framework_TestCase { +class CertificateManagerTest extends \Test\TestCase { /** @var CertificateManager */ private $certificateManager; @@ -18,8 +18,8 @@ class CertificateManagerTest extends \PHPUnit_Framework_TestCase { private $user; function setUp() { - $this->username = OC_Util::generateRandomBytes(20); - OC_User::createUser($this->username, OC_Util::generateRandomBytes(20)); + $this->username = $this->getUniqueID('', 20); + OC_User::createUser($this->username, $this->getUniqueID('', 20)); \OC_Util::tearDownFS(); \OC_User::setUserId(''); |