selinux/libselinux
Eamon Walsh 61d005b739 libselinux: fix avc_netlink_loop() error caused by nonblocking mode.
avc_open() creates the netlink socket in nonblocking mode.  If the
application later takes control of the netlink socket with
avc_netlink_acquire_fd() and then calls avc_netlink_loop(), it
will fail with EWOULDBLOCK.

To remedy this, remove the O_NONBLOCK flag from the netlink socket
at the start of avc_netlink_loop().  Also, with this fix, there is
no need for avc_open() to ever create a blocking socket, so change
that and update the man page.

-v2: use poll() in avc_netlink_check_nb().  This makes both
avc_netlink_loop() and avc_netlink_check_nb() independent of the
O_NONBLOCK flag.

-v3: move poll() to avc_receive() internal function; patch by
KaiGai Kohei <kaigai@kaigai.gr.jp>

Signed-off-by: Eamon Walsh <ewalsh@tycho.nsa.gov>
2010-03-08 18:15:53 -05:00
..
include libselinux: Export reset_selinux_config() 2009-10-21 19:41:59 -04:00
man libselinux: fix avc_netlink_loop() error caused by nonblocking mode. 2010-03-08 18:15:53 -05:00
src libselinux: fix avc_netlink_loop() error caused by nonblocking mode. 2010-03-08 18:15:53 -05:00
utils Author: Daniel J Walsh 2009-09-28 16:17:23 -04:00
.gitignore Add subdirectory .gitignore files. 2009-10-20 21:25:55 -04:00
ChangeLog bump libsemanage to 2.0.45 and libselinux to 2.0.92 2010-03-06 18:10:51 -05:00
LICENSE initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
VERSION bump libsemanage to 2.0.45 and libselinux to 2.0.92 2010-03-06 18:10:51 -05:00