]> git.ipfire.org Git - thirdparty/shadow.git/commit
src/useradd.c: Add fmkomstemp() to fix mode of </etc/default/useradd>
authorAlejandro Colomar <alx@kernel.org>
Sun, 29 Sep 2024 11:09:40 +0000 (13:09 +0200)
committerSerge Hallyn <serge@hallyn.com>
Tue, 1 Oct 2024 19:38:59 +0000 (14:38 -0500)
commit759d2373e43700cb5938c4a110174cbb34fbbecb
tree4605da96d8ba079f721cdfa00b37a9fde4bb772b
parente6a5484cedb674b09a46aafe3b1f8901fde62349
src/useradd.c: Add fmkomstemp() to fix mode of </etc/default/useradd>

The mode of the file should be 644, but mkstemp(2) was transforming it
to 600.

To do this, we need a function that accepts a mode parameter.  While we
don't need a flags parameter, to avoid confusion with mkostemp(2), let's
add both a flags and a mode parameter.

Link: <https://github.com/shadow-maint/shadow/pull/1080>
Reported-by: kugarocks <kugacola@gmail.com>
Suggested-by: kugarocks <kugacola@gmail.com>
Tested-by: kugarocks <kugacola@gmail.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
src/useradd.c