cmd: when running --password-command allow use of stdin
Bind rclone standard input to password command's standard input. This allows to provide password from a pipe and collect it using cat. The typical use case is when rclone is on a remote server with an encrypted configuration. This solved the environment variable issue (#3368) and the password storage on remote host. Now the following chain is allowed: echo 'secret' | ssh host.example.com \ sudo -u rclone \ rclone --config /path/to/rclone.conf \ --password-command 'cat' ls remote: Signed-off-by: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org> Co-authored-by: Sébastien Gross <seb•ɑƬ•chezwam•ɖɵʈ•org>
This commit is contained in:
parent
b78adc9f03
commit
395f259978
1 changed files with 1 additions and 0 deletions
|
@ -282,6 +282,7 @@ func loadConfigFile() (*goconfig.ConfigFile, error) {
|
|||
|
||||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
cmd.Stdin = os.Stdin
|
||||
|
||||
if err := cmd.Run(); err != nil {
|
||||
// One does not always get the stderr returned in the wrapped error.
|
||||
|
|
Loading…
Reference in a new issue