summaryrefslogtreecommitdiff
path: root/vendor/codeberg.org/gruf/go-store/storage/block.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2021-12-20 09:35:32 +0000
committerLibravatar GitHub <noreply@github.com>2021-12-20 10:35:32 +0100
commit635ad2a42f10a5b24f08021782b71b4cf8326e19 (patch)
tree3221d2c4526b5214c9a9b9d33343d48b2e9c9649 /vendor/codeberg.org/gruf/go-store/storage/block.go
parentLog when listening (#350) (diff)
downloadgotosocial-635ad2a42f10a5b24f08021782b71b4cf8326e19.tar.xz
Update codeberg.org/gruf libraries and fix go-store issue (#347)
* update codeberg.org/gruf/ libraries Signed-off-by: kim <grufwub@gmail.com> * another update Signed-off-by: kim <grufwub@gmail.com>
Diffstat (limited to 'vendor/codeberg.org/gruf/go-store/storage/block.go')
-rw-r--r--vendor/codeberg.org/gruf/go-store/storage/block.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/vendor/codeberg.org/gruf/go-store/storage/block.go b/vendor/codeberg.org/gruf/go-store/storage/block.go
index 112b67d80..9a8c4dc7d 100644
--- a/vendor/codeberg.org/gruf/go-store/storage/block.go
+++ b/vendor/codeberg.org/gruf/go-store/storage/block.go
@@ -585,8 +585,8 @@ func (st *BlockStorage) WalkKeys(opts WalkKeysOptions) error {
// nodePathForKey calculates the node file path for supplied key
func (st *BlockStorage) nodePathForKey(key string) (string, error) {
- // Path separators are illegal
- if strings.Contains(key, "/") {
+ // Path separators are illegal, as directory paths
+ if strings.Contains(key, "/") || key == "." || key == ".." {
return "", ErrInvalidKey
}
@@ -594,6 +594,10 @@ func (st *BlockStorage) nodePathForKey(key string) (string, error) {
pb := util.GetPathBuilder()
defer util.PutPathBuilder(pb)
+ // Append the nodepath to key
+ pb.AppendString(st.nodePath)
+ pb.AppendString(key)
+
// Return joined + cleaned node-path
return pb.Join(st.nodePath, key), nil
}