[gvfs/gnome-2-32: 2/3] sftp: Close pty master in child process



commit 0b629b69457e84415364c3ea5371e61691115828
Author: Tomas Bzatek <tbzatek redhat com>
Date:   Fri Nov 12 16:37:05 2010 +0100

    sftp: Close pty master in child process
    
    Prevent fd leakage and possible selinux alert.

 daemon/pty_open.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/daemon/pty_open.c b/daemon/pty_open.c
index 6f6d83e..22fa6b9 100644
--- a/daemon/pty_open.c
+++ b/daemon/pty_open.c
@@ -448,6 +448,7 @@ _pty_fork_on_pty_name(const char *path, int parent_fd, char **env_add,
 		break;
 	case 0:
 		/* Child. Close the parent's ends of the pipes. */
+		close(parent_fd);
 		close(ready_a[0]);
 		close(ready_b[1]);
 	



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]