mirror of
https://github.com/octoleo/restic.git
synced 2024-11-26 06:46:34 +00:00
backup: Convert relative pathname for --stdin-filename to absolute (#2063)
This commit is contained in:
parent
8066195e6e
commit
4429a66b5f
@ -8,6 +8,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
|
"path"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@ -523,13 +524,14 @@ func runBackup(opts BackupOptions, gopts GlobalOptions, term *termstatus.Termina
|
|||||||
if !gopts.JSON {
|
if !gopts.JSON {
|
||||||
p.V("read data from stdin")
|
p.V("read data from stdin")
|
||||||
}
|
}
|
||||||
|
filename := path.Join("/", opts.StdinFilename)
|
||||||
targetFS = &fs.Reader{
|
targetFS = &fs.Reader{
|
||||||
ModTime: timeStamp,
|
ModTime: timeStamp,
|
||||||
Name: opts.StdinFilename,
|
Name: filename,
|
||||||
Mode: 0644,
|
Mode: 0644,
|
||||||
ReadCloser: os.Stdin,
|
ReadCloser: os.Stdin,
|
||||||
}
|
}
|
||||||
targets = []string{opts.StdinFilename}
|
targets = []string{filename}
|
||||||
}
|
}
|
||||||
|
|
||||||
sc := archiver.NewScanner(targetFS)
|
sc := archiver.NewScanner(targetFS)
|
||||||
|
Loading…
Reference in New Issue
Block a user