Skip to contentSkip to conversation

Open stdin as read/write

PATCH Applied Sven Vermeulen 2 participants 2 messages May 1, 2013 – Oct 16, 2013 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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

---
 policycoreutils/newrole/newrole.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
policycoreutils/newrole/newrole.c +1 -1
index 8fbf2d0..dfb8c7f 100644
@@ -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);
Signature · 7 lines
1.8.1.5


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to [email protected] with
the words "unsubscribe selinux" without quotes as the message.
#1 lore raw
Quoted 8 lines · Sven Vermeulen

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

Thanks, applied.

--
This message was distributed to subscribers of the selinux mailing list. If you no longer wish to subscribe, send mail to [email protected] with the words "unsubscribe selinux" without quotes as the message.