From 71a73671305a2248a6c4a243134ebf28f7d8ee7a Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sun, 26 Mar 2006 14:04:36 +1100 Subject: - deraadt@cvs.openbsd.org 2006/03/20 18:14:02 [channels.c clientloop.c monitor_wrap.c monitor_wrap.h serverloop.c] [ssh.c sshpty.c sshpty.h] sprinkle u_int throughout pty subsystem, ok markus --- ChangeLog | 5 ++++- channels.c | 8 ++++---- clientloop.c | 16 ++++++++-------- monitor_wrap.c | 2 +- serverloop.c | 8 ++++---- ssh.c | 8 ++++---- sshpty.c | 7 ++++--- 7 files changed, 29 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index efe73053f..70ecbcdcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -74,6 +74,9 @@ - deraadt@cvs.openbsd.org 2006/03/20 17:17:23 [ssh-rsa.c] in a switch (), break after return or goto is stupid + - deraadt@cvs.openbsd.org 2006/03/20 18:14:02 + [channels.c clientloop.c monitor_wrap.c monitor_wrap.h serverloop.c ssh.c sshpty.c sshpty.h] + sprinkle u_int throughout pty subsystem, ok markus 20060325 - OpenBSD CVS Sync @@ -4331,4 +4334,4 @@ - (djm) Trim deprecated options from INSTALL. Mention UsePAM - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu -$Id: ChangeLog,v 1.4262 2006/03/26 03:03:21 djm Exp $ +$Id: ChangeLog,v 1.4263 2006/03/26 03:04:36 djm Exp $ diff --git a/channels.c b/channels.c index ce868dc4e..6cb88ad44 100644 --- a/channels.c +++ b/channels.c @@ -2737,10 +2737,10 @@ channel_send_window_changes(void) if (ioctl(channels[i]->rfd, TIOCGWINSZ, &ws) < 0) continue; channel_request_start(i, "window-change", 0); - packet_put_int(ws.ws_col); - packet_put_int(ws.ws_row); - packet_put_int(ws.ws_xpixel); - packet_put_int(ws.ws_ypixel); + packet_put_int((u_int)ws.ws_col); + packet_put_int((u_int)ws.ws_row); + packet_put_int((u_int)ws.ws_xpixel); + packet_put_int((u_int)ws.ws_ypixel); packet_send(); } } diff --git a/clientloop.c b/clientloop.c index d321cb8bf..36a4a64ae 100644 --- a/clientloop.c +++ b/clientloop.c @@ -434,10 +434,10 @@ client_check_window_change(void) if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) < 0) return; packet_start(SSH_CMSG_WINDOW_SIZE); - packet_put_int(ws.ws_row); - packet_put_int(ws.ws_col); - packet_put_int(ws.ws_xpixel); - packet_put_int(ws.ws_ypixel); + packet_put_int((u_int)ws.ws_row); + packet_put_int((u_int)ws.ws_col); + packet_put_int((u_int)ws.ws_xpixel); + packet_put_int((u_int)ws.ws_ypixel); packet_send(); } } @@ -1881,10 +1881,10 @@ client_session2_setup(int id, int want_tty, int want_subsystem, channel_request_start(id, "pty-req", 0); packet_put_cstring(term != NULL ? term : ""); - packet_put_int(ws.ws_col); - packet_put_int(ws.ws_row); - packet_put_int(ws.ws_xpixel); - packet_put_int(ws.ws_ypixel); + packet_put_int((u_int)ws.ws_col); + packet_put_int((u_int)ws.ws_row); + packet_put_int((u_int)ws.ws_xpixel); + packet_put_int((u_int)ws.ws_ypixel); tio = get_saved_tio(); tty_make_modes(-1, tiop != NULL ? tiop : &tio); packet_send(); diff --git a/monitor_wrap.c b/monitor_wrap.c index 7536bf305..e5a65491d 100644 --- a/monitor_wrap.c +++ b/monitor_wrap.c @@ -636,7 +636,7 @@ mm_send_keystate(struct monitor *monitor) } int -mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) +mm_pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) { Buffer m; char *p, *msg; diff --git a/serverloop.c b/serverloop.c index 816215e05..3bc0c5a76 100644 --- a/serverloop.c +++ b/serverloop.c @@ -880,10 +880,10 @@ server_input_eof(int type, u_int32_t seq, void *ctxt) static void server_input_window_size(int type, u_int32_t seq, void *ctxt) { - int row = packet_get_int(); - int col = packet_get_int(); - int xpixel = packet_get_int(); - int ypixel = packet_get_int(); + u_int row = packet_get_int(); + u_int col = packet_get_int(); + u_int xpixel = packet_get_int(); + u_int ypixel = packet_get_int(); debug("Window change received."); packet_check_eom(); diff --git a/ssh.c b/ssh.c index 3615d1c40..550218444 100644 --- a/ssh.c +++ b/ssh.c @@ -889,10 +889,10 @@ ssh_session(void) /* Store window size in the packet. */ if (ioctl(fileno(stdin), TIOCGWINSZ, &ws) < 0) memset(&ws, 0, sizeof(ws)); - packet_put_int(ws.ws_row); - packet_put_int(ws.ws_col); - packet_put_int(ws.ws_xpixel); - packet_put_int(ws.ws_ypixel); + packet_put_int((u_int)ws.ws_row); + packet_put_int((u_int)ws.ws_col); + packet_put_int((u_int)ws.ws_xpixel); + packet_put_int((u_int)ws.ws_ypixel); /* Store tty modes in the packet. */ tty_make_modes(fileno(stdin), NULL); diff --git a/sshpty.c b/sshpty.c index 2e42aee11..9ac4903ef 100644 --- a/sshpty.c +++ b/sshpty.c @@ -46,7 +46,7 @@ */ int -pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) +pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) { /* openpty(3) exists in OSF/1 and some other os'es */ char *name; @@ -169,11 +169,12 @@ pty_make_controlling_tty(int *ttyfd, const char *tty) /* Changes the window size associated with the pty. */ void -pty_change_window_size(int ptyfd, int row, int col, - int xpixel, int ypixel) +pty_change_window_size(int ptyfd, u_int row, u_int col, + u_int xpixel, u_int ypixel) { struct winsize w; + /* may truncate u_int -> u_short */ w.ws_row = row; w.ws_col = col; w.ws_xpixel = xpixel; -- cgit v1.2.3