DVG-5258734_pty_permission_fix.patch   [plain text]


diff -uNr ../openssh-4.5p1.orig/session.c ./session.c
--- ../openssh-4.5p1.orig/session.c	2006-10-23 10:01:56.000000000 -0700
+++ ./session.c	2007-06-15 11:23:17.000000000 -0700
@@ -1846,8 +1846,10 @@
 		n_bytes = packet_remaining();
 	tty_parse_modes(s->ttyfd, &n_bytes);
 
+#ifndef __APPLE_PRIVPTY__
 	if (!use_privsep)
 		pty_setowner(s->pw, s->tty);
+#endif
 
 	/* Set window size from the packet. */
 	pty_change_window_size(s->ptyfd, s->row, s->col, s->xpixel, s->ypixel);
@@ -2085,9 +2087,11 @@
 	if (s->pid != 0)
 		record_logout(s->pid, s->tty, s->pw->pw_name);
 
+#ifndef __APPLE_PRIVPTY__
 	/* Release the pseudo-tty. */
 	if (getuid() == 0)
 		pty_release(s->tty);
+#endif
 
 	/*
 	 * Close the server side of the socket pairs.  We must do this after