> 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 = dlopen("/usr/local/lib/pam_ssh_agent_auth.so", RTLD_NOW);
        if (dlh == NULL)
                errx(EX_OSERR, "dlopen(): %s", dlerror());
        return 0;
}

$ ./dltest 
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: $? = 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

-- 
Stefan Bethke <s...@lassitu.de>   Fon +49 151 14070811


--- 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);
        }
 
+#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
 
     if(level == SYSLOG_LEVEL_FATAL) {
                snprintf(msgbuf, sizeof msgbuf, "%s\r\nThis incident has been 
reported to the authorities\r\n", fmtbuf);
_______________________________________________
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"

Reply via email to