Guard metadata repair and doc sync scripts against symlink targets so repo maintenance tasks cannot overwrite arbitrary local files. Replace recursive skill discovery with an iterative walk that skips symlinked directories, and harden the VideoDB listener to write only private regular files in the user-owned state directory. Also fix the broken pr:preflight script entry and make the last30days skill stop embedding raw user arguments directly in the shell command.
12 lines
258 B
Python
12 lines
258 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
def is_safe_regular_file(path: str | Path) -> bool:
|
|
candidate = Path(path)
|
|
try:
|
|
return candidate.is_file() and not candidate.is_symlink()
|
|
except OSError:
|
|
return False
|