]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
common: fix win32 event log source
authorLucian Petrut <lpetrut@cloudbasesolutions.com>
Wed, 17 Feb 2021 12:49:02 +0000 (12:49 +0000)
committerJason Dillaman <dillaman@redhat.com>
Tue, 23 Feb 2021 15:08:26 +0000 (10:08 -0500)
commit53c5b6c0ebc2ebbbc53dbc3d45ab9bbffa1a24ff
treef8f4c492ae75f88e4bfe3c0805d5de2b041dde11
parent71ca6256249f5020aa372710c6a9eece4acc80f4
common: fix win32 event log source

The Windows "get_process_name" function uses the input buffer
to store the entire executable path, while the caller only
expects the filename.

The "get_process_name_cpp" function is using an insufficient
buffer, for which reason it will return "(unknown)" when the
executable path exceeds 32 characters.

Windows event log entries have the wrong source because of this.

We'll update "get_process_name" to use a separate buffer for the
full executable path and avoid requesting a larger buffer than
actually needed.

Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
(cherry picked from commit 86c7c2f5be96e80d492447d6582131f1b2d3438d)
src/common/code_environment.cc