diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-20 18:14:03 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-20 18:14:03 +0000 |
commit | de676a36f92400fab1781e0d9762cd1b7cdeab92 (patch) | |
tree | f6cb300fd10de8d50b04b4b9067537ce57d34b38 | |
parent | fbf2d7c22ba18d34a0d6b63cfcde9ddcca2be2fc (diff) |
sprinkle u_int throughout pty subsystem, ok markus
-rw-r--r-- | usr.bin/ssh/channels.c | 8 | ||||
-rw-r--r-- | usr.bin/ssh/clientloop.c | 16 | ||||
-rw-r--r-- | usr.bin/ssh/monitor_wrap.c | 2 | ||||
-rw-r--r-- | usr.bin/ssh/monitor_wrap.h | 4 | ||||
-rw-r--r-- | usr.bin/ssh/serverloop.c | 8 | ||||
-rw-r--r-- | usr.bin/ssh/ssh.c | 8 | ||||
-rw-r--r-- | usr.bin/ssh/sshpty.c | 7 | ||||
-rw-r--r-- | usr.bin/ssh/sshpty.h | 6 |
8 files changed, 30 insertions, 29 deletions
diff --git a/usr.bin/ssh/channels.c b/usr.bin/ssh/channels.c index e0945b1fa24..c87695c7dd7 100644 --- a/usr.bin/ssh/channels.c +++ b/usr.bin/ssh/channels.c @@ -2725,10 +2725,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/usr.bin/ssh/clientloop.c b/usr.bin/ssh/clientloop.c index b7dad903751..89d7af88017 100644 --- a/usr.bin/ssh/clientloop.c +++ b/usr.bin/ssh/clientloop.c @@ -430,10 +430,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(); } } @@ -1877,10 +1877,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/usr.bin/ssh/monitor_wrap.c b/usr.bin/ssh/monitor_wrap.c index 038bd5d3645..61728270f65 100644 --- a/usr.bin/ssh/monitor_wrap.c +++ b/usr.bin/ssh/monitor_wrap.c @@ -626,7 +626,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/usr.bin/ssh/monitor_wrap.h b/usr.bin/ssh/monitor_wrap.h index 16b8140a79b..132ba646545 100644 --- a/usr.bin/ssh/monitor_wrap.h +++ b/usr.bin/ssh/monitor_wrap.h @@ -1,4 +1,4 @@ -/* $OpenBSD: monitor_wrap.h,v 1.14 2004/06/21 17:36:31 avsm Exp $ */ +/* $OpenBSD: monitor_wrap.h,v 1.15 2006/03/20 18:14:02 deraadt Exp $ */ /* * Copyright 2002 Niels Provos <provos@citi.umich.edu> @@ -67,7 +67,7 @@ OM_uint32 mm_ssh_gssapi_checkmic(Gssctxt *, gss_buffer_t, gss_buffer_t); struct Session; void mm_terminate(void); -int mm_pty_allocate(int *, int *, char *, int); +int mm_pty_allocate(int *, int *, char *, size_t); void mm_session_pty_cleanup2(struct Session *); /* SSHv1 interfaces */ diff --git a/usr.bin/ssh/serverloop.c b/usr.bin/ssh/serverloop.c index 26adf31a266..0f73a9fecf4 100644 --- a/usr.bin/ssh/serverloop.c +++ b/usr.bin/ssh/serverloop.c @@ -878,10 +878,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/usr.bin/ssh/ssh.c b/usr.bin/ssh/ssh.c index bb99ca77142..dfde62f85c8 100644 --- a/usr.bin/ssh/ssh.c +++ b/usr.bin/ssh/ssh.c @@ -874,10 +874,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/usr.bin/ssh/sshpty.c b/usr.bin/ssh/sshpty.c index 5cd49b38bd4..43847271d55 100644 --- a/usr.bin/ssh/sshpty.c +++ b/usr.bin/ssh/sshpty.c @@ -41,7 +41,7 @@ */ int -pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, int namebuflen) +pty_allocate(int *ptyfd, int *ttyfd, char *namebuf, size_t namebuflen) { char buf[64]; int i; @@ -117,11 +117,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; diff --git a/usr.bin/ssh/sshpty.h b/usr.bin/ssh/sshpty.h index a7de7370081..9a39e4a1399 100644 --- a/usr.bin/ssh/sshpty.h +++ b/usr.bin/ssh/sshpty.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sshpty.h,v 1.6 2006/02/07 01:42:00 stevesk Exp $ */ +/* $OpenBSD: sshpty.h,v 1.7 2006/03/20 18:14:02 deraadt Exp $ */ /* * Author: Tatu Ylonen <ylo@cs.hut.fi> @@ -23,10 +23,10 @@ struct termios get_saved_tio(void); void leave_raw_mode(void); void enter_raw_mode(void); -int pty_allocate(int *, int *, char *, int); +int pty_allocate(int *, int *, char *, size_t); void pty_release(const char *); void pty_make_controlling_tty(int *, const char *); -void pty_change_window_size(int, int, int, int, int); +void pty_change_window_size(int, u_int, u_int, u_int, u_int); void pty_setowner(struct passwd *, const char *); #endif /* SSHPTY_H */ |