Skip to content
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

Fix system-info support for Unicode characters on Windows #7626

Merged
merged 1 commit into from
Jul 3, 2022

Conversation

Smjert
Copy link
Member

@Smjert Smjert commented Jun 9, 2022

  • The computer_name and local_hostname columns where incorrectly
    truncating Unicode characters when the computer name contained them.
    Use the WinAPI to get the computer name instead of the POSIX one,
    which correctly supports Unicode.

  • Minor cleanup on the getHostname implementation of Linux and macOS too,
    since POSIX guarantees the same max size.

On Windows this can be tested by:

  1. Opening a Windows Powershell terminal (not Powershell core)
  2. Run the following commands:
$computerName = Get-WmiObject Win32_ComputerSystem
$computerName.Rename("TEST-ƒ")
  1. Reboot, then query system_info with osquery pre and post this patch

@Smjert Smjert added bug virtual tables localization Language localization, UTF8 and UTF16 support labels Jun 9, 2022
@Smjert Smjert requested review from a team as code owners June 9, 2022 16:05
- The computer_name and local_hostname columns where incorrectly
  truncating Unicode characters when the computer name contained them.
  Use the WinAPI to get the computer name instead of the POSIX one,
  which correctly supports Unicode.

- Minor cleanup on the getHostname implementation of Linux and macOS too,
  since POSIX guarantees the same max size.
@Smjert Smjert force-pushed the stefano/fix/system-info-unicode branch from fc6a0f2 to 046e849 Compare June 9, 2022 16:47
@Smjert Smjert added the ready for review Pull requests that are ready to be reviewed by a maintainer label Jun 27, 2022
@Smjert Smjert merged commit 0af56cd into osquery:master Jul 3, 2022
@Smjert Smjert deleted the stefano/fix/system-info-unicode branch July 3, 2022 15:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug localization Language localization, UTF8 and UTF16 support ready for review Pull requests that are ready to be reviewed by a maintainer virtual tables
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants