Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
215af43cb2 | ||
|
|
6f14de011f | ||
|
|
fc1fca1854 |
@@ -830,6 +830,8 @@ fake_password(const char *wire_password)
|
||||
fatal("%s: password length too long: %zu", __func__, l);
|
||||
|
||||
ret = malloc(l + 1);
|
||||
if (ret == NULL)
|
||||
return NULL;
|
||||
for (i = 0; i < l; i++)
|
||||
ret[i] = junk[i % (sizeof(junk) - 1)];
|
||||
ret[i] = '\0';
|
||||
|
||||
+41
-7
@@ -4354,6 +4354,33 @@ connect_local_xsocket(u_int dnr)
|
||||
return connect_local_xsocket_path(buf);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
static int
|
||||
is_path_to_xsocket(const char *display, char *path, size_t pathlen)
|
||||
{
|
||||
struct stat sbuf;
|
||||
|
||||
if (strlcpy(path, display, pathlen) >= pathlen) {
|
||||
error("%s: display path too long", __func__);
|
||||
return 0;
|
||||
}
|
||||
if (display[0] != '/')
|
||||
return 0;
|
||||
if (stat(path, &sbuf) == 0) {
|
||||
return 1;
|
||||
} else {
|
||||
char *dot = strrchr(path, '.');
|
||||
if (dot != NULL) {
|
||||
*dot = '\0';
|
||||
if (stat(path, &sbuf) == 0) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
x11_connect_display(void)
|
||||
{
|
||||
@@ -4375,15 +4402,22 @@ x11_connect_display(void)
|
||||
* connection to the real X server.
|
||||
*/
|
||||
|
||||
/* Check if the display is from launchd. */
|
||||
#ifdef __APPLE__
|
||||
if (strncmp(display, "/tmp/launch", 11) == 0) {
|
||||
sock = connect_local_xsocket_path(display);
|
||||
if (sock < 0)
|
||||
return -1;
|
||||
/* Check if display is a path to a socket (as set by launchd). */
|
||||
{
|
||||
char path[PATH_MAX];
|
||||
|
||||
/* OK, we now have a connection to the display. */
|
||||
return sock;
|
||||
if (is_path_to_xsocket(display, path, sizeof(path))) {
|
||||
debug("x11_connect_display: $DISPLAY is launchd");
|
||||
|
||||
/* Create a socket. */
|
||||
sock = connect_local_xsocket_path(path);
|
||||
if (sock < 0)
|
||||
return -1;
|
||||
|
||||
/* OK, we now have a connection to the display. */
|
||||
return sock;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
/*
|
||||
|
||||
+4
-4
@@ -740,6 +740,9 @@ main() { if (NSVersionOfRunTimeLibrary("System") >= (60 << 16))
|
||||
use_pie=auto
|
||||
check_for_libcrypt_later=1
|
||||
check_for_openpty_ctty_bug=1
|
||||
dnl Target SUSv3/POSIX.1-2001 plus BSD specifics.
|
||||
dnl _DEFAULT_SOURCE is the new name for _BSD_SOURCE
|
||||
CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=600 -D_BSD_SOURCE -D_DEFAULT_SOURCE"
|
||||
AC_DEFINE([PAM_TTY_KLUDGE], [1],
|
||||
[Work around problematic Linux PAM modules handling of PAM_TTY])
|
||||
AC_DEFINE([LOCKED_PASSWD_PREFIX], ["!"],
|
||||
@@ -1771,11 +1774,8 @@ AC_CHECK_FUNCS([ \
|
||||
warn \
|
||||
])
|
||||
|
||||
dnl Wide character support. Linux man page says it needs _XOPEN_SOURCE.
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
CFLAGS="$CFLAGS -D_XOPEN_SOURCE"
|
||||
dnl Wide character support.
|
||||
AC_CHECK_FUNCS([mblen mbtowc nl_langinfo wcwidth])
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
|
||||
TEST_SSH_UTF8=${TEST_SSH_UTF8:=yes}
|
||||
AC_MSG_CHECKING([for utf8 locale support])
|
||||
|
||||
Reference in New Issue
Block a user