fleet/pkg/file
Carlo c86ad041b2
Scope package identifier validation to template substitution (#41028)
Fixes #41009

## Summary

- Scope `ValidatePackageIdentifiers` to only run when `$PACKAGE_ID` or
`$UPGRADE_CODE` template variables are present in the uninstall script
  - Move `dmg`/`zip` early return before validation
- Switch from ASCII allowlist to shell metacharacter denylist, allowing
legitimate non-ASCII product names (e.g., `®`, parens) while still
blocking injection characters

  ## Test plan

- [x] Added unit tests for conditional validation (non-ASCII IDs
with/without template vars, dmg/zip bypass, upgrade code scoping)
  - [x] Existing input tests still pass
  - [x] Winget ingester tests unaffected

---------

Co-authored-by: Ian Littman <iansltx@gmail.com>
2026-03-05 13:37:57 -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 Scope package identifier validation to template substitution (#41028) 2026-03-05 13:37:57 -05:00
management_test.go Scope package identifier validation to template substitution (#41028) 2026-03-05 13:37:57 -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 Bugfix: ignore nested .app files in .pkg metadata extraction (#40851) 2026-03-03 12:33:31 -05:00
xar_test.go Bugfix: ignore nested .app files in .pkg metadata extraction (#40851) 2026-03-03 12:33:31 -05:00