scp, ssh commands: hide the real fs path on errors

The underlying filesystem errors for permissions and non-existing files
can contain the real storage path.
Map these errors to more generic ones to avoid to leak this info

Fixes #109
This commit is contained in:
Nicola Murino
2020-04-22 12:26:18 +02:00
parent 4f668bf558
commit 0a47412e8c
3 changed files with 47 additions and 34 deletions

View File

@@ -1195,6 +1195,7 @@ func TestSCPParseUploadMessage(t *testing.T) {
}
connection := Connection{
channel: &mockSSHChannel,
fs: vfs.NewOsFs("", os.TempDir(), nil),
}
scpCommand := scpCommand{
sshCommand: sshCommand{
@@ -1632,6 +1633,7 @@ func TestSCPUploadFiledata(t *testing.T) {
},
protocol: protocolSCP,
channel: &mockSSHChannel,
fs: vfs.NewOsFs("", os.TempDir(), nil),
}
scpCommand := scpCommand{
sshCommand: sshCommand{