lists.arthurdejong.org
RSS feed

Re: Solaris 10 Compilation Issues - patch included

[Date Prev][Date Next] [Thread Prev][Thread Next]

Re: Solaris 10 Compilation Issues - patch included



On Sat, 2011-03-12 at 16:29 +1100, Peter Bray wrote:
> I just downloaded nss-pam-ldapd-0.8.1, and tried to compile it on Oracle
> Solaris 10 Update 9 (X86/64-bit), discovered a few issues.

Thanks for your feedback. I don't have a Solaris 10 box to test it on
(and all my attempts to install OpenSolaris mostly failed so far).

> 1. On Solaris 10, hstrerror() lives in libresolv.
[...]
>     Note: The configure.ac modification may need tweaking for other
>     platforms

Thanks. Fixed in development. I think AC_SEARCH_LIBS is smart enough to
also work in other cases. I moved it below the gethostbyname check so
-lsocket and -lnsl should also be linked.

> 2. HOST_NAME_MAX is not defined in standard Solaris 10 headers. But
>     alternatives are: (rg is a local alias for recursive grep)
[...]
>     While the patch does not make this change, its probably reasonable
>     to move the definition check to say common.h as it now appears
>     three times in the codebase.

Thanks. I also ran into that issue on another platform. It is now in
common.h with a fallback to _POSIX_HOST_NAME_MAX.

> 3. __assert_fail() is not defined on Solaris 10.
> 
>     Comments:
>        a.  #define __assert_fail() ... now appears multiple times in the
>            code base. I suggest its time to factor it into a header file.
> 
>        b.  The comment above it says "for Solaris" which is OK, but it
>            not wrapped in a conditional, so everyone is getting it,
>            aren't they?
> 
>            What happens to platforms that have a functional
>            __assert_fail(), are they get redefinition warnings
>            (if its a macro) or is everybody now using __assert()?
>            And thus losing the 'function' argument?

The assert hacks were just a quick way of getting everything working. I
would prefer to switch to some test framework (I've had a look at check
in the past) but that either brings extra dependencies (which makes even
less people use the tests on their platform) or makes the distribution
much bigger.

The tests in general could use some more love and the recent security
but pushed me again to have tests for the PAM code (working on that).
The problem is that for nss-pam-ldapd it is much more interesting to do
integration tests than unit tests. You need a working LDAP server to
reach any of the interesting bits of code and it is much more about the
interaction between libc, the PAM stack, the modules, nslcd and the LDAP
server than about any single component.

> With the patch below the following procedure
[...]
> in results in the following test ouput:
> 
> gmake[2]: Entering directory `/tmp/64-bit/nss-pam-ldapd-0.8.1/tests'
> PASS: test_dict
> PASS: test_set
> test_tio: writing 11 blocks of 400 bytes (4400 total)
> test_tio: reading 400 blocks of 11 bytes (4400 total)
> test_tio: writing 11 blocks of 10240 bytes (112640 total)
> test_tio: reading 1024 blocks of 110 bytes (112640 total)
> Assertion failed: tio_read(fp,buf,hargs->blocksize)==0 (errno="Invalid 
> argument"), file test_tio.c, line 119
> /bin/bash: line 5:  9742 Abort                   (core dumped) ${dir}$tst
> FAIL: test_tio

(the backtrace was from the main thread and the issue was in the reader
thread)

There seems to be some issue with the I/O functions used specifically on
Solaris 10. I've seen similar reports before  with communication
problems in the communication between nslcd and the NSS module but
haven't been able to pin-point it.

Can you check which function exactly causes the "Invalid argument"
problem, perhaps with truss?

Thanks again for your feedback.

-- 
-- arthur - arthur@arthurdejong.org - http://arthurdejong.org --
-- 
To unsubscribe send an email to
nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see
http://lists.arthurdejong.org/nss-pam-ldapd-users