mirror of
https://github.com/octoleo/restic.git
synced 2024-11-10 15:21:03 +00:00
Merge pull request #771 from restic/fix-770
Return an error if password is not set for stdin
This commit is contained in:
commit
d0de1ed2e4
@ -235,6 +235,10 @@ func readBackupFromStdin(opts BackupOptions, gopts GlobalOptions, args []string)
|
||||
return errors.Fatalf("when reading from stdin, no additional files can be specified")
|
||||
}
|
||||
|
||||
if gopts.password == "" && gopts.PasswordFile == "" {
|
||||
return errors.Fatal("Unable to read password from stdin when data is to be read from stdin, use --password-file or $RESTIC_PASSWORD")
|
||||
}
|
||||
|
||||
repo, err := OpenRepository(gopts)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user