-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[omnibus] Fix parsing of Status in dpkginfo probe (#20930)
This change fixes the parsing of Status in dpkginfo probe. The parsing the Status was incorrect and all packages were considered as deinstalled.
- Loading branch information
Showing
2 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
commit d3397b17e413856f3ca8e072cd789ee1bb7e778f | ||
Author: David du Colombier <[email protected]> | ||
Date: Fri Nov 17 12:28:17 2023 +0100 | ||
|
||
Fix parsing of Status in dpkginfo probe | ||
|
||
This change fixes a mistake made during a last-minute | ||
change in 557ddeed1e3e234a655ad77a691869554064b293. | ||
|
||
The parsing the Status was incorrect and all | ||
packages were considered as deinstalled. | ||
|
||
diff --git a/src/OVAL/probes/unix/linux/dpkginfo-helper.c b/src/OVAL/probes/unix/linux/dpkginfo-helper.c | ||
index 2ba9fb474..fcbb8d150 100644 | ||
--- a/src/OVAL/probes/unix/linux/dpkginfo-helper.c | ||
+++ b/src/OVAL/probes/unix/linux/dpkginfo-helper.c | ||
@@ -125,7 +125,7 @@ struct dpkginfo_reply_t* dpkginfo_get_by_name(const char *name, int *err) | ||
} | ||
} else if (reply != NULL) { | ||
if (strcmp(key, "Status") == 0) { | ||
- if (strcmp(value, "install") != 0) { | ||
+ if (strncmp(value, "install", 7) != 0) { | ||
// Package deinstalled. | ||
dD("Package \"%s\" has been deinstalled.", name); | ||
dpkginfo_free_reply(reply); |
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