Details
-
Bug
-
Resolution: Fixed
-
Critical
-
7.0.0
-
Untriaged
-
1
-
Unknown
Description
The problem seen here:
https://forums.couchbase.com/t/cbbackupmgr-config-commands/34780/10
is because filterQueryMap eventing/service_manager/utils.go in 7.0.x doesn't correctly handle escaped dots (it is too simplistic).
https://github.com/couchbase/eventing/commit/dff6ad00bfb6e346ed99ff9f78c269744e1e4c79
removed the error reporting in eventing/service_manager/http_handlers.go when filterQueryMap returns an error and is why the error isn't seen any longer in 7.1.
This probably wasn't intended given that it leaves the filterMap empty - i.e. ignores the filtering.
So returning the error reporting and using something like:
func filterQueryMap(filterString string, include bool) (map[string]bool, error) {
|
filterMap := make(map[string]bool)
|
var keyspace []rune
|
escaped := false |
nDots := 0 |
filterString += "," |
for _, r := range filterString { |
if escaped { |
escaped = false |
} else { |
if r == '\\' { |
escaped = true |
continue |
} else if r == ',' { |
if len(keyspace) > 0 { |
if nDots > 2 { |
return nil, fmt.Errorf("Malformed input filter %s", string(keyspace)) |
}
|
filterMap[string(keyspace)] = include
|
keyspace = keyspace[:0] |
nDots = 0 |
}
|
continue |
} else if r == '.' { |
nDots++
|
}
|
}
|
keyspace = append(keyspace, r)
|
}
|
return filterMap, nil |
}
|
would validate the filters (bucket, bucket.scope or bucket.scope.collection) along with permitting embedded dots or commas in any part.
Attachments
Issue Links
- is a backport of
-
MB-54451 Backup/Restore fails when bucket name contains "." character
- Resolved