diff options
author | Petr Lautrbach <plautrba@redhat.com> | 2016-03-10 10:19:56 +0100 |
---|---|---|
committer | Petr Lautrbach <plautrba@redhat.com> | 2016-03-10 10:34:37 +0100 |
commit | a0c9496cc826957fe0f3926f619e073f17a9ab4d (patch) | |
tree | 1f4fc19ef7cef27fdf851af386338418ff14c1d8 /catalog | |
parent | c41d3b3a0ca1c53cbf05563f00bcef72db58d9b0 (diff) |
socket_address_listen - do not rely on errno
Currently socket_address_listen() calls mac_selinux_bind() to bind a UNIX
socket and checks its return value and errno for EADDRINUSE. This is not
correct. When there's an SELinux context change made for the new socket,
bind() is not the last function called in mac_selinux_bind(). In that
case the last call is setfscreatecon() from libselinux which can change
errno as it uses access() to check if /proc/thread-self is available.
It fails on kernels before 3.17 and errno is set to ENOENT.
It's safe to check only the return value at it's set to -errno.
Diffstat (limited to 'catalog')
0 files changed, 0 insertions, 0 deletions