2
2
mirror of https://github.com/octoleo/restic.git synced 2024-11-30 08:44:02 +00:00

backup: Always use cleaned path for excludes

This commit is contained in:
Alexander Neumann 2018-05-11 21:26:18 +02:00
parent 9180e2c48a
commit 18d4ac2fd9

View File

@ -185,6 +185,7 @@ func isDirExcludedByFile(dir, tagFilename, header string) bool {
func gatherDevices(items []string) (deviceMap map[string]uint64, err error) {
deviceMap = make(map[string]uint64)
for _, item := range items {
item = filepath.Clean(item)
fi, err := fs.Lstat(item)
if err != nil {
return nil, err
@ -215,6 +216,8 @@ func rejectByDevice(samples []string) (RejectFunc, error) {
return false
}
item = filepath.Clean(item)
id, err := fs.DeviceID(fi)
if err != nil {
// This should never happen because gatherDevices() would have