add --password-on-stdin#1279
Conversation
| log_warn("Could not read password from stdin"); | ||
| break; | ||
| } | ||
| strncpy(cli_cfg.password, password, PASSWORD_SIZE); |
Check failure
Code scanning / CodeQL
Cleartext storage of sensitive information in buffer
|
Not sure if this PR is the place to address these issues, but:
$ openfortivpn --password-on-stdin --password-on-stdin
<password1>
<password2>
WARN: Could not load configuration file "/volatile/local/opefortivpn/etc/openfortivpn/config" (No such file or directory).
ERROR: Specify a valid host:port couple.
Usage: openfortivpn [<host>[:<port>]] [-u <user>] [-p <pass>] [--password-on-stdin]
[...]
$ The |
|
How about we just set a flag during argument parsing: And then, just before this line: Line 673 in 912f1af read from stdin (if that flag is set), etc. |
|
The flag will fix issue 1, but not issue 2. And there's an additional issue: Again, |
|
I have tried to fix 1. and 3. |
|
If you want to store passwords in the macOS Keychain, check out the GUI client I built on top of openfortivpn: Hope you find it useful! |
This allows the password to be read from stdin, e.g. from a password manager. Closes #1063.