This document was written in 2008 by tim@seoss.co.uk for Sirius - http://www.siriusit.co.uk/ This document is covered by the same licensing as "Linux-PAM-1.0.1" package - see Linux-PAM-1.0.1/COPYING for details. It is necessary to build the Linux PAM stack "Linux-PAM" to get various useful bits which are missing from the Solaris PAM stack. In particular, I built this because there is no equivalent to pam_listfile.so in Solaris. Status: A few modules won't compile or work under Solaris without additional patches: Solaris 10: pam_limits: There is a warning to the affect that the code is only known to work on Linux, compilation fails, I didn't investage further. Disable as workaround. pam_xauth: Uses the fsuid() call, which is not present on Solaris. Disable as workaround. Solaris 8: Modules which don't work on Solaris 10 also don't work on Solaris 8 - additionally - pam_mail: Doesn't compile, possibly because alphasort is documented as non-thread-safe. May be fixable, didn't investiage further. Disable as workaround. pam_unix: Doesn't compile - seems to be missing some signal number definitions. May be fixable, didn't investiage further. Disable as workaround. Caveats: I built using gcc from the "Blastwave" repository of GNU tools for Solaris. You will need at least gcc and flex (probably others). Install the "gnulinks" package, and put "/opt/csw/gnu" in your shell's binary search PATH. . The only thing I've tested is pam_listfile. Linking against libiberty needs fixing up. Gnulib may be needed by some modules. . Libiberty is needed as Solaris omits some function calls which are supplied by glibc, and used in Linux-PAM, such as asprintf. . Blastwave supplies libiberty as a position-dependant static library - this is not so good for linking into shared modules (which should use position-independant-code), we tell gcc to ignore this by passing -mimpure-text to the linker. I don't know if this makes the whole library unsharable, or just the particular libiberty code pages. If you want to fix this up, you could include the code from libiberty directly when linking the PAM modules, or make a shared libiberty, and link the pam libraries against it. . Blastwave doesn't seem to ship libiberty.h - I used the one that ships with gcc-4.3.1 (in gcc-4.3.1/include/ - you will also need the corresponding ansidecl.h) To Build: 1. untar Linux-PAM-1.0.1 2. Apply the attached Linux-PAM-1.0.1-solaris.diff 3. Configure with: $ GCC_EXEC_PREFIX=/opt/csw/gcc4/ LDFLAGS="-mimpure-text -L/opt/csw/lib -R/opt/csw/lib -liberty -lintl" CPPFLAGS="-I/opt/csw/include -I" ./configure --prefix=/usr/local --with-libintl-prefix=/opt/csw I then carried out the following bodges during build: . Edit modules/pam_lastlog/Makefile: remove "-lutil" . Edit modules/Makefile: remove modules which don't compile on Solaris from build subdir list (see above) $ make # make install TODO: Things which Should Be Done (but I don't currently have time to carry out): Fix modules/pam_lastlog/Makefile.am: '-lutil' should be omitted on Solaris Fix modules/Makefile.am - disable modules which don't work on Solaris Include an option to install under /usr without clashing with Solaris' own libraries, by renaming the modules with a prefix which is supplied at compile-time (e.g. pam_unix.so -> lp_pam_unix.so etc.) Create a Blastwave package for Linux-PAM