Closed vilgotf closed 2 years ago
Strict 1:1 is indeed not a goal, if an helper makes sense to have I'll gladly take it :) Thanks for the PR, I'll see the patch is small so I'll try to review it next week. But it is the first time I encounter this systemd feature, so I first need to get myself familiar with that (which may take a bit longer).
Essentially, this is std::fs::read(std::env::var_os("CREDENTIALS_DIRECTORY")?.into().join(id))?
isn't it? I'm not sure whether this is worth abstracting over to be honest…
Currently it only abstracts away CREDENTIALS_DIRECTORY
and provides an iterator.
It could be extended by get()
returning Option<Vec<u8>>
since the only possible IO error should be NotFound (panicking or discarding other errors).
@vilgotf are you still pursuing this? If you have other things to handle at the moment, I'd be happy to push some changes on top of your branch and land it.
(I'm not sure how this PR got closed, but even if it got stale by now I'll be happy to throw some changes on top and eventually merge it)
Ah, the repository behind this PR does not exist anymore so I can't push there to update the PR. I'll close this one and recreate it as a new one.
Not a part of the C
libsystemd
library but I don't know if being strictly 1-1 is a goal.Although the code is simple I do feel that it'd be a waste for every application to reimplement it.