Closed pkubowicz closed 1 year ago
I started learning Rust 2 hours ago in order to create this PR, so forgive me if I miss some Rust idioms. I tried to keep the code changes minimal but still useful.
Don't worry, this code base is extremely messy. As long as it compiles and is not something absurd, I'm fine with it.
Thanks for the contribution.
Previously, not having this file produced just an error from openvpn. It wasn't clear if this file was missing due to something broken during SAML auth or for another reason.
Also nothing user-friendly when executed with RUST_BACKTRACE=1:
The reason was that I accidentally removed
share/
while trying to fix openvpn compilation. Looking at sources confused me even more, becausepwd.txt
is used twice in 2 different directories (inshare
and in a temp directory). I was assuming SAML failed. But it was me failing to dogit reset --hard
.After rethinking, I am convinced more people will run into same problem, even without removing anything from sources. It's because the current code uses relative paths, so if you start the binary from any directory other than main repository directory, share/pwd.txt won't be found and you will get the cryptic error.
I started learning Rust 2 hours ago in order to create this PR, so forgive me if I miss some Rust idioms. I tried to keep the code changes minimal but still useful.