From: Yu Watanabe Date: Wed, 19 Nov 2025 23:19:46 +0000 (+0900) Subject: core: Verify inherited FDs are writable for stdout/stderr (#39674) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3f91ffe0fe900660a8c073ec54b3951e33b5c74c;p=thirdparty%2Fsystemd.git core: Verify inherited FDs are writable for stdout/stderr (#39674) When inheriting file descriptors for stdout/stderr (either from stdin or when making stderr inherit from stdout), we previously just assumed they would be writable and dup'd them. This could lead to broken setups if the inherited FD was actually opened read-only. Before dup'ing any inherited FDs to stdout/stderr, verify they are actually writable using the new fd_is_writable() helper. If not, fall back to /dev/null (or reopen the terminal in the TTY case) with a warning, rather than silently creating a broken setup where output operations would fail. --- 3f91ffe0fe900660a8c073ec54b3951e33b5c74c