forked from forgejo/forgejo
Backport #26087 by @KN4CK3R
Fixes #26022
- Fix handling of files with trailing slash
- Fix handling of duplicate package file errors
- Added test for both
Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
(cherry picked from commit a424f6d4f8
)
This commit is contained in:
parent
1cd4d4b00e
commit
4be3270e87
4 changed files with 67 additions and 47 deletions
|
@ -80,7 +80,9 @@ func ParsePackage(r io.Reader) (*Package, error) {
|
|||
|
||||
if strings.HasPrefix(hd.Name, controlTar) {
|
||||
var inner io.Reader
|
||||
switch hd.Name[len(controlTar):] {
|
||||
// https://man7.org/linux/man-pages/man5/deb-split.5.html#FORMAT
|
||||
// The file names might contain a trailing slash (since dpkg 1.15.6).
|
||||
switch strings.TrimSuffix(hd.Name[len(controlTar):], "/") {
|
||||
case "":
|
||||
inner = arr
|
||||
case ".gz":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue