fleet/pkg/file
Jonathan Katz d66b259306
Compare pkg-info bundle id with bundles in pkg parsing (#38577)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #37710
Adds some logic to try to use the name/version/identifier from a bundle
that exactly matches the bundle identifier from the root pkg-info
element, if found. The loop continues even if that is found since
packageIDSet needs to be built.
# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

- [ ] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements)
- [ ] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [ ] Added/updated automated tests
- [ ] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually
Tested against all installers from the google drive folder, prisma
access browser is the only package with changed metadata.
Before:
```
File: Prisma Access Browser-144.6.10.59-b070a3e0.pkg
- Name: 'PrismaAccessBrowserSoftwareUpdateAgent'
- Bundle Identifier: 'com.paloaltonetworks.PrismaAccessBrowserUpdater.Agent'
- Package IDs: 'com.paloaltonetworks.PrismaAccessBrowserUpdater,com.paloaltonetworks.PrismaAccessBrowserUpdater.Agent,com.talon-sec.Work,com.talon-sec.Work.framework,com.talon-sec.Work.framework.AlertNotificationService,com.talon-sec.Work.helper,com.talon-sec.Work.helper.plugin,com.talon-sec.Work.helper.renderer,org.sparkle-project.Downloader,org.sparkle-project.InstallerLauncher,org.sparkle-project.Sparkle,org.sparkle-project.Sparkle.Updater'
- Version: 144.6.10
```
After:
```
File: Prisma Access Browser-144.6.10.59-b070a3e0.pkg
- Name: 'Prisma Access Browser'
- Bundle Identifier: 'com.talon-sec.Work'
- Package IDs: 'com.paloaltonetworks.PrismaAccessBrowserUpdater,com.paloaltonetworks.PrismaAccessBrowserUpdater.Agent,com.talon-sec.Work,com.talon-sec.Work.framework,com.talon-sec.Work.framework.AlertNotificationService,com.talon-sec.Work.helper,com.talon-sec.Work.helper.plugin,com.talon-sec.Work.helper.renderer,org.sparkle-project.Downloader,org.sparkle-project.InstallerLauncher,org.sparkle-project.Sparkle,org.sparkle-project.Sparkle.Updater'
- Version: 144.6.10.59
```
2026-01-21 13:43:38 -05:00
..
scripts Improve 1Password uninstall reliability and add timeout (#36111) 2025-11-20 22:45:39 -06:00
testdata Update script test "golden" files (#36129) 2025-11-21 11:37:36 -06:00
deb.go Add support for zstd deb packages (#23657) 2024-11-11 14:13:01 -05:00
file.go Initial support for in-house apps on iOS/iPadOS (#34802) 2025-10-28 08:33:58 -04:00
file_bench_test.go Swap minio to rustfs (#36851) 2025-12-10 10:03:48 -06:00
file_test.go Add custom software icons (#32652) 2025-09-05 17:31:03 -05:00
ipa.go Initial support for in-house apps on iOS/iPadOS (#34802) 2025-10-28 08:33:58 -04:00
management.go Update MSI uninstall script for FMAs, unify with custom package version (#31111) 2025-07-23 09:29:59 -05:00
management_test.go Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
msi.go Extract UpgradeCode from MSI custom packages, use for better uninstall script generation (#30969) 2025-07-17 10:33:23 -05:00
pdf.go Consider an empty EULA pdf file the same as an invalid one, returning 400 Bad Request (#12542) 2023-06-28 08:19:42 -04:00
pdf_test.go Consider an empty EULA pdf file the same as an invalid one, returning 400 Bad Request (#12542) 2023-06-28 08:19:42 -04:00
pe.go Add InstallAnywhere self extracting archive to metadata extraction (#34874) 2025-11-06 14:25:07 -05:00
pe_test.go Improve memory usage of software installers parsing (#23596) 2024-11-12 09:28:08 -05:00
rpm.go Add support to upload RPM packages (#22502) 2024-10-01 13:02:13 -03:00
rpm_test.go Improve memory usage of software installers parsing (#23596) 2024-11-12 09:28:08 -05:00
tgz.go Add .tar.gz package support (#28339) 2025-05-02 09:07:35 -05:00
validation.go cli: try to infer the bootstrap package name from the URL too (#11571) 2023-05-11 10:36:28 -03:00
validation_test.go cli: try to infer the bootstrap package name from the URL too (#11571) 2023-05-11 10:36:28 -03:00
xar.go Compare pkg-info bundle id with bundles in pkg parsing (#38577) 2026-01-21 13:43:38 -05:00
xar_test.go 32084 Cisco Secure Client installer fix (#35077) 2025-11-03 15:22:39 -05:00