Date: Wed, 27 Feb 2013 00:39:50 +0100 From: Stefan Bethke <stb@lassitu.de> To: Kimmo Paasiala <kpaasial@gmail.com>, Constantin Stefanov <cstef@parallel.ru>, Muhammad Moinur Rahman <5u623l20@gmail.com> Cc: freebsd-ports@freebsd.org, miwi@freebsd.org Subject: Re: pam_ssh_agent_auth: ENOENT Message-ID: <719342CC-0D44-405C-A51B-532D8AB04774@lassitu.de> In-Reply-To: <CA%2B7WWSeFjDU=XFan8mocpRy0V3DYxOyz1Zznju0PEdGjNR0OHw@mail.gmail.com> References: <CA%2B7WWSfx0viznxyjueEjVjgWzXLy6wqsv%2BkjMaW2Cp98y3yV4g@mail.gmail.com> <CA%2B7WWSdS-QMgLz4cyPJbjC_yAn4CWvpKwCbKcpR4HxrznGos=w@mail.gmail.com> <7A12B6B7-BE3F-4E0A-99C5-61348CA7E028@lassitu.de> <B9524981-A0C5-417C-BD53-CD658BE59E09@lassitu.de> <CA%2B7WWSdy_KxXRX2zVyPU6-F5uwpNTwEYsNnVvpEOYw%2BrXzvpLw@mail.gmail.com> <6C2D19D2-A599-4B6A-89CC-D32DF685926F@lassitu.de> <CA%2B7WWSeFjDU=XFan8mocpRy0V3DYxOyz1Zznju0PEdGjNR0OHw@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <dlfcn.h> #include <err.h> #include <stdio.h> #include <sysexits.h> 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 <stb@lassitu.de> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?719342CC-0D44-405C-A51B-532D8AB04774>