forked from TrueCloudLab/restic
Merge pull request #1776 from restic/fix-1775
Always use cleaned path for excludes
This commit is contained in:
commit
903a3a31dc
2 changed files with 8 additions and 32 deletions
|
@ -185,6 +185,11 @@ func isDirExcludedByFile(dir, tagFilename, header string) bool {
|
||||||
func gatherDevices(items []string) (deviceMap map[string]uint64, err error) {
|
func gatherDevices(items []string) (deviceMap map[string]uint64, err error) {
|
||||||
deviceMap = make(map[string]uint64)
|
deviceMap = make(map[string]uint64)
|
||||||
for _, item := range items {
|
for _, item := range items {
|
||||||
|
item, err = filepath.Abs(filepath.Clean(item))
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
fi, err := fs.Lstat(item)
|
fi, err := fs.Lstat(item)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -215,6 +220,8 @@ func rejectByDevice(samples []string) (RejectFunc, error) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
item = filepath.Clean(item)
|
||||||
|
|
||||||
id, err := fs.DeviceID(fi)
|
id, err := fs.DeviceID(fi)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// This should never happen because gatherDevices() would have
|
// This should never happen because gatherDevices() would have
|
||||||
|
@ -222,7 +229,7 @@ func rejectByDevice(samples []string) (RejectFunc, error) {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
for dir := item; dir != ""; dir = filepath.Dir(dir) {
|
for dir := item; dir != filepath.Dir(dir); dir = filepath.Dir(dir) {
|
||||||
debug.Log("item %v, test dir %v", item, dir)
|
debug.Log("item %v, test dir %v", item, dir)
|
||||||
|
|
||||||
allowedID, ok := allowed[dir]
|
allowedID, ok := allowed[dir]
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
/boot
|
|
||||||
/dev
|
|
||||||
/etc
|
|
||||||
/home
|
|
||||||
/lost+found
|
|
||||||
/mnt
|
|
||||||
/proc
|
|
||||||
/root
|
|
||||||
/run
|
|
||||||
/sys
|
|
||||||
/tmp
|
|
||||||
/usr
|
|
||||||
/var
|
|
||||||
/opt/android-sdk
|
|
||||||
/opt/bullet
|
|
||||||
/opt/dex2jar
|
|
||||||
/opt/jameica
|
|
||||||
/opt/google
|
|
||||||
/opt/JDownloader
|
|
||||||
/opt/JDownloaderScripts
|
|
||||||
/opt/opencascade
|
|
||||||
/opt/vagrant
|
|
||||||
/opt/visual-studio-code
|
|
||||||
/opt/vtk6
|
|
||||||
/bin
|
|
||||||
/fonts*
|
|
||||||
/srv/ftp
|
|
||||||
/srv/http
|
|
||||||
/sbin
|
|
||||||
/lib
|
|
||||||
/lib64
|
|
Loading…
Reference in a new issue