Commit 5fe4bd4
authored
Currently the RPM table is being generated by initializing the RPM db with all packages, or a single package by name with query context. I've changed this table to start using `rpmdbSetIteratorRE` with string compare, by iterating through all values given in query context, and adding those regex patterns to the RPM iterator selector.
RPM API `rpmdbSetIteratorRE`: https://ftp.osuosl.org/pub/rpm/api/4.4.2.2/group__rpmdb.html#g9f84dbc47d1d432f4ffe83b713fb47c9
This allows the table to generate results with all values from query context at once.
I've confirmed that the columns can support these changes by querying the tables with an IN constraint on the optimized columns. I validated the expected results by comparing returned values from osquery 5.13.1 (before IN optimization existed), 5.14.1, and 5.14.1 containing these spec file changes.
With each query I included a NULL, '' (empty string), and some non-existent values in my IN constraint.
Tests were ran on CentOS Linux release 7.9.2009 (Core)
1 parent 080833e commit 5fe4bd4
File tree
3 files changed
+25
-12
lines changed- osquery/tables/system/linux
- specs/linux
3 files changed
+25
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
148 | | - | |
| 148 | + | |
| 149 | + | |
149 | 150 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
154 | 160 | | |
155 | 161 | | |
156 | 162 | | |
| |||
210 | 216 | | |
211 | 217 | | |
212 | 218 | | |
213 | | - | |
| 219 | + | |
| 220 | + | |
214 | 221 | | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
219 | 232 | | |
220 | 233 | | |
221 | 234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
0 commit comments