Skip to content

URI encode filename fields (again)

David Kalnischkies requested to merge donkult/apt:fix/uriencodefilename into main

Keeping URIs encoded in the acquire system depends on having them encoded in the first place. I missed some places and then some places depended on being missed…

The first commit is a regression fix and as such should probably be backported to 2.2.x although I am not expecting a lot of users to notice.

The other two are an optional bonus (all existing tests still pass without them) I stumbled over while trying to fix the initial problem and are as such at least related:

The second commit could be called a security fix if we are really generous. I dislike the code, but don't see how that can be easily improved.

The third brings the joy of URI encoding also to the files downloaded by source, whose filenames were for some unknown reasons URI decoded and unquoted since ever. I note that here the filenames are taken directly from the Sources file – but that is sort of required as the filenames are part of the dsc file, so we can't just rename them.

Merge request reports

Loading