Bugzilla – Attachment 1064 Details for
Bug 1153
DISPLAY should be set form the connected IP, not the hostname
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch against 20060208 -- see bug report for details
ossh-patch-SNAP (text/plain), 1.56 KB, created by
Simon Vallet
on 2006-02-09 22:44:59 AEDT
(
hide
)
Description:
Patch against 20060208 -- see bug report for details
Filename:
MIME Type:
Creator:
Simon Vallet
Created:
2006-02-09 22:44:59 AEDT
Size:
1.56 KB
patch
obsolete
>--- session.c.orig 2006-02-09 11:50:01.887963000 +0100 >+++ session.c 2006-02-09 11:50:01.719963000 +0100 >@@ -2375,8 +2375,7 @@ > } > > /* Set up a suitable value for the DISPLAY variable. */ >- if (gethostname(hostname, sizeof(hostname)) < 0) >- fatal("gethostname: %.100s", strerror(errno)); >+ > /* > * auth_display must be used as the displayname when the > * authorization entry is added with xauth(1). This will be >@@ -2390,21 +2389,29 @@ > s->display = xstrdup(display); > s->auth_display = xstrdup(auth_display); > } else { >-#ifdef IPADDR_IN_DISPLAY > struct hostent *he; > struct in_addr my_addr; > >- he = gethostbyname(hostname); >- if (he == NULL) { >+ inet_aton(get_local_ipaddr(packet_get_connection_in()), &my_addr); >+ he = gethostbyaddr(&my_addr, sizeof(struct in_addr), AF_INET); >+ >+ if (he == NULL) { /* Try again with gethostname */ >+ if (gethostname(hostname, sizeof(hostname)) < 0) >+ fatal("gethostname: %.100s", strerror(errno)); >+ >+ if ((he = gethostbyname(hostname)) == NULL) { > error("Can't get IP address for X11 DISPLAY."); > packet_send_debug("Can't get IP address for X11 DISPLAY."); > return 0; > } >+ } >+ >+#ifdef IPADDR_IN_DISPLAY > memcpy(&my_addr, he->h_addr_list[0], sizeof(struct in_addr)); > snprintf(display, sizeof display, "%.50s:%u.%u", inet_ntoa(my_addr), > s->display_number, s->screen); > #else >- snprintf(display, sizeof display, "%.400s:%u.%u", hostname, >+ snprintf(display, sizeof display, "%.400s:%u.%u", he->h_name, > s->display_number, s->screen); > #endif > s->display = xstrdup(display);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
tylercashea33
:
ok+
tylercashea33
:
ok+
Actions:
View
|
Diff
Attachments on
bug 1153
: 1064 |
1178