https://bugs.kde.org/show_bug.cgi?id=400929

--- Comment #17 from stefano.al...@gmail.com ---
The previous patch I had posted was actually a quick fix, since, as I wrote, I
didn't really find out the cause of the problem with listen. However, upon
further inspection, it turned out that the problem was caused by closing all
the file descriptors greater than 2 before calling socket. By adding some debug
code I found out that the socket was given file descriptor 3, and calling
getsockopt with SO_TYPE on this fd always returned 2, which is SOCK_DGRAM,
regardless of which type of socket was required in the call to socket. I don't
know the reason for this behavior, the only thing I noticed is that when
execute_kwallet is called the file descriptor 3 is indeed assigned to another
socket, but I've no clue on the origin of this socket. Since we don't want
kwallet to inherit irrelevant file descriptors from his parent, I replaced the
call to close with a call to fcntl, which sets the FD_CLOEXEC flag. This solves
the problem and should prevent undesired fd inheritance as well.

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to