ssh-client-wrapper 3.1.0 → 3.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/rsyncExec.js +8 -3
  2. package/package.json +1 -1
package/lib/rsyncExec.js CHANGED
@@ -116,10 +116,15 @@ async function isNewRsync(hostInfo) {
116
116
  */
117
117
  export async function recv(hostInfo, argSrc, dst, rsyncOpt, timeout, retryableExitCodes, replaceRetryableExitCodes) {
118
118
  await connect(hostInfo);
119
- const src = `${hostInfo.host}:${argSrc.join(" ")}`;
119
+ //pass each source as its own "host:path" argument. Joining them into one
120
+ //space separated argument relies on the remote shell to split it, which
121
+ //rsync >= 3.4 (protected args) no longer does.
122
+ const src = argSrc.map((e)=>{
123
+ return `${hostInfo.host}:${e}`;
124
+ });
120
125
  const sshArgs = getSshOption(hostInfo, true);
121
126
  const rshOpt = ["-e", `${sshCmd} ${sshArgs.join(" ")}`];
122
- const args = ["-avv", "--copy-unsafe-links", ...rshOpt, ...rsyncOpt, src, dst];
127
+ const args = ["-avv", "--copy-unsafe-links", ...rshOpt, ...rsyncOpt, ...src, dst];
123
128
  if (await isNewRsync(hostInfo)) {
124
129
  args.unshift("--old-args");
125
130
  }
@@ -128,7 +133,7 @@ export async function recv(hostInfo, argSrc, dst, rsyncOpt, timeout, retryableEx
128
133
  const dstDir = argSrc.len > 1 || hasMagic(argSrc[0]) ? dst : path.dirname(dst);
129
134
  await fs.mkdir(dstDir, { recursive: true });
130
135
 
131
- debug(`recv ${src} to ${dst}`);
136
+ debug(`recv ${src.join(" ")} to ${dst}`);
132
137
  debugVerbose(`recv: ${rsyncCmd} ${args.join(" ")}`);
133
138
  const exitCodes = resolveRetryableExitCodes(hostInfo, retryableExitCodes, replaceRetryableExitCodes);
134
139
  return retryWrapper(fork.bind(null, hostInfo, rsyncCmd, args, timeout, null, exitCodes), hostInfo);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ssh-client-wrapper",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "wrapper library for open ssh client and rsync",
5
5
  "keywords": [
6
6
  "ssh",