From 6655511ab892d4e054c8ed8c051a0a2d8b463b0d Mon Sep 17 00:00:00 2001 From: Alexander Neumann Date: Sun, 10 Apr 2016 17:25:15 +0200 Subject: [PATCH] checker: test file mode --- src/restic/checker/checker.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/restic/checker/checker.go b/src/restic/checker/checker.go index b4b7d3f0f..8366cb6fe 100644 --- a/src/restic/checker/checker.go +++ b/src/restic/checker/checker.go @@ -586,6 +586,10 @@ func (c *Checker) checkTree(id backend.ID, tree *restic.Tree) (errs []error) { errs = append(errs, Error{TreeID: id, Err: fmt.Errorf("file %q has nil blob list", node.Name)}) } + if node.Mode == 0 { + errs = append(errs, Error{TreeID: id, Err: fmt.Errorf("file %q has invalid mode: %v", node.Name, node.Mode)}) + } + for b, blobID := range node.Content { if blobID.IsNull() { errs = append(errs, Error{TreeID: id, Err: fmt.Errorf("file %q blob %d has null ID", node.Name, b)})