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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix Solaris 10 name not showing in the Dashboard #18642
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GJ
Exploratory 馃煝EnvironmentSolaris 10 VM
Details
Solaris 11 VM
Details
Current behaviorThis is the result with the current v4.5.1, in two Solaris agents Details
root@ubuntu-jammy:/var/ossec# sqlite3 queue/db/001.db "SELECT * FROM sys_osinfo"
-- Loading resources from /root/.sqliterc
scan_id = 0
scan_time = 2023/08/28 21:54:26
hostname = solaris-11
architecture = i86pc
os_name = SunOS
os_version = 11.3
os_codename =
os_major = 11
os_minor = 3
os_patch =
os_build =
os_platform = sunos
sysname = SunOS
release = 5.11
version = 11.3
os_release =
checksum = 1693259665220857802
os_display_version =
triaged = 0
reference = 9fb00a218ddda71caea23e2bdcae8799de9ed220
root@ubuntu-jammy:/var/ossec# sqlite3 queue/db/002.db "SELECT * FROM sys_osinfo"
-- Loading resources from /root/.sqliterc
scan_id = 0
scan_time = 2023/08/28 18:54:54
hostname = solaris-10
architecture = i86pc
os_name = SunOS
os_version = 10
os_codename =
os_major = 10
os_minor =
os_patch =
os_build =
os_platform = sunos
sysname = SunOS
release = 5.10
version = Generic_147148-26
os_release =
checksum = 1693248892804869910
os_display_version =
triaged = 0
reference = 98d2768bc49471cb41e55bbcec166a262b711707 New behaviorWe get the same result with the changes of the PR Details
root@ubuntu-jammy:/var/ossec# sqlite3 queue/db/003.db "SELECT * FROM sys_osinfo"
-- Loading resources from /root/.sqliterc
scan_id = 0
scan_time = 2023/08/28 19:19:55
hostname = solaris-10
architecture = i86pc
os_name = SunOS
os_version = 10
os_codename =
os_major = 10
os_minor =
os_patch =
os_build =
os_platform = sunos
sysname = SunOS
release = 5.10
version = Generic_147148-26
os_release =
checksum = 1693250393175244183
os_display_version =
triaged = 0
reference = 98d2768bc49471cb41e55bbcec166a262b711707
root@ubuntu-jammy:/var/ossec# sqlite3 queue/db/004.db "SELECT * FROM sys_osinfo"
-- Loading resources from /root/.sqliterc
scan_id = 0
scan_time = 2023/08/28 22:20:12
hostname = solaris-11
architecture = i86pc
os_name = SunOS
os_version = 11.3
os_codename =
os_major = 11
os_minor = 3
os_patch =
os_build =
os_platform = sunos
sysname = SunOS
release = 5.11
version = 11.3
os_release =
checksum = 1693261210901178235
os_display_version =
triaged = 0
reference = 9fb00a218ddda71caea23e2bdcae8799de9ed220 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Objective
This PR fix the pattern to search in the
etc/release
in the old versions of Solaris 10 (Pior 1/13) .The fix only apply for Solaris 10 OS.
Description
The first approach was implement the following fix in the file
version_op.c
Code snipped
After a comment from team, we can see that the first pattern to search is
Oracle Solaris
, and if this is found, then the algorithm seek again the shortest tagSolaris
which obviously will be found and the final result is incorrect.Switching the order to search, that means:
Code snipped
The result is correct partially, because the behavior is the same error that generate the issue.
Making a modification, the propose solution is the following
Code snipped
Important
We are considering scenarios where the content of the
etc/release
file isOracle Solaris
orSolaris
. It could exists another alternative where the keywordSolaris
is duplicated. This existence has a very low probability.Quality Assurance
A new tests has been included to verify the correct behavior and backward compatibility of this solution proposal.
Output ctest
Regarding with memory, no new memory allocations was introduced in this PR.
ScanBuild report
Command:
scan-build-15 -enable-checker alpha.core.CastSize -enable-checker alpha.core.CastToStruct -enable-checker alpha.core.Conversion -enable-checker alpha.core.IdenticalExpr -enable-checker alpha.core.SizeofPtr -enable-checker alpha.core.TestAfterDivZero --exclude external make TARGET=agent DEBUG=1 -j$(nproc)
Done building agent scan-build: Analysis run complete. scan-build: Removing directory '/tmp/scan-build-2023-08-28-152548-92114-1' because it contains no reports. scan-build: No bugs found.
Exploratory tests
Check summary