Open stdin as read/write

As per the discussion on the selinux development mailinglist, the tmux
application expects the stdin to be writeable. Although perhaps not the most
proper way, having newrole opening the descriptor in read/write keeps the
behaviour in line with what applications expect.

See also http://marc.info/?l=selinux&m=136518126930710&w=2

Signed-off-by: Sven Vermeulen <sven.vermeulen@siphos.be>
This commit is contained in:
Sven Vermeulen 2013-05-01 22:26:32 +02:00 committed by Stephen Smalley
parent 622ebe0994
commit d4209743e9

View File

@ -1223,7 +1223,7 @@ int main(int argc, char *argv[])
fprintf(stderr, _("Could not close descriptors.\n"));
goto err_close_pam;
}
fd = open(ttyn, O_RDONLY | O_NONBLOCK);
fd = open(ttyn, O_RDWR | O_NONBLOCK);
if (fd != 0)
goto err_close_pam;
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) & ~O_NONBLOCK);