=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/sshpty.c,v retrieving revision 1.4 retrieving revision 1.4.2.2 diff -u -r1.4 -r1.4.2.2 --- src/usr.bin/ssh/sshpty.c 2001/12/19 07:18:56 1.4 +++ src/usr.bin/ssh/sshpty.c 2003/04/03 22:35:18 1.4.2.2 @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshpty.c,v 1.4 2001/12/19 07:18:56 deraadt Exp $"); +RCSID("$OpenBSD: sshpty.c,v 1.4.2.2 2003/04/03 22:35:18 miod 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,13 +274,13 @@ 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)) - error("chown(%.100s, %d, %d) failed: %.100s", - ttyname, pw->pw_uid, gid, + (st.st_uid == pw->pw_uid || st.st_uid == 0)) + debug("chown(%.100s, %u, %u) failed: %.100s", + ttyname, (u_int)pw->pw_uid, (u_int)gid, strerror(errno)); else - fatal("chown(%.100s, %d, %d) failed: %.100s", - ttyname, pw->pw_uid, gid, + fatal("chown(%.100s, %u, %u) failed: %.100s", + ttyname, (u_int)pw->pw_uid, (u_int)gid, strerror(errno)); } } @@ -289,7 +289,7 @@ if (chmod(ttyname, mode) < 0) { if (errno == EROFS && (st.st_mode & (S_IRGRP | S_IROTH)) == 0) - error("chmod(%.100s, 0%o) failed: %.100s", + debug("chmod(%.100s, 0%o) failed: %.100s", ttyname, mode, strerror(errno)); else fatal("chmod(%.100s, 0%o) failed: %.100s",