]> git.ipfire.org Git - thirdparty/shadow.git/commit
src/gpasswd.c: fix segfault in clean up callbacks
authorIker Pedrosa <ipedrosa@redhat.com>
Fri, 19 Dec 2025 15:27:54 +0000 (16:27 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Mon, 22 Dec 2025 17:55:33 +0000 (18:55 +0100)
commit16a388c644bb124bc5523839f64587669e5c171d
tree875b177c7ac8ba6b9cda4919f3d6421ab28b7225
parentfa889977190ad89664ef3a50db467d6c3a6878bc
src/gpasswd.c: fix segfault in clean up callbacks

The gpasswd utility was segfaulting when cleanup functions were called
because these functions expect a pointer to `process_selinux` but was
being passed NULL. This caused a NULL pointer dereference.

This commits adds the pointer to `process_selinux` to clean up
functions making `gpasswd` consistent with other group utilities.

Reproduction steps:
$ useradd tuser
$ groupadd tuser
$ gpasswd -a tuser tgroup
Adding user tuser to group tgroup
Segmentation fault (core dumped)

Fixes: 4d431898bad8 (2025-10-07; "src/gpasswd.c: chroot or prefix SELinux file context")
Signed-off-by: Iker Pedrosa <ipedrosa@redhat.com>
src/gpasswd.c