Compare commits

..

No commits in common. "0be4944a74868544215a09440cf2ec383ded7574" and "42056f3df653c46a684268cf5bbfb6b8e67d94b1" have entirely different histories.

12
app.py
View file

@ -1209,15 +1209,15 @@ SYSCTL_AUDIT_KEYS = (
def _sysctl_audit_command() -> str: def _sysctl_audit_command() -> str:
script = f'''import glob, json script = f'''import glob, json, subprocess
from pathlib import Path
keys = {SYSCTL_AUDIT_KEYS!r} keys = {SYSCTL_AUDIT_KEYS!r}
live, errors = {{}}, {{}} live, errors = {{}}, {{}}
for key in keys: for key in keys:
try: result = subprocess.run(["sysctl", "-n", key], capture_output=True, text=True)
live[key] = Path("/proc/sys/" + key.replace(".", "/")).read_text().strip() if result.returncode == 0:
except OSError as exc: live[key] = result.stdout.strip()
errors[key] = str(exc)[:160] else:
errors[key] = result.stderr.strip()[:160]
persistent = {{}} persistent = {{}}
for path in ["/etc/sysctl.conf", *sorted(glob.glob("/etc/sysctl.d/*.conf"))]: for path in ["/etc/sysctl.conf", *sorted(glob.glob("/etc/sysctl.d/*.conf"))]:
try: try: