Solaris 10 Compilation Issues - patch included
[Date Prev][Date Next] [Thread Prev][Thread Next]Solaris 10 Compilation Issues - patch included
- From: Peter Bray <pdb_ml [at] yahoo.com.au>
- To: nss-pam-ldapd-users [at] lists.arthurdejong.org
- Subject: Solaris 10 Compilation Issues - patch included
- Date: Sat, 12 Mar 2011 16:29:45 +1100
Greetings, 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. 1. On Solaris 10, hstrerror() lives in libresolv. From the manual page: SYNOPSIS BIND 8.2.2 Interfaces cc [ flag ... ] file ... -lresolv -lsocket -lnsl [ library ... ] #include <sys/types.h> #include <netinet/in.h> #include <arpa/nameser.h> #include <resolv.h> #include <netdb.h> const char *hstrerror(int err); Note: The configure.ac modification may need tweaking for other platforms 2. HOST_NAME_MAX is not defined in standard Solaris 10 headers. But alternatives are: (rg is a local alias for recursive grep) % ( cd /usr/include ; rg HOST_NAME_MAX ) ./sys/unistd.h:#define _SC_HOST_NAME_MAX 735 ./limits.h:#define _POSIX_HOST_NAME_MAX 255 Maybe when the definition check fails, fallbacks should be checked for? 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. % rg HOST_NAME_MAX ./nslcd/pam.c:#ifndef HOST_NAME_MAX ./nslcd/pam.c:#define HOST_NAME_MAX 255 ./nslcd/pam.c:#endif /* not HOST_NAME_MAX */ ./nslcd/pam.c: char ruser[256],rhost[HOST_NAME_MAX+1],tty[64]; ./nslcd/pam.c: char hostname[HOST_NAME_MAX+1]; ./nslcd/pam.c: char tty[64],rhost[HOST_NAME_MAX+1],ruser[256]; ./nslcd/pam.c: char tty[64],rhost[HOST_NAME_MAX+1],ruser[256]; ./nslcd/cfg.c:#ifndef HOST_NAME_MAX ./nslcd/cfg.c:#define HOST_NAME_MAX 255 ./nslcd/cfg.c:#endif /* not HOST_NAME_MAX */ ./nslcd/cfg.c: char buf[HOST_NAME_MAX+sizeof("ldap://")]; ./nslcd/common.c:#ifndef HOST_NAME_MAX ./nslcd/common.c:#define HOST_NAME_MAX 255 ./nslcd/common.c:#endif /* not HOST_NAME_MAX */ ./nslcd/common.c: char hostname[HOST_NAME_MAX+1];./ChangeLog-2008: * [r569] nslcd/cfg.c: have a fallback value for HOST_NAME_MAX if it
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? With the patch below the following procedure# Aside: Local Policy is not to pollute the OS directories, when testing
# new tools (and in general), even system ones, hence the paths ;-) ./configure --prefix=${PKGS_RELEASE}/nss-pam-ldapd-0.8.1 \ --datarootdir=${PKGS_RELEASE}/nss-pam-ldapd-0.8.1 \ --with-ldap-conf-file=${PKGS_RELEASE}/nss-pam-ldapd-0.8.1/etc/nslcd.conf \ --with-pam-seclib-dir=${PKGS_RELEASE}/nss-pam-ldapd-0.8.1/lib/security gmake gmake check 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 PASS: test_cfgtest_myldap.sh: LDAP server ldap://127.0.0.1/ not available for dc=test,dc=tld
SKIP: test_myldap.sh test_nsscmds.sh: /etc/nslcd.conf: not found SKIP: test_nsscmds.sh PASS: test_getpeercred PASS: test_common PASS: test_expr =========================================================== 1 of 7 tests failed (2 tests were not run) Please report to nss-pam-ldapd-users@lists.arthurdejong.org =========================================================== Core was generated by `./test_tio'. Program terminated with signal 9, Killed. #0 0x00007fffffee1b1a in __lwp_wait () from /lib/64/libc.so.1 (gdb) bt full #0 0x00007fffffee1b1a in __lwp_wait () from /lib/64/libc.so.1 No symbol table info available. #1 0x00007fffffece1cb in lwp_wait () from /lib/64/libc.so.1 No symbol table info available. #2 0x00007fffffed8c4e in _thrp_join () from /lib/64/libc.so.1 No symbol table info available. #3 0x00007fffffed8e2c in pthread_join () from /lib/64/libc.so.1 No symbol table info available.#4 0x0000000000401852 in test_blocks (wbs=10240, wbl=11, rbs=110, rbl=1024) at test_tio.c:209
sp = {5, 4} wthread = 4 rthread = <value optimized out> wargs = {fd = 5, blocksize = 10240, blocks = 11, timeout = 2} rargs = {fd = 4, blocksize = 110, blocks = 1024, timeout = 2}#5 0x0000000000401c13 in main (argc=<value optimized out>, argv=<value optimized out>) at test_tio.c:299
No locals. (gdb) up (gdb) up (gdb) up (gdb) up#4 0x0000000000401852 in test_blocks (wbs=10240, wbl=11, rbs=110, rbl=1024) at test_tio.c:209
209 assertok(pthread_join(wthread,NULL)==0); (gdb) list 204 rargs.blocksize=rbs; 205 rargs.blocks=rbl; 206 rargs.timeout=2; 207 assertok(pthread_create(&rthread,NULL,help_tioreader,&rargs)==0); 208 /* wait for all threads to die */ 209 assertok(pthread_join(wthread,NULL)==0); 210 assertok(pthread_join(rthread,NULL)==0); 211 /* we're done */ 212 return 0; 213 } No further testing done, it (nss-pam-ldapd) isn't something core to our operations, just an experiment, partly because I'm reading an Autotools book, I thought I'd look at the hstrerror() issue. Hope this report helps, Peter
Attachment:
nss-pam-ldapd-0.8.1-solaris10.patch
Description: Text Data
-- To unsubscribe send an email to nss-pam-ldapd-users-unsubscribe@lists.arthurdejong.org or see http://lists.arthurdejong.org/nss-pam-ldapd-users
- Solaris 10 Compilation Issues - patch included, Peter Bray
- Re: Solaris 10 Compilation Issues - patch included,
Arthur de Jong
- Re: Solaris 10 Compilation Issues - patch included,
Peter Bray
- Re: Solaris 10 Compilation Issues - patch included, Arthur de Jong
- Re: Solaris 10 Compilation Issues - patch included,
Peter Bray
- Prev by Date: Re: uid with ":" (colon) not a valid username ?
- Next by Date: Re: Solaris 10 Compilation Issues - patch included
- Previous by thread: Re: uid with ":" (colon) not a valid username ?
- Next by thread: Re: Solaris 10 Compilation Issues - patch included