Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLOSS] Toml plugin fails silently on meta-set #4579

Closed
Tracked by #4555
Bujuhu opened this issue Oct 19, 2022 · 0 comments · Fixed by #4720
Closed
Tracked by #4555

[FLOSS] Toml plugin fails silently on meta-set #4579

Bujuhu opened this issue Oct 19, 2022 · 0 comments · Fixed by #4720
Assignees

Comments

@Bujuhu
Copy link
Contributor

Bujuhu commented Oct 19, 2022

As discussed in #4555, the toml storage plugin fails silently, when setting unknown meta keys

Steps to Reproduce the Problem

$ sudo kdb mount test.toml user:/tests/storage/types toml type
# RET: 0
$ kdb meta-set user:/tests/storage/types blue blah 
# RET: 0  
$ kdb meta-get user:/tests/storage/types blue  
Key not found
# RET: 2

Expected Result

Should either print an error on kdb meta-set user:/tests/storage/types blue blah and return a non 0 exit code or
kdb meta-get user:/tests/storage/types blue should return blah

Actual Result

kdb meta-set user:/tests/storage/types blue blah fails silently and kdb meta-get user:/tests/storage/types blue returns an key not found error

System Information

Operating System:
Arch Linux, Kernel 5.19.13-arch1-1

kdb and plugins version

# kdb --version
KDB_VERSION: 0.9.11
SO_VERSION: 5

Relevant Source Code

This happens because both the type and toml plugins only look for meta keys if they are of use for said plugins. If not, they are simply ignored.

const Key * orig = keyGetMeta (cur, "origvalue");

static const char * getTypeName (const Key * key)

return keyGetMeta (key, "order") == NULL && !isArrayIndex (keyBaseName (key));

const Key * meta = keyGetMeta (key, "array");

@Bujuhu Bujuhu changed the title [Floss H1] Toml plugin fails silently on meta-set [Floss] Toml plugin fails silently on meta-set Oct 19, 2022
@Bujuhu Bujuhu changed the title [Floss] Toml plugin fails silently on meta-set [FLOSS] Toml plugin fails silently on meta-set Oct 19, 2022
@Bujuhu Bujuhu self-assigned this Nov 27, 2022
Bujuhu added a commit to Bujuhu/libelektra that referenced this issue Nov 28, 2022
Bujuhu added a commit to Bujuhu/libelektra that referenced this issue Nov 28, 2022
Bujuhu added a commit to Bujuhu/libelektra that referenced this issue Nov 28, 2022
Bujuhu added a commit to Bujuhu/libelektra that referenced this issue Nov 29, 2022
joni1993 pushed a commit to joni1993/libelektra that referenced this issue Dec 5, 2022
Dynamichost96 pushed a commit to Dynamichost96/libelektra that referenced this issue Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant