-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat(config): Auto-upgrade Windows config.toml from v1 to v2 #1726
Merged
kotakanbe
merged 24 commits into
future-architect:master
from
wadda0714:wada/fix_scanner_version
Sep 21, 2023
Merged
feat(config): Auto-upgrade Windows config.toml from v1 to v2 #1726
kotakanbe
merged 24 commits into
future-architect:master
from
wadda0714:wada/fix_scanner_version
Sep 21, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wadda0714
changed the title
[WIP] feat(config): Added the function to convert old configurations to new configurations in Windows
[WIP] feat(config): Add the function to convert old configurations to new configurations in Windows
Aug 30, 2023
wadda0714
changed the title
[WIP] feat(config): Add the function to convert old configurations to new configurations in Windows
feat(config): Add the function to convert old configurations to new configurations in Windows
Sep 13, 2023
kotakanbe
changed the title
feat(config): Add the function to convert old configurations to new configurations in Windows
feat(config): Auto-upgrade Windows config.toml from v1 to v2
Sep 13, 2023
kotakanbe
approved these changes
Sep 21, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What did you implement:
If an older version of config.toml is detected when scanning with the Windows version of the scanner, The config.toml will automatically be upgraded to the latest version. The old config.toml is version 1 (v1), while the latest one is version 2 (v2).
Fixed a bug that caused an error when performing a remote scan from Windows.
The error points out that the known_host file is missing the host information to connect to.
Looking at the code,there was a section that executed such a command.
This command outputs the configuration information of the specified SSH connection destination to stdout, including information on the path of the known_host file.
When parsing this output, the current version did not remove the
~
in the path.~
refers to the user's home directory on Unix-like systems.Since
~
is not available on Windows, this may be the cause of the missingknown_hosts
file.So, I changed the scanner to remove the
~
from theknown_host
file path only when it is run on Windows, and instead use the environment variableuserprofile
, which points to the user's home directory in Windows.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
config.toml(old version)
saas-credential.json(old version)
config.toml(converted)
Remote Scan
Checklist:
You don't have to satisfy all of the following.
make fmt
make test
Is this ready for review?: YES
Reference