Skip to content

Commit 4d2ed93

Browse files
committed
Merge pull request #674
2 parents eaad2ef + d7a943c commit 4d2ed93

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

src/libmongoc

Submodule libmongoc updated 79 files

tests/connect/bug1045.phpt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
--TEST--
2+
PHPC-1045: Segfault if username is not provided for SCRAM-SHA-1 authMechanism
3+
--SKIPIF--
4+
<?php require __DIR__ . "/../utils/basic-skipif.inc"; ?>
5+
<?php NEEDS('STANDALONE'); CLEANUP(STANDALONE); ?>
6+
--FILE--
7+
<?php
8+
9+
require_once __DIR__ . "/../utils/basic.inc";
10+
11+
// STANDALONE does not support auth, but that is not necessary for the test
12+
$m = new MongoDB\Driver\Manager(STANDALONE, ['authMechanism' => 'SCRAM-SHA-1', 'ssl' => false]);
13+
14+
// Execute a basic ping command to trigger connection initialization
15+
echo throws(function() use ($m) {
16+
$m->executeCommand('admin', new MongoDB\Driver\Command(['ping'=>1]));
17+
}, 'MongoDB\Driver\Exception\RuntimeException'), "\n";
18+
19+
?>
20+
===DONE===
21+
<?php exit(0); ?>
22+
--EXPECTF--
23+
OK: Got MongoDB\Driver\Exception\RuntimeException
24+
SCRAM Failure: username is not set
25+
===DONE===

0 commit comments

Comments
 (0)