From a63701848fe5462c4e8bbff0131bb42979e603ec Mon Sep 17 00:00:00 2001 From: Ed Maste Date: Sun, 9 Feb 2025 15:37:24 -0500 Subject: [PATCH] ssh: Move XAUTH_PATH setting to ssh.mk XAUTH_PATH is normally set (in the upstream build infrastructure) in config.h. We previously set it in ssh and sshd's Makefiles if LOCALBASE is set, and over time have sometimes also defined it in config.h. Leave it unset in config.h and move the CFLAGS logic to to ssh.mk so that it will be set when building all ssh libraries and programs but still be set by LOCALBASE. Reviewed by: jlduran Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D48907 --- crypto/openssh/config.h | 2 +- secure/ssh.mk | 2 ++ secure/usr.bin/ssh/Makefile | 4 ---- secure/usr.sbin/sshd/Makefile | 3 --- 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/crypto/openssh/config.h b/crypto/openssh/config.h index 6462ff16d8d..aedacd88df1 100644 --- a/crypto/openssh/config.h +++ b/crypto/openssh/config.h @@ -2015,7 +2015,7 @@ #endif /* Define if xauth is found in your path */ -#define XAUTH_PATH "/usr/local/bin/xauth" +/* #undef XAUTH_PATH */ /* Number of bits in a file offset, on hosts where this is settable. */ /* #undef _FILE_OFFSET_BITS */ diff --git a/secure/ssh.mk b/secure/ssh.mk index 9ee533c10ec..c331e40c16f 100644 --- a/secure/ssh.mk +++ b/secure/ssh.mk @@ -7,6 +7,8 @@ SSHDIR= ${SRCTOP}/crypto/openssh CFLAGS+= -I${SSHDIR} -include ssh_namespace.h SRCS+= ssh_namespace.h +CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE:U/usr/local}/bin/xauth\" + .if ${MK_USB} != "no" # Built-in security key support CFLAGS+= -include sk_config.h diff --git a/secure/usr.bin/ssh/Makefile b/secure/usr.bin/ssh/Makefile index 7c3eb68ea08..9bff63f2939 100644 --- a/secure/usr.bin/ssh/Makefile +++ b/secure/usr.bin/ssh/Makefile @@ -29,10 +29,6 @@ LIBADD+= gssapi LIBADD+= crypto -.if defined(LOCALBASE) -CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" -.endif - .include .PATH: ${SSHDIR} diff --git a/secure/usr.sbin/sshd/Makefile b/secure/usr.sbin/sshd/Makefile index 323fe4b8c99..2762d415100 100644 --- a/secure/usr.sbin/sshd/Makefile +++ b/secure/usr.sbin/sshd/Makefile @@ -62,9 +62,6 @@ LIBADD+= wrap LIBADD+= crypto -.if defined(LOCALBASE) -CFLAGS+= -DXAUTH_PATH=\"${LOCALBASE}/bin/xauth\" -.endif .include