Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set SMB2 as default highest allowed protocol #488

Merged
merged 1 commit into from
Mar 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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