Validate apt package names#579
Conversation
Greptile SummaryThis PR adds input validation to the
Confidence Score: 5/5Safe to merge — the change is a targeted input-validation guard with no side effects on existing valid inputs. The regex correctly implements Debian policy (lowercase, min-2 chars, alphanumeric start, +/-/. allowed), the guard fires before any file I/O or network calls in both build and ship, and the test suite now covers both acceptance and rejection paths. No existing behaviour for valid package names is altered. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A([caller: build or ship]) --> B[assertPackageName]
B --> C{valid Debian name?}
C -- no --> D[throw Error]
C -- yes --> E{which method?}
E -- build --> F[mkdir + writeFile control and Packages index]
E -- ship --> G{dryRun?}
G -- yes --> H[return dry-run]
G -- no --> I[upload .deb and update InRelease]
Reviews (2): Last reviewed commit: "Cover valid apt package name characters" | Re-trigger Greptile |
Fixes the pkg-apt target accepting invalid Debian package names before rendering package metadata. Invalid names such as path traversal, spaces, uppercase letters, or one-character names are now rejected before build artifacts or ship IDs are produced.
Validation: