Skip to content

Commit

Permalink
Set SMB2 as default highest allowed protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
oNeDaL committed Dec 14, 2017
1 parent 61dc270 commit 3509f77
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Mike42/Escpos/PrintConnectors/WindowsPrintConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ protected function finalizeLinux($data)
if ($this -> userPassword == null) {
// No password
$command = sprintf(
"smbclient %s -U %s -c %s -N",
"smbclient %s -U %s -c %s -N -m SMB2",
escapeshellarg($device),
escapeshellarg($user),
escapeshellarg("print -")
Expand All @@ -202,14 +202,14 @@ protected function finalizeLinux($data)
} else {
// With password
$command = sprintf(
"smbclient %s %s -U %s -c %s",
"smbclient %s %s -U %s -c %s -m SMB2",
escapeshellarg($device),
escapeshellarg($this -> userPassword),
escapeshellarg($user),
escapeshellarg("print -")
);
$redactedCommand = sprintf(
"smbclient %s %s -U %s -c %s",
"smbclient %s %s -U %s -c %s -m SMB2",
escapeshellarg($device),
escapeshellarg("*****"),
escapeshellarg($user),
Expand All @@ -219,7 +219,7 @@ protected function finalizeLinux($data)
} else {
// No authentication information at all
$command = sprintf(
"smbclient %s -c %s -N",
"smbclient %s -c %s -N -m SMB2",
escapeshellarg($device),
escapeshellarg("print -")
);
Expand All @@ -242,7 +242,7 @@ protected function finalizeMac($data)
{
throw new Exception("Mac printing not implemented.");
}

/**
* Send data to printer -- platform-specific Windows code.
*
Expand Down Expand Up @@ -298,7 +298,7 @@ protected function finalizeWin($data)
}
}
}

/**
* @return string Current platform. Separated out for testing purposes.
*/
Expand All @@ -312,7 +312,7 @@ protected function getCurrentPlatform()
}
return self::PLATFORM_LINUX;
}

/* (non-PHPdoc)
* @see PrintConnector::read()
*/
Expand All @@ -321,7 +321,7 @@ public function read($len)
/* Two-way communication is not supported */
return false;
}

/**
* Run a command, pass it data, and retrieve its return value, standard output, and standard error.
*
Expand Down Expand Up @@ -359,7 +359,7 @@ protected function runCommand($command, &$outputStr, &$errorStr, $inputStr = nul
return -1;
}
}

/**
* Copy a file. Separated out so that nothing is actually printed during test runs.
*
Expand All @@ -371,7 +371,7 @@ protected function runCopy($from, $to)
{
return copy($from, $to);
}

/**
* Write data to a file. Separated out so that nothing is actually printed during test runs.
*
Expand Down

0 comments on commit 3509f77

Please sign in to comment.