Skip to content

Commit

Permalink
Correctly close handle of directory when listing certificates
Browse files Browse the repository at this point in the history
  • Loading branch information
nickvergessen committed Nov 17, 2014
1 parent b228226 commit 39ae569
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/private/security/certificatemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function listCertificates() {
} catch(\Exception $e) {}
}
}
closedir($handle);
return $result;
}

Expand Down
6 changes: 3 additions & 3 deletions tests/lib/security/certificatemanager.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

use \OC\Security\CertificateManager;

class CertificateManagerTest extends \PHPUnit_Framework_TestCase {
class CertificateManagerTest extends \Test\TestCase {

/** @var CertificateManager */
private $certificateManager;
Expand All @@ -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('');
Expand Down

0 comments on commit 39ae569

Please sign in to comment.