=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshpty.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- src/usr.bin/ssh/sshpty.c 2002/06/23 03:30:58 1.5 +++ src/usr.bin/ssh/sshpty.c 2002/06/23 21:06:13 1.6 @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshpty.c,v 1.5 2002/06/23 03:30:58 deraadt Exp $"); +RCSID("$OpenBSD: sshpty.c,v 1.6 2002/06/23 21:06:13 deraadt Exp $"); #include #include "sshpty.h" @@ -225,9 +225,8 @@ if (fd < 0) error("open /dev/tty failed - could not set controlling tty: %.100s", strerror(errno)); - else { + else close(fd); - } } /* Changes the window size associated with the pty. */ @@ -237,6 +236,7 @@ int xpixel, int ypixel) { struct winsize w; + w.ws_row = row; w.ws_col = col; w.ws_xpixel = xpixel; @@ -274,7 +274,7 @@ if (st.st_uid != pw->pw_uid || st.st_gid != gid) { if (chown(ttyname, pw->pw_uid, gid) < 0) { if (errno == EROFS && - (st.st_uid == pw->pw_uid || st.st_uid == 0)) + (st.st_uid == pw->pw_uid || st.st_uid == 0)) error("chown(%.100s, %u, %u) failed: %.100s", ttyname, pw->pw_uid, gid, strerror(errno));