From 148de80c5366ede880c9e7a26d5b1e1599610c57 Mon Sep 17 00:00:00 2001 From: djm Date: Sun, 26 Mar 2006 03:04:36 +0000 Subject: [PATCH] - 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 | 3 +++ channels.c | 8 ++++---- clientloop.c | 16 ++++++++-------- monitor_wrap.c | 2 +- serverloop.c | 8 ++++---- ssh.c | 8 ++++---- sshpty.c | 7 ++++--- 7 files changed, 28 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index d3c962b4..30a1430d 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 diff --git a/channels.c b/channels.c index ce868dc4..6cb88ad4 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 d321cb8b..36a4a64a 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 7536bf30..e5a65491 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 816215e0..3bc0c5a7 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 3615d1c4..55021844 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 2e42aee1..9ac4903e 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; -- 2.45.2