zfs: Support foo/bar/* globs

This commit is contained in:
Christian Schwarz
2017-05-20 19:50:24 +02:00
parent 5f84d30972
commit d8adce6110
2 changed files with 26 additions and 1 deletions
+5 -1
View File
@@ -64,7 +64,11 @@ func (m GlobMapping) Map(source DatasetPath) (target DatasetPath, err error) {
for si, sc := range source {
target = append(target, sc)
if si < len(m.PrefixPath) {
if sc != m.PrefixPath[si] {
compsMatch := sc == m.PrefixPath[si]
endOfPrefixPath := si == len(m.PrefixPath)-1 && m.PrefixPath[si] == ""
if !(compsMatch || endOfPrefixPath) {
err = NoMatchError
return
}