Currently, the sudo connection methods use a two-step approach to copy files to a target location:
- Files are copied to a staging directory using the connecting user
- Files are moved to the target location using the sudo user
The command that carries out the second step is (depending on the value of the sudoPreserveAttributesOnCopyFromTempFile property), cp -r or cp -pr. It would be more flexible if the user could configure this command to support arbitrary flags.