|
Lines 313-318
client_x11_get_proto(const char *display, const char *xauth_path,
Link Here
|
| 313 |
struct stat st; |
313 |
struct stat st; |
| 314 |
u_int now; |
314 |
u_int now; |
| 315 |
|
315 |
|
|
|
316 |
#if __APPLE__ |
| 317 |
int is_path_to_socket = 0; |
| 318 |
#endif /* __APPLE__ */ |
| 319 |
|
| 316 |
xauthdir = xauthfile = NULL; |
320 |
xauthdir = xauthfile = NULL; |
| 317 |
*_proto = proto; |
321 |
*_proto = proto; |
| 318 |
*_data = data; |
322 |
*_data = data; |
|
Lines 328-333
client_x11_get_proto(const char *display, const char *xauth_path,
Link Here
|
| 328 |
debug("x11_get_proto: DISPLAY not set"); |
332 |
debug("x11_get_proto: DISPLAY not set"); |
| 329 |
return; |
333 |
return; |
| 330 |
} |
334 |
} |
|
|
335 |
#if __APPLE__ |
| 336 |
{ |
| 337 |
/* |
| 338 |
* If using launchd socket, remove the screen number from the end |
| 339 |
* of $DISPLAY. is_path_to_socket is used later in this function |
| 340 |
* to determine if an error should be displayed. |
| 341 |
*/ |
| 342 |
char path[PATH_MAX]; |
| 343 |
struct stat sbuf; |
| 344 |
|
| 345 |
strlcpy(path, display, sizeof(path)); |
| 346 |
if (0 == stat(path, &sbuf)) { |
| 347 |
is_path_to_socket = 1; |
| 348 |
} else { |
| 349 |
char *dot = strrchr(path, '.'); |
| 350 |
if (dot) { |
| 351 |
*dot = '\0'; |
| 352 |
/* screen = atoi(dot + 1); */ |
| 353 |
if (0 == stat(path, &sbuf)) { |
| 354 |
is_path_to_socket = 1; |
| 355 |
debug("x11_get_proto: $DISPLAY is launchd, removing screennum"); |
| 356 |
setenv("DISPLAY", path, 1); |
| 357 |
} |
| 358 |
} |
| 359 |
} |
| 360 |
} |
| 361 |
#endif /* __APPLE__ */ |
| 331 |
/* |
362 |
/* |
| 332 |
* Handle FamilyLocal case where $DISPLAY does |
363 |
* Handle FamilyLocal case where $DISPLAY does |
| 333 |
* not match an authorization entry. For this we |
364 |
* not match an authorization entry. For this we |
|
Lines 407-412
client_x11_get_proto(const char *display, const char *xauth_path,
Link Here
|
| 407 |
if (!got_data) { |
437 |
if (!got_data) { |
| 408 |
u_int32_t rnd = 0; |
438 |
u_int32_t rnd = 0; |
| 409 |
|
439 |
|
|
|
440 |
#if __APPLE__ |
| 441 |
if (!is_path_to_socket) |
| 442 |
#endif /* __APPLE__ */ |
| 410 |
logit("Warning: No xauth data; " |
443 |
logit("Warning: No xauth data; " |
| 411 |
"using fake authentication data for X11 forwarding."); |
444 |
"using fake authentication data for X11 forwarding."); |
| 412 |
strlcpy(proto, SSH_X11_PROTO, sizeof proto); |
445 |
strlcpy(proto, SSH_X11_PROTO, sizeof proto); |