Commit graph

31 commits

Author SHA1 Message Date
Andrea Mazzoleni
819b843163 Add timeout_sec parameter to os_command and os_script interface 2026-09-22 08:15:21 +02:00
Andrea Mazzoleni
4320f0d6b6 Add absolutepath helper for paths that may not exist 2026-09-16 12:24:12 +02:00
Andrea Mazzoleni
c1bcd6a24f Migrate Windows smartctl execution from _wpopen to os_popen and direct process spawning 2026-09-14 18:03:35 +02:00
Andrea Mazzoleni
9f48c87dd4 Encapsulate race-safe process slot synchronization and termination in OS layer for Unix and Windows 2026-09-14 15:00:20 +02:00
Andrea Mazzoleni
a0c7d69067 Expose real operating system process IDs on Windows via os_display_pid()
Some checks failed
Build / build-mac (push) Has been cancelled
Build / build-linux (push) Has been cancelled
Build / build-arm32 (push) Has been cancelled
Build / build-win (push) Has been cancelled
Build / build-freebsd (push) Has been cancelled
Build / build-musl (push) Has been cancelled
CodeQL Advanced / Analyze (c-cpp) (push) Has been cancelled
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
2026-09-05 11:42:01 +02:00
Andrea Mazzoleni
b5a8ef7c33 Terminate entire process group on Unix os_script and os_command timeout to avoid orphaned descendants 2026-09-05 09:45:42 +02:00
Andrea Mazzoleni
11fee73ec4 Separate process waiting from process-reference release to eliminate Windows HANDLE reuse race
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
2026-09-04 13:31:00 +02:00
Andrea Mazzoleni
b383cbc4ba Increase NSS credential buffer limits for run_as_user compatibility
Some checks are pending
Build / build-mac (push) Waiting to run
Build / build-linux (push) Waiting to run
Build / build-arm32 (push) Waiting to run
Build / build-win (push) Waiting to run
Build / build-freebsd (push) Waiting to run
Build / build-musl (push) Waiting to run
CodeQL Advanced / Analyze (c-cpp) (push) Waiting to run
CodeQL Advanced / Analyze (actions) (push) Waiting to run
2026-09-02 00:18:01 +02:00
Andrea Mazzoleni
05e29ae701 Preserve supplementary groups across bracketed privilege changes 2026-09-02 00:03:59 +02:00
Andrea Mazzoleni
586b0a3fd5 Use CLOEXEC pipes for command stdin handling 2026-09-01 12:31:48 +02:00
Andrea Mazzoleni
a6ffe53202 Use raw Linux syscalls for post-fork credential changes 2026-09-01 12:31:48 +02:00
Andrea Mazzoleni
bd856b456b Fix undefined _linux macro typo to __linux__ 2026-08-18 23:33:58 +02:00
Andrea Mazzoleni
3c1772d478 Move user and group resolution before fork for async-signal safety 2026-08-18 23:33:58 +02:00
Andrea Mazzoleni
fa8913a759 Use monotonic clock in os_tick_ms and os_tick_sec on POSIX systems 2026-08-18 23:33:58 +02:00
Andrea Mazzoleni
daf713820e Add os_usleep with bounded sleep loop returning on signal interruption and use it in bandwidth limiter 2026-08-18 23:33:57 +02:00
Andrea Mazzoleni
170759e83c Use direct Linux setresuid/setresgid syscalls for thread-local privilege switching 2026-08-18 23:33:57 +02:00
Andrea Mazzoleni
6b3b60bf87 Add O_CLOEXEC flag to open /dev/null in os_command and os_daemonize 2026-08-18 23:33:57 +02:00
Andrea Mazzoleni
03831386f0 Fix os_wait return type mismatch in UNIX implementation 2026-08-18 23:33:57 +02:00
Andrea Mazzoleni
84297fc6dc Replace malloc with alloca in fork child exec path for async-signal safety 2026-08-18 23:33:57 +02:00
Andrea Mazzoleni
19173754ec Comment explaining why CLOSE_RANGE_CLOEXEC is safe for fexecve binaries in os_spawn 2026-08-18 23:33:57 +02:00
Andrea Mazzoleni
2b71f5727e Guard lower close_range call with fd > 3 in os_exec_script 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
acdf29ac09 Replace VLA envp_dynamic with malloc in fork child exec path 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
b3fdc8d6a5 Add fallback to kill(pid, sig) when process group signaling returns ESRCH in os_term and os_kill 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
6b46e08a1f Configure PR_SET_PDEATHSIG on Linux and Job Objects on Windows to prevent orphaned subprocesses on program crash 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
3878c0e2e6 Silence clang static analyzer warnings 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
1b1ae7cce9 Add new os_kill 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
180278fbb4 Make os_abort to log to os_syslog 2026-08-18 23:33:56 +02:00
Andrea Mazzoleni
effc3be9c2 Sanitize addr2line binary path via strspn whitelist before system call 2026-08-18 23:33:55 +02:00
Andrea Mazzoleni
d6b51d61e7 Sync the OS interface with the daemon 2026-08-18 23:33:55 +02:00
Andrea Mazzoleni
056a037761 Abort on privilege switch failures unless errno is EPERM 2026-08-18 23:33:55 +02:00
Andrea Mazzoleni
00b4cbafd0 Merge the CLI and Daemon portable interface 2026-08-18 23:33:55 +02:00