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

dbus binding doesn't detect values with incorrect types in arrays, it elides them #11

Closed
trgill opened this issue Oct 27, 2016 · 6 comments · Fixed by stratis-storage/stratisd#2099
Assignees

Comments

@trgill
Copy link

trgill commented Oct 27, 2016

For example, the following uses an incorrect a(sss), but the call gets through...

busctl --user call org.storage.stratis1 /org/storage/stratis1/1 org.storage.stratis1.pool CreateFilesystems a(sss) 3 volume1 /dev/mount/point 10 volume2 /dev/mount/point2 11 volume3 /dev/mount/point3 12
a(oqs)qs 00 "Ok"

It doesn't seem to be a big deal - the filesystems array is 0 length.

@mulkieran
Copy link
Member

I'm guessing that busctl never sends the actual signature over the dbus, just the values, packaged according to the signature information you gave it. I bet stratisd would have an issue if one of those numbers were negative, or otherwise didn't fit the uint64 requirements.

@agrover
Copy link

agrover commented Nov 10, 2016

OK, what happens when one of the numbers is negative?

@mulkieran
Copy link
Member

Whoops, pretty funky.

[mulhern@dhcp-25-209 stratisd]$ busctl --user call org.storage.stratis1 /org/storage/stratis1/1 org.storage.stratis1.pool CreateFilesystems "a(sss)" 1 volume1 /dev/mount/point str
a(oqs)qs 00 "Ok"

I can't get the same effect unless it's a value in array. Might be a dbus-rs problem, since we seem to be using the correct types.

@mulkieran
Copy link
Member

Known dbus-rs bug, looks like: diwic/dbus-rs#62. There may be a work around.

@mulkieran mulkieran assigned mulkieran and unassigned trgill Jan 25, 2017
@mulkieran
Copy link
Member

mulkieran commented Jan 19, 2018

All our changes to D-Bus layer haven't removed this problem, alas. What's slightly wierder is that:

[root@localhost stratisd]# busctl --system call org.storage.stratis1 /org/storage/stratis1 org.storage.stratis1.Manager CreatePool "s(bq)ban" name1 0 0 0 1 2

succeeds, but doesn't return the object path for the blockdev, which was passed as a numeric value.

(oao)qs "/org/storage/stratis1/3" 0 0 "Ok"

There's a real possibility that dbus-rs is just skipping the value that was incorrectly packaged. After all, this

[root@localhost stratisd]# busctl --system call org.storage.stratis1 /org/storage/stratis1 org.storage.stratis1.Manager CreatePool "s(bq)bas" name2 0 0 0 1 2
(oao)qs "/org/storage/stratis1/4" 1 "/org/storage/stratis1/5" 0 "Ok"

works. Not clear what to do about this, though.

@mulkieran mulkieran transferred this issue from stratis-storage/stratisd Apr 26, 2019
@mulkieran
Copy link
Member

We will document that this is an allowed bug in the README.

@mulkieran mulkieran changed the title dbus binding doesn't reject incorrect function signatures for u64 dbus binding doesn't detect values with incorrect types in arrays, it elides them Jun 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants