-
Notifications
You must be signed in to change notification settings - Fork 23
Add basic dynamicstore wrapper #2
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
Conversation
Reviewed 3 of 6 files at r1. system-configuration/src/dynamic_store.rs, line 57 at r1 (raw file):
I thought you said that we cannot modify existing keys with Comments from Reviewable |
Review status: 3 of 6 files reviewed at latest revision, 2 unresolved discussions. system-configuration/src/dynamic_store.rs, line 80 at r1 (raw file): According to docs
In order to check the returned type we have to get CFTypeID and compare it against known type ID, for example:
Comments from Reviewable |
Review status: 3 of 6 files reviewed at latest revision, 3 unresolved discussions. system-configuration/src/dynamic_store.rs, line 90 at r1 (raw file):
You should accept Comments from Reviewable |
Reviewed 1 of 6 files at r1. Comments from Reviewable |
Reviewed 2 of 6 files at r1. Comments from Reviewable |
Review status: all files reviewed at latest revision, 3 unresolved discussions. system-configuration/src/dynamic_store.rs, line 57 at r1 (raw file): Previously, pronebird (Andrei Mihailov) wrote…
We can't. And we likely won't use this constructor. But since I tried it I already had the code. So I did not see any reason to not include this special contructor. Since this will be a general OSS library it's good to cover more use cases when it does not cost us extra work. system-configuration/src/dynamic_store.rs, line 80 at r1 (raw file): Previously, pronebird (Andrei Mihailov) wrote…
Ah. Thanks. Was not too sure about that assumption. I'll fix. system-configuration/src/dynamic_store.rs, line 90 at r1 (raw file): Previously, pronebird (Andrei Mihailov) wrote…
I see! I was not aware of exactly which types were OK. But since this wrapper should be safe I don't want to take the underlying I think I instead could take Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. system-configuration/src/dynamic_store.rs, line 90 at r1 (raw file):
I am not sure what happens if you pass any other Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. system-configuration/src/dynamic_store.rs, line 90 at r1 (raw file): Previously, pronebird (Andrei Mihailov) wrote…
*could reject the update Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion. system-configuration/src/dynamic_store.rs, line 90 at r1 (raw file): Previously, pronebird (Andrei Mihailov) wrote…
And yes indeed you could limit accepted types with generic or something or even add a trait to unite certain types. Comments from Reviewable |
Review status: 3 of 6 files reviewed at latest revision, 2 unresolved discussions. system-configuration-sys/Cargo.toml, line 14 at r1 (raw file):
Whoops. Should not depend on the higher level crate from a sys crate. We didn't actually use it, I probably just copy pasted the two dependencies to both crates. system-configuration/src/dynamic_store.rs, line 90 at r1 (raw file): Previously, pronebird (Andrei Mihailov) wrote…
I got some stuff merged upstream in The extra Comments from Reviewable |
40110c0
to
6d4d428
Compare
Review status: 3 of 6 files reviewed at latest revision, 1 unresolved discussion. system-configuration/src/dynamic_store.rs, line 90 at r1 (raw file): Previously, faern (Linus Färnstrand) wrote…
Saw that! Good one! Comments from Reviewable |
Reviewed 3 of 3 files at r2. Comments from Reviewable |
Review status: Comments from Reviewable |
# This is the 1st commit message: merge3 # This is the commit message mullvad#2: Update
# This is the 1st commit message: merge4 # This is the commit message mullvad#2: Update system-configuration/examples/set_dns.rs
# This is the 1st commit message: merge5 # This is the commit message mullvad#2: Update
Adding a formatter settings file. Same as we have everywhere else.
Depending on git version of
core-foundations
. Because it has a number of patches merged that I created to make some things easier/possible to implement in system configuration. Not sure when/if they will release an upgrade. But at this early stage of playing with system configuration it does not matter if we depend on a git version IMO.Adding the base
SCDynamicStore
functionality. This version can get and set values in the store. Please audit this carefully for memory correctness. There are more features coming to this struct. But I wanted to keep it simple in first PR, to correctly audit the base of it.I added a temporary bin,
set_dns
, that uses this new struct to read out the primary interface and set the DNS of it to8.8.8.8
and8.8.4.4
so this code can be tested and played with.This change is