diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | channels.c | 11 | ||||
-rw-r--r-- | channels.h | 4 | ||||
-rw-r--r-- | session.c | 16 | ||||
-rw-r--r-- | session.h | 8 |
5 files changed, 27 insertions, 20 deletions
@@ -29,6 +29,12 @@ | |||
29 | - deraadt@cvs.openbsd.org 2002/06/23 21:06:13 | 29 | - deraadt@cvs.openbsd.org 2002/06/23 21:06:13 |
30 | [sshpty.c] | 30 | [sshpty.c] |
31 | KNF | 31 | KNF |
32 | - deraadt@cvs.openbsd.org 2002/06/23 21:06:41 | ||
33 | [channels.c channels.h session.c session.h] | ||
34 | display, screen, row, col, xpixel, ypixel are u_int; markus ok | ||
35 | - (bal) Also fixed IPADDR_IN_DISPLAY case where display, screen, row, col, | ||
36 | xpixel are u_int. | ||
37 | |||
32 | 38 | ||
33 | 20020623 | 39 | 20020623 |
34 | - (stevesk) [configure.ac] bug #255 LOGIN_NEEDS_UTMPX for AIX. | 40 | - (stevesk) [configure.ac] bug #255 LOGIN_NEEDS_UTMPX for AIX. |
@@ -1073,4 +1079,4 @@ | |||
1073 | - (stevesk) entropy.c: typo in debug message | 1079 | - (stevesk) entropy.c: typo in debug message |
1074 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ | 1080 | - (djm) ssh-keygen -i needs seeded RNG; report from markus@ |
1075 | 1081 | ||
1076 | $Id: ChangeLog,v 1.2262 2002/06/23 21:42:50 mouring Exp $ | 1082 | $Id: ChangeLog,v 1.2263 2002/06/23 21:48:28 mouring Exp $ |
diff --git a/channels.c b/channels.c index d34411e18..b85ee5770 100644 --- a/channels.c +++ b/channels.c | |||
@@ -39,7 +39,7 @@ | |||
39 | */ | 39 | */ |
40 | 40 | ||
41 | #include "includes.h" | 41 | #include "includes.h" |
42 | RCSID("$OpenBSD: channels.c,v 1.175 2002/06/10 22:28:41 markus Exp $"); | 42 | RCSID("$OpenBSD: channels.c,v 1.176 2002/06/23 21:06:41 deraadt Exp $"); |
43 | 43 | ||
44 | #include "ssh.h" | 44 | #include "ssh.h" |
45 | #include "ssh1.h" | 45 | #include "ssh1.h" |
@@ -2328,12 +2328,12 @@ channel_connect_to(const char *host, u_short port) | |||
2328 | 2328 | ||
2329 | /* | 2329 | /* |
2330 | * Creates an internet domain socket for listening for X11 connections. | 2330 | * Creates an internet domain socket for listening for X11 connections. |
2331 | * Returns a suitable display number for the DISPLAY variable, or -1 if | 2331 | * Returns 0 and a suitable display number for the DISPLAY variable |
2332 | * an error occurs. | 2332 | * stored in display_numberp , or -1 if an error occurs. |
2333 | */ | 2333 | */ |
2334 | int | 2334 | int |
2335 | x11_create_display_inet(int x11_display_offset, int x11_use_localhost, | 2335 | x11_create_display_inet(int x11_display_offset, int x11_use_localhost, |
2336 | int single_connection) | 2336 | int single_connection, u_int *display_numberp) |
2337 | { | 2337 | { |
2338 | Channel *nc = NULL; | 2338 | Channel *nc = NULL; |
2339 | int display_number, sock; | 2339 | int display_number, sock; |
@@ -2431,7 +2431,8 @@ x11_create_display_inet(int x11_display_offset, int x11_use_localhost, | |||
2431 | } | 2431 | } |
2432 | 2432 | ||
2433 | /* Return the display number for the DISPLAY environment variable. */ | 2433 | /* Return the display number for the DISPLAY environment variable. */ |
2434 | return display_number; | 2434 | *display_numberp = display_number; |
2435 | return (0); | ||
2435 | } | 2436 | } |
2436 | 2437 | ||
2437 | static int | 2438 | static int |
diff --git a/channels.h b/channels.h index 9ceff3e73..64f6c41fa 100644 --- a/channels.h +++ b/channels.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: channels.h,v 1.68 2002/06/10 22:28:41 markus Exp $ */ | 1 | /* $OpenBSD: channels.h,v 1.69 2002/06/23 21:06:41 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -205,7 +205,7 @@ int channel_setup_remote_fwd_listener(const char *, u_short, int); | |||
205 | /* x11 forwarding */ | 205 | /* x11 forwarding */ |
206 | 206 | ||
207 | int x11_connect_display(void); | 207 | int x11_connect_display(void); |
208 | int x11_create_display_inet(int, int, int); | 208 | int x11_create_display_inet(int, int, int, u_int *); |
209 | void x11_input_open(int, u_int32_t, void *); | 209 | void x11_input_open(int, u_int32_t, void *); |
210 | void x11_request_forwarding_with_spoofing(int, const char *, const char *); | 210 | void x11_request_forwarding_with_spoofing(int, const char *, const char *); |
211 | void deny_input_open(int, u_int32_t, void *); | 211 | void deny_input_open(int, u_int32_t, void *); |
@@ -33,7 +33,7 @@ | |||
33 | */ | 33 | */ |
34 | 34 | ||
35 | #include "includes.h" | 35 | #include "includes.h" |
36 | RCSID("$OpenBSD: session.c,v 1.139 2002/06/23 20:39:45 deraadt Exp $"); | 36 | RCSID("$OpenBSD: session.c,v 1.140 2002/06/23 21:06:41 deraadt Exp $"); |
37 | 37 | ||
38 | #include "ssh.h" | 38 | #include "ssh.h" |
39 | #include "ssh1.h" | 39 | #include "ssh1.h" |
@@ -1970,9 +1970,9 @@ session_setup_x11fwd(Session *s) | |||
1970 | debug("X11 display already set."); | 1970 | debug("X11 display already set."); |
1971 | return 0; | 1971 | return 0; |
1972 | } | 1972 | } |
1973 | s->display_number = x11_create_display_inet(options.x11_display_offset, | 1973 | if (x11_create_display_inet(options.x11_display_offset, |
1974 | options.x11_use_localhost, s->single_connection); | 1974 | options.x11_use_localhost, s->single_connection, |
1975 | if (s->display_number == -1) { | 1975 | &s->display_number) == -1) { |
1976 | debug("x11_create_display_inet failed."); | 1976 | debug("x11_create_display_inet failed."); |
1977 | return 0; | 1977 | return 0; |
1978 | } | 1978 | } |
@@ -1986,9 +1986,9 @@ session_setup_x11fwd(Session *s) | |||
1986 | * different than the DISPLAY string for localhost displays. | 1986 | * different than the DISPLAY string for localhost displays. |
1987 | */ | 1987 | */ |
1988 | if (options.x11_use_localhost) { | 1988 | if (options.x11_use_localhost) { |
1989 | snprintf(display, sizeof display, "localhost:%d.%d", | 1989 | snprintf(display, sizeof display, "localhost:%u.%u", |
1990 | s->display_number, s->screen); | 1990 | s->display_number, s->screen); |
1991 | snprintf(auth_display, sizeof auth_display, "unix:%d.%d", | 1991 | snprintf(auth_display, sizeof auth_display, "unix:%u.%u", |
1992 | s->display_number, s->screen); | 1992 | s->display_number, s->screen); |
1993 | s->display = xstrdup(display); | 1993 | s->display = xstrdup(display); |
1994 | s->auth_display = xstrdup(auth_display); | 1994 | s->auth_display = xstrdup(auth_display); |
@@ -2004,10 +2004,10 @@ session_setup_x11fwd(Session *s) | |||
2004 | return 0; | 2004 | return 0; |
2005 | } | 2005 | } |
2006 | memcpy(&my_addr, he->h_addr_list[0], sizeof(struct in_addr)); | 2006 | memcpy(&my_addr, he->h_addr_list[0], sizeof(struct in_addr)); |
2007 | snprintf(display, sizeof display, "%.50s:%d.%d", inet_ntoa(my_addr), | 2007 | snprintf(display, sizeof display, "%.50s:%u.%u", inet_ntoa(my_addr), |
2008 | s->display_number, s->screen); | 2008 | s->display_number, s->screen); |
2009 | #else | 2009 | #else |
2010 | snprintf(display, sizeof display, "%.400s:%d.%d", hostname, | 2010 | snprintf(display, sizeof display, "%.400s:%u.%u", hostname, |
2011 | s->display_number, s->screen); | 2011 | s->display_number, s->screen); |
2012 | #endif | 2012 | #endif |
2013 | s->display = xstrdup(display); | 2013 | s->display = xstrdup(display); |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: session.h,v 1.17 2002/03/29 18:59:32 markus Exp $ */ | 1 | /* $OpenBSD: session.h,v 1.18 2002/06/23 21:06:41 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000, 2001 Markus Friedl. All rights reserved. |
@@ -37,15 +37,15 @@ struct Session { | |||
37 | /* tty */ | 37 | /* tty */ |
38 | char *term; | 38 | char *term; |
39 | int ptyfd, ttyfd, ptymaster; | 39 | int ptyfd, ttyfd, ptymaster; |
40 | int row, col, xpixel, ypixel; | 40 | u_int row, col, xpixel, ypixel; |
41 | char tty[TTYSZ]; | 41 | char tty[TTYSZ]; |
42 | /* last login */ | 42 | /* last login */ |
43 | char hostname[MAXHOSTNAMELEN]; | 43 | char hostname[MAXHOSTNAMELEN]; |
44 | time_t last_login_time; | 44 | time_t last_login_time; |
45 | /* X11 */ | 45 | /* X11 */ |
46 | int display_number; | 46 | u_int display_number; |
47 | char *display; | 47 | char *display; |
48 | int screen; | 48 | u_int screen; |
49 | char *auth_display; | 49 | char *auth_display; |
50 | char *auth_proto; | 50 | char *auth_proto; |
51 | char *auth_data; | 51 | char *auth_data; |