Skip to content

Commit ca84be3

Browse files
committed
hanle existing release update symlinks without triggering a SecurityViolation
1 parent 80982f7 commit ca84be3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

libioc/ResourceUpdater.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,9 @@ def _post_fetch(self) -> None:
700700
def _pre_update(self) -> None:
701701
"""Execute before executing the update command."""
702702
lnk = f"{self.resource.root_path}{self._base_release_symlink_location}"
703-
self.resource._require_relative_path(lnk)
703+
self.resource._require_relative_path(f"{lnk}/..")
704+
if os.path.islink(lnk) is True:
705+
os.unlink(lnk)
704706
os.symlink("/", lnk)
705707

706708
def _post_update(self) -> None:

0 commit comments

Comments
 (0)