only chmod if pied

pull/83871/head
Brian Coca 3 months ago
parent 89906c55fe
commit f478855e0f

@ -1264,9 +1264,10 @@ class Connection(ConnectionBase):
# Check the return code and rollover to next method if failed # Check the return code and rollover to next method if failed
if returncode == 0: if returncode == 0:
if method == 'piped':
# cannot control umask for file, but directory should be safe enough, setting perms for possible subsequent copies # cannot control umask for file, but directory should be safe enough, setting perms for possible subsequent copies
(rc, out, err) = self.exec_command(f'chmod 0600 "{out_path}"', sudoable=False) (rc, out, err) = self.exec_command(f'chmod 0600 "{out_path}"', sudoable=False)
if not rc == 0: if rc != 0:
display.warning("Unable to set remote permissions for transfered '{out_path}': {err}") display.warning("Unable to set remote permissions for transfered '{out_path}': {err}")
return (returncode, stdout, stderr) return (returncode, stdout, stderr)
else: else:

Loading…
Cancel
Save