From owner-freebsd-ports@FreeBSD.ORG Tue Feb 26 23:39:52 2013 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 93F1ABF5; Tue, 26 Feb 2013 23:39:52 +0000 (UTC) (envelope-from stb@lassitu.de) Received: from gilb.zs64.net (gilb.zs64.net [IPv6:2a00:14b0:4200:32e0::1ea]) by mx1.freebsd.org (Postfix) with ESMTP id 1FA54970; Tue, 26 Feb 2013 23:39:52 +0000 (UTC) Received: by gilb.zs64.net (Postfix, from stb@lassitu.de) id A57117229A; Tue, 26 Feb 2013 23:39:50 +0000 (UTC) Content-Type: multipart/mixed; boundary="Apple-Mail=_61CA6E53-1A99-48FB-9554-773064818BB3" Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\)) Subject: Re: pam_ssh_agent_auth: ENOENT From: Stefan Bethke In-Reply-To: Date: Wed, 27 Feb 2013 00:39:50 +0100 Message-Id: <719342CC-0D44-405C-A51B-532D8AB04774@lassitu.de> References: <7A12B6B7-BE3F-4E0A-99C5-61348CA7E028@lassitu.de> <6C2D19D2-A599-4B6A-89CC-D32DF685926F@lassitu.de> To: Kimmo Paasiala , Constantin Stefanov , Muhammad Moinur Rahman <5u623l20@gmail.com> X-Mailer: Apple Mail (2.1499) Cc: freebsd-ports@freebsd.org, miwi@freebsd.org X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Feb 2013 23:39:52 -0000 --Apple-Mail=_61CA6E53-1A99-48FB-9554-773064818BB3 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii > Looks like the port is still broken if compiled on a 9-STABLE system > with new vis(3) functions included. Compiling it on a 9.1-RELEASE > system produces a working package. I use devel/poudriere-devel for > compiling packages and I didn't test the port by compiling it > manually. I did some prodding, and it would appear the .so can't be loaded because = of a missing symbol: #include #include #include #include int main(void) { void *dlh; dlh =3D dlopen("/usr/local/lib/pam_ssh_agent_auth.so", = RTLD_NOW); if (dlh =3D=3D NULL) errx(EX_OSERR, "dlopen(): %s", dlerror()); return 0; } $ ./dltest=20 dltest: dlopen(): /usr/local/lib/pam_ssh_agent_auth.so: Undefined symbol = "pamsshagentauth_strnvis" The code in the test program is similar to the code in = src/contrib/openpam/lib/openpam_dynamic.c::openpam_dynamic(). Looking at the Makefiles, it seems that openbin-compat/vis.c should end = up in libopenbsd-compat.a, and that in turn should get linked into the = module, but: # nm --defined-only openbsd-compat/libopenbsd-compat.a ... strtonum.o: 0000000000000000 T pamsshagentauth_strtonum strtoul.o: vis.o: port-aix.o: ... openbsd-compat/vis.h is #ifdef'd HAVE_STRNVIS, so we check configure. = configure.log thinks we have a suitable strnvis: configure:16566: checking for strnvis configure:16622: cc -o conftest -O2 -pipe -fno-strict-aliasing -fPIC = -Wall -Wpointer-arith -Wuninitialized -Wsign-compare -Wno-pointer-sign = -fstack-protector-all -fstack-protector-all conftest.c -lutil -lpam = >&5 configure:16629: $? =3D 0 configure:16651: result: yes Do we? Then the hard-coded use in log.c needs to be changed. If = FreeBSD's strnvis is not compatible, then the configure test needs to be = fixed. Attached is a (dirty) patch to make that change to log.c; not = sure if this is the correct way. Maybe use __FreeBSD_version instead. Stefan --=20 Stefan Bethke Fon +49 151 14070811 --Apple-Mail=_61CA6E53-1A99-48FB-9554-773064818BB3 Content-Disposition: attachment; filename=patch-log.c.txt Content-Type: text/plain; name="patch-log.c.txt" Content-Transfer-Encoding: quoted-printable --- log.c.orig 2012-06-28 03:47:49.000000000 +0200 +++ log.c 2013-02-27 00:32:38.063952580 +0100 @@ -361,8 +361,13 @@ vsnprintf(msgbuf, sizeof(msgbuf), fmtbuf, args); } =20 +#if defined(__FreeBSD__) + strnvis(fmtbuf, sizeof(fmtbuf), msgbuf, + log_on_stderr ? LOG_STDERR_VIS : LOG_SYSLOG_VIS); +#else pamsshagentauth_strnvis(fmtbuf, msgbuf, sizeof(fmtbuf), log_on_stderr ? LOG_STDERR_VIS : LOG_SYSLOG_VIS); +#endif =20 if(level =3D=3D SYSLOG_LEVEL_FATAL) { snprintf(msgbuf, sizeof msgbuf, "%s\r\nThis incident has = been reported to the authorities\r\n", fmtbuf); --Apple-Mail=_61CA6E53-1A99-48FB-9554-773064818BB3--