potiuk commented on code in PR #64618:
URL: https://github.com/apache/airflow/pull/64618#discussion_r3063320419
##########
airflow-ctl/src/airflowctl/api/client.py:
##########
@@ -143,6 +144,14 @@ def _bounded_get_new_password() -> str:
)
+def _safe_path_under_airflow_home(airflow_home: str, filename: str) -> str:
+ base = Path(airflow_home).resolve()
+ target = (base / filename).resolve()
+ if base not in target.parents and target != base:
Review Comment:
This can be replaced by `target.is_relative_to(base)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]