Skip to content

Commit 74dafc0

Browse files
committed
Revert "feat: add support for NDB RPM database CN-70"
This reverts commit 628a240.
1 parent 3a04378 commit 74dafc0

6 files changed

Lines changed: 24 additions & 2287 deletions

File tree

lib/analyzer/static-analyzer.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ import {
4444
import {
4545
getRpmDbFileContent,
4646
getRpmDbFileContentAction,
47-
getRpmNdbFileContent,
48-
getRpmNdbFileContentAction,
4947
getRpmSqliteDbFileContent,
5048
getRpmSqliteDbFileContentAction,
5149
} from "../inputs/rpm/static";
@@ -92,7 +90,6 @@ export async function analyze(
9290
getExtFileContentAction,
9391
getRpmDbFileContentAction,
9492
getRpmSqliteDbFileContentAction,
95-
getRpmNdbFileContentAction,
9693
...getOsReleaseActions,
9794
getNodeBinariesFileContentAction,
9895
getOpenJDKBinariesFileContentAction,
@@ -156,13 +153,11 @@ export async function analyze(
156153
aptDbFileContent,
157154
rpmDbFileContent,
158155
rpmSqliteDbFileContent,
159-
rpmNdbFileContent,
160156
] = await Promise.all([
161157
getApkDbFileContent(extractedLayers),
162158
getAptDbFileContent(extractedLayers),
163159
getRpmDbFileContent(extractedLayers),
164160
getRpmSqliteDbFileContent(extractedLayers),
165-
getRpmNdbFileContent(extractedLayers),
166161
]);
167162

168163
const distrolessAptFiles = getAptFiles(extractedLayers);
@@ -192,12 +187,7 @@ export async function analyze(
192187
results = await Promise.all([
193188
apkAnalyze(targetImage, apkDbFileContent),
194189
aptAnalyze(targetImage, aptDbFileContent, osRelease),
195-
rpmAnalyze(
196-
targetImage,
197-
[...rpmDbFileContent, ...rpmNdbFileContent],
198-
redHatRepositories,
199-
osRelease,
200-
),
190+
rpmAnalyze(targetImage, rpmDbFileContent, redHatRepositories, osRelease),
201191
mapRpmSqlitePackages(
202192
targetImage,
203193
rpmSqliteDbFileContent,

lib/inputs/rpm/static.ts

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import {
2-
getPackages,
3-
getPackagesNdb,
4-
getPackagesSqlite,
5-
} from "@snyk/rpm-parser";
1+
import { getPackages, getPackagesSqlite } from "@snyk/rpm-parser";
62
import { PackageInfo } from "@snyk/rpm-parser/lib/rpm/types";
73
import { Response } from "@snyk/rpm-parser/lib/types";
84
import * as Debug from "debug";
@@ -65,37 +61,6 @@ export async function getRpmSqliteDbFileContent(
6561
}
6662
}
6763

68-
export const getRpmNdbFileContentAction: ExtractAction = {
69-
actionName: "rpm-ndb",
70-
filePathMatches: (filePath) =>
71-
filePath === normalizePath("/usr/lib/sysimage/rpm/Packages.db"),
72-
callback: streamToBuffer,
73-
};
74-
75-
export async function getRpmNdbFileContent(
76-
extractedLayers: ExtractedLayers,
77-
): Promise<PackageInfo[]> {
78-
const rpmDb = getContentAsBuffer(extractedLayers, getRpmNdbFileContentAction);
79-
if (!rpmDb) {
80-
return [];
81-
}
82-
83-
try {
84-
const results: Response = await getPackagesNdb(rpmDb);
85-
86-
if (results.error) {
87-
throw results.error;
88-
}
89-
return results.response;
90-
} catch (error) {
91-
debug(
92-
`An error occurred while analysing RPM NDB packages:`,
93-
error.stack || error,
94-
);
95-
return [];
96-
}
97-
}
98-
9964
export const getRpmSqliteDbFileContentAction: ExtractAction = {
10065
actionName: "rpm-sqlite-db",
10166
filePathMatches: (filePath) =>

package-lock.json

Lines changed: 15 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@snyk/composer-lockfile-parser": "^1.4.1",
3232
"@snyk/dep-graph": "^2.8.1",
3333
"@snyk/docker-registry-v2-client": "^2.15.0",
34-
"@snyk/rpm-parser": "^3.3.0",
34+
"@snyk/rpm-parser": "^3.1.0",
3535
"@snyk/snyk-docker-pull": "^3.14.0",
3636
"@swimlane/docker-reference": "^2.0.1",
3737
"adm-zip": "^0.5.16",

0 commit comments

Comments
 (0)