hardlinked source files are refused, remote schema URLs require an explicit flag, generated harvest artifacts use the hardened bundle writer, and task/handler/playbook YAML writes go through one safety gate.
This commit is contained in:
parent
f56f076765
commit
44d1a22db4
11 changed files with 202 additions and 37 deletions
|
|
@ -186,7 +186,11 @@ def _read_first_existing_text(
|
|||
try:
|
||||
fd = open_no_follow_path(path)
|
||||
st = os.fstat(fd)
|
||||
if not stat.S_ISREG(st.st_mode) or st.st_size > max_bytes:
|
||||
if (
|
||||
not stat.S_ISREG(st.st_mode)
|
||||
or st.st_nlink > 1
|
||||
or st.st_size > max_bytes
|
||||
):
|
||||
continue
|
||||
data = os.read(fd, max_bytes + 1)
|
||||
if len(data) > max_bytes:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue