]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libmount: Use waitpid() when waiting for mount helper child process
authorVratislav Podzimek <vpodzime@redhat.com>
Mon, 6 Nov 2017 10:28:17 +0000 (11:28 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 6 Nov 2017 12:05:04 +0000 (13:05 +0100)
commit7440665f9bf6b7fe6e14b20ec0e825023e159a6f
tree64efd0e1ea8995ee7f0a7bfe6a3e8194d8b24f66
parenta9b9d59d62129e36cc96c584bbde86394044661a
libmount: Use waitpid() when waiting for mount helper child process

Using wait() in a library may be problematic as it may reap some
totally unrelated child process instead of the just forked
one. That can result in the library call doing weird things and
returning bad return values, but also in a breakage of an
arbitrary other thing in the program using the library.

[[kzak@redhat.com: - use waitpid() for umount too
                   - keep the current codding style]

Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/context_mount.c
libmount/src/context_umount.c