2
2
mirror of https://github.com/octoleo/restic.git synced 2024-05-31 08:00:48 +00:00

Return an error if password is not set for stdin

Closes #770
This commit is contained in:
Alexander Neumann 2017-02-03 15:53:07 +01:00
parent f5faff9020
commit 807fcf07d9

View File

@ -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