mirror of
https://codeberg.org/icewind/SMB.git
synced 2026-06-03 17:24:07 +02:00
Add test cases for invalid server configurations
This commit is contained in:
parent
c94eea8294
commit
190ac9501d
2 changed files with 25 additions and 6 deletions
|
|
@ -87,14 +87,17 @@ class Server {
|
|||
exec($command, $output);
|
||||
|
||||
$line = $output[0];
|
||||
$authError = 'NT_STATUS_LOGON_FAILURE';
|
||||
if (substr($line, -23) === $authError) {
|
||||
$this->pipes = array(null, null);
|
||||
$line = rtrim($line, ')');
|
||||
if (substr($line, -23) === 'NT_STATUS_LOGON_FAILURE') {
|
||||
throw new AuthenticationException();
|
||||
}
|
||||
$addressError = 'NT_STATUS_BAD_NETWORK_NAME';
|
||||
if (substr($line, -26) === $addressError) {
|
||||
$this->pipes = array(null, null);
|
||||
if (substr($line, -26) === 'NT_STATUS_BAD_NETWORK_NAME') {
|
||||
throw new InvalidHostException();
|
||||
}
|
||||
if (substr($line, -22) === 'NT_STATUS_UNSUCCESSFUL') {
|
||||
throw new InvalidHostException();
|
||||
}
|
||||
if (substr($line, -28) === 'NT_STATUS_CONNECTION_REFUSED') {
|
||||
throw new InvalidHostException();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue