@@ -258,9 +258,8 @@ public void Upload(Stream source, string path)
258258 channel . Closed += ( sender , e ) => input . Dispose ( ) ;
259259 channel . Open ( ) ;
260260
261- // Pass only the directory part of the path to the server, and use the (hidden) -d option to signal
262- // that we expect the target to be a directory.
263- if ( ! channel . SendExecRequest ( string . Format ( "scp -t -d {0}" , _remotePathTransformation . Transform ( posixPath . Directory ) ) ) )
261+ // Pass only the directory part of the path to the server.
262+ if ( ! channel . SendExecRequest ( string . Format ( "scp -t {0}" , _remotePathTransformation . Transform ( posixPath . Directory ) ) ) )
264263 {
265264 throw SecureExecutionRequestRejectedException ( ) ;
266265 }
@@ -301,9 +300,8 @@ public void Upload(FileInfo fileInfo, string path)
301300 channel . Closed += ( sender , e ) => input . Dispose ( ) ;
302301 channel . Open ( ) ;
303302
304- // Pass only the directory part of the path to the server, and use the (hidden) -d option to signal
305- // that we expect the target to be a directory.
306- if ( ! channel . SendExecRequest ( $ "scp -t -d { _remotePathTransformation . Transform ( posixPath . Directory ) } ") )
303+ // Pass only the directory part of the path to the server.
304+ if ( ! channel . SendExecRequest ( $ "scp -t { _remotePathTransformation . Transform ( posixPath . Directory ) } ") )
307305 {
308306 throw SecureExecutionRequestRejectedException ( ) ;
309307 }
@@ -350,9 +348,8 @@ public void Upload(DirectoryInfo directoryInfo, string path)
350348 // start copy with the following options:
351349 // -p preserve modification and access times
352350 // -r copy directories recursively
353- // -d expect path to be a directory
354351 // -t copy to remote
355- if ( ! channel . SendExecRequest ( $ "scp -r -p -d - t { _remotePathTransformation . Transform ( path ) } ") )
352+ if ( ! channel . SendExecRequest ( $ "scp -r -p -t { _remotePathTransformation . Transform ( path ) } ") )
356353 {
357354 throw SecureExecutionRequestRejectedException ( ) ;
358355 }
0 commit comments