backup: Convert relative pathname for --stdin-filename to absolute (#2063)

This commit is contained in:
Garry McNulty 2019-04-28 20:59:35 +01:00 committed by Alexander Neumann
parent 8066195e6e
commit 4429a66b5f
1 changed files with 4 additions and 2 deletions

View File

@ -8,6 +8,7 @@ import (
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"strconv"
"strings"
@ -523,13 +524,14 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
if !gopts.JSON {
p.V("read data from stdin")
}
filename := path.Join("/", opts.StdinFilename)
targetFS = &fs.Reader{
ModTime: timeStamp,
Name: opts.StdinFilename,
Name: filename,
Mode: 0644,
ReadCloser: os.Stdin,
}
targets = []string{opts.StdinFilename}
targets = []string{filename}
}
sc := archiver.NewScanner(targetFS)