aad-for-linux / pam_aad

Azure Active Directory PAM Module
GNU General Public License v3.0
22 stars 9 forks source link

OpenPAM Compatibility #18

Open oxr463 opened 2 years ago

oxr463 commented 2 years ago

So far, this module has been compiled and tested against linux-pam. Efforts should be made to support OpenPAM if possible.

https://www.openpam.org

# CC=cc make -e
cc -O2 -pipe  -fPIC -fno-stack-protector -Wall -shared -Wl,--export-dynamic  -o libnss_aad.so.2 -Wl,-soname,libnss_aad.so.2 cJSON.c libnss_aad.c sds.c -lcurl -lm
libnss_aad.c:3:10: fatal error: 'shadow.h' file not found
#include <shadow.h>
         ^~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make: stopped in /usr/src/libnss_aad

See also: GNU Gnulib: shadow.h

Xorg on FreeBSD includes a copy of shadow.h (See: https://forums.freebsd.org/threads/trying-to-port-lxdm.47774/), installed via pkg install xorg-libraries

# CC=cc LDFLAGS="${LDFLAGS} -I/usr/src/glibc-glibc-2.29/include" make -e
cc -O2 -pipe  -I/usr/src/glibc-glibc-2.29/include -fPIC -fno-stack-protector -Wall -shared -Wl,--export-dynamic  -o libnss_aad.so.2 -Wl,-soname,libnss_aad.so.2 cJSON.c libnss_aad.c sds.c -lcurl -lm
In file included from cJSON.c:26:
In file included from /usr/src/glibc-glibc-2.29/include/string.h:6:
/usr/src/glibc-glibc-2.29/include/sys/types.h:1:10: fatal error: 'posix/sys/types.h' file not found
#include <posix/sys/types.h>
         ^~~~~~~~~~~~~~~~~~~
1 error generated.
In file included from libnss_aad.c:1:
/usr/src/glibc-glibc-2.29/include/nss.h:2:10: fatal error: 'nss/nss.h' file not found
#include <nss/nss.h>
         ^~~~~~~~~~~
1 error generated.
In file included from sds.c:32:
/usr/src/glibc-glibc-2.29/include/stdio.h:5:11: fatal error: 'libio/stdio.h' file not found
# include <libio/stdio.h>
          ^~~~~~~~~~~~~~~
1 error generated.
*** Error code 1

Stop.
make: stopped in /usr/src/libnss_aad

Both libnss-mysql, and nss-pam-ldap support both Linux and FreeBSD, however, they do not include shadow.h, but instead implement their own (See: nss_mysql.h, passwd.c).

Resources:

* [osx, openpam and location of .so modules?](https://stackoverflow.com/q/17496357)

Source: https://github.com/CyberNinjas/pam_aad/issues/23