Skip to content

Commit

Permalink
Make relative_path a no-op
Browse files Browse the repository at this point in the history
Setting the relative_path during package upload is a highway straight to
bad places. Users can set multiple packages to foo.rpm (or equivalent)
provide names to packages that don't match their metadata and so forth.

[noissue]
  • Loading branch information
dralley committed Feb 8, 2024
1 parent f56b9d9 commit 323bb04
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions pulp_rpm/app/serializers/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,8 @@ def deferred_validate(self, data):
)
+ ".rpm"
)
if not data.get("relative_path"):
data["relative_path"] = filename
new_pkg["location_href"] = filename
else:
new_pkg["location_href"] = data["relative_path"]
data["relative_path"] = filename
new_pkg["location_href"] = filename

data.update(new_pkg)
return data
Expand Down

0 comments on commit 323bb04

Please sign in to comment.