pam_ssh_agent_auth icon indicating copy to clipboard operation
pam_ssh_agent_auth copied to clipboard

Build blows up because userauth_pubkey_from_pam.c forgot an include

Open Artoria2e5 opened this issue 2 years ago • 0 comments

On Darwin 22.6.0 (macOS 13.6.1), Apple clang 15.0.0, running configure -C --without-openssl-header-check; make` (and with appropriate CFLAG workaround for issue 45) on git HEAD gets:

gcc -g -O2 -fPIC -Wall -Wpointer-arith -Wuninitialized -Wno-error=all -fstack-protector-all -fno-common  -I. -I.  -I/usr/local/opt/icu4c/include -I/usr/local/opt/ruby/include -I/usr/local/opt/sqlite/include -I/usr/local/opt/gettext/include -I/usr/local/opt/qt/include  -DHAVE_CONFIG_H -c userauth_pubkey_from_pam.c -o userauth_pubkey_from_pam.o
In file included from userauth_pubkey_from_pam.c:36:
./key.h:80:1: error: unknown type name 'u_char'; did you mean 'char'?
u_char          *pamsshagentauth_key_fingerprint_raw(const Key *, enum fp_type, u_int *);
^~~~~~
char

The other files that include key.h, like ssh-dss.c compile alright.

  • Manually toggling HAVE_U_INT and HAVE_U_CHAR fixes it.
  • Manually adding a #include <sys/types.h> before #include <strings.h> in userauth_pubkey_from_pam.c fixes it.

Guesses on why

configure attempts to set HAVE_U_INT by

AC_CACHE_CHECK([for u_int type], ac_cv_have_u_int, [
	AC_TRY_COMPILE(
		[ #include <sys/types.h> ],
		[ u_int a; a = 1;],
		[ ac_cv_have_u_int="yes" ],
		[ ac_cv_have_u_int="no" ]
	)
])

However... oh, there's just no reference to #include <sys/types.h> anywhere in the include chain for that file.

Artoria2e5 avatar Dec 04 '23 09:12 Artoria2e5