]> git.ipfire.org Git - thirdparty/shadow.git/commit
lib/: Set O_CLOEXEC for static FILE handles
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 6 Jan 2025 16:24:13 +0000 (17:24 +0100)
committerAlejandro Colomar <alx@kernel.org>
Fri, 10 Jan 2025 09:23:57 +0000 (10:23 +0100)
commitaebc4dd8c69fbd06442e10b4e107f64b45d855da
tree6b4ecd73315de87bf8364978af7e51a578f45100
parenta772484f00eae0f8a4d5e73f23b36c50445c3c51
lib/: Set O_CLOEXEC for static FILE handles

With glibc we can use "e" in mode argument to set O_CLOEXEC on
opened files. The /etc/shadow and /etc/gshadow file handles should
be protected to make sure that they are never passed to child
processes by accident.

Reviewed-by: Alejandro Colomar <alx@kernel.org>
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
lib/gshadow.c
lib/shadow.c