diff -urN ./Makefile /tmp/Linux-PAM-0.72/Makefile --- ./Makefile Sun May 12 18:00:26 2002 +++ /tmp/Linux-PAM-0.72/Makefile Sat May 11 20:15:00 2002 @@ -22,7 +22,7 @@ FULL_LINUX_PAM_SOURCE_TREE=yes export FULL_LINUX_PAM_SOURCE_TREE -DYNLOAD="dl" +DYNLOAD= DYNTYPE="so" # Comment out either line to disable that type of linking for *modules only* @@ -66,7 +66,7 @@ ifdef DYNAMIC # need the dynamic library functions -LIBDL=-l$(DYNLOAD) +LIBDL= ifdef STATIC_LIBPAM # needed because pam_xxx() fn's are now in statically linked library RDYNAMIC = -rdynamic diff -urN ./default.defs /tmp/Linux-PAM-0.72/default.defs --- ./default.defs Sun May 12 18:00:41 2002 +++ /tmp/Linux-PAM-0.72/default.defs Sat May 11 19:23:39 2002 @@ -36,5 +36,5 @@ INCLUDED := /usr/include/security CONFIGED := /etc SCONFIGED := /etc/security -EXTRALS := -lnsl -lcrypt +EXTRALS := -lcrypt WARNINGS := -Wall diff -urN ./defs/debian.defs /tmp/Linux-PAM-0.72/defs/debian.defs --- ./defs/debian.defs Sun May 12 18:00:41 2002 +++ /tmp/Linux-PAM-0.72/defs/debian.defs Sat May 11 19:23:39 2002 @@ -36,5 +36,5 @@ INCLUDED := /usr/include/security CONFIGED := /etc SCONFIGED := /etc/security -EXTRALS := -lnsl -lcrypt +EXTRALS := -lcrypt WARNINGS := -Wall diff -urN ./libpam/Makefile /tmp/Linux-PAM-0.72/libpam/Makefile --- ./libpam/Makefile Sun May 12 18:00:35 2002 +++ /tmp/Linux-PAM-0.72/libpam/Makefile Sat May 11 19:19:53 2002 @@ -21,9 +21,6 @@ # calling convention #MOREFLAGS += -D"UGLY_HACK_FOR_PRIOR_BEHAVIOR_SUPPORT" -# libpam.so needs -ldl, too. -LINKLIBS += $(LIBDL) - ifeq ($(DEBUG_REL),yes) LIBNAME=libpamd CFLAGS += -D"DEBUG" @@ -103,7 +100,7 @@ $(LIBPAM): $(DLIBOBJECTS) ifdef DYNAMIC_LIBPAM ifeq ($(USESONAME),yes) - $(LD_L) $(SOSWITCH)$(LIBPAMNAME) -o $@ $(DLIBOBJECTS) $(LINKLIBS) -ldl -lcrypt + $(LD_L) $(SOSWITCH)$(LIBPAMNAME) -o $@ $(DLIBOBJECTS) $(LINKLIBS) -lcrypt else $(LD_L) -o $@ $(DLIBOBJECTS) $(MODULES) endif diff -urN ./libpamc/Makefile /tmp/Linux-PAM-0.72/libpamc/Makefile --- ./libpamc/Makefile Sun May 12 18:00:34 2002 +++ /tmp/Linux-PAM-0.72/libpamc/Makefile Sat May 11 21:02:36 2002 @@ -64,7 +64,7 @@ $(LIBPAMC): $(DLIBOBJECTS) ifdef DYNAMIC_LIBPAM ifeq ($(USESONAME),yes) - $(LD_L) $(SOSWITCH)$(LIBPAMCNAME) -o $@ $(DLIBOBJECTS) $(LINKLIBS) -ldl -lcrypt + $(LD_L) $(SOSWITCH)$(LIBPAMCNAME) -o $@ $(DLIBOBJECTS) $(LINKLIBS) -lcrypt else $(LD_L) -o $@ $(DLIBOBJECTS) endif diff -urN ./modules/pam_access/Makefile /tmp/Linux-PAM-0.72/modules/pam_access/Makefile --- ./modules/pam_access/Makefile Sun May 12 18:00:34 2002 +++ /tmp/Linux-PAM-0.72/modules/pam_access/Makefile Sat May 11 19:26:54 2002 @@ -73,7 +73,7 @@ $(LIBOBJD): $(LIBSRC) $(LIBSHARED): $(LIBOBJD) - $(LD_D) -o $@ $(LIBOBJD) $(LINKLIBS) -lpam -lnsl + $(LD_D) -o $@ $(LIBOBJD) $(LINKLIBS) -lpam endif ifdef STATIC diff -urN ./modules/pam_issue/pam_issue.c /tmp/Linux-PAM-0.72/modules/pam_issue/pam_issue.c --- ./modules/pam_issue/pam_issue.c Sun May 12 18:00:36 2002 +++ /tmp/Linux-PAM-0.72/modules/pam_issue/pam_issue.c Sat May 11 21:06:28 2002 @@ -26,6 +26,9 @@ #include #include #include +#ifdef __NetBSD__ +#include +#endif #include @@ -215,7 +218,9 @@ struct utmp *ut; setutent(); while ((ut = getutent())) +#ifndef __NetBSD__ if (ut->ut_type == USER_PROCESS) +#endif users++; endutent(); printf ("%d ", users); diff -urN ./modules/pam_unix/Makefile /tmp/Linux-PAM-0.72/modules/pam_unix/Makefile --- ./modules/pam_unix/Makefile Sun May 12 18:00:41 2002 +++ /tmp/Linux-PAM-0.72/modules/pam_unix/Makefile Sat May 11 21:15:07 2002 @@ -18,6 +18,8 @@ LIBNSL = -lnsl endif +LINKLIBS+=-lutmp + CHKPWD=unix_chkpwd EXTRAS += -DCHKPWD_HELPER=\"$(SUPLEMENTED)/$(CHKPWD)\" diff -urN ./modules/pam_unix/pam_unix_passwd.c /tmp/Linux-PAM-0.72/modules/pam_unix/pam_unix_passwd.c --- ./modules/pam_unix/pam_unix_passwd.c Sun May 12 18:00:41 2002 +++ /tmp/Linux-PAM-0.72/modules/pam_unix/pam_unix_passwd.c Sat May 11 22:00:11 2002 @@ -45,7 +45,7 @@ #include #include #include -#ifdef __FreeBSD__ +#if defined (__FreeBSD__) || defined (__NetBSD__) #include #endif #include /* for time() */ @@ -78,7 +78,7 @@ #include "md5.h" #include "support.h" -#ifndef __FreeBSD__ +#if (!defined __FreeBSD__ && !defined __NetBSD__) #if !((__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 1)) extern int getrpcport(const char *host, unsigned long prognum, unsigned long versnum, unsigned int proto); @@ -375,6 +375,7 @@ else unlink(PW_TMPFILE); + spsync(); return retval; } @@ -429,6 +430,7 @@ else unlink(SH_TMPFILE); + spsync(); return retval; } diff -urN ./modules/pam_unix/support.c /tmp/Linux-PAM-0.72/modules/pam_unix/support.c --- ./modules/pam_unix/support.c Sun May 12 18:00:41 2002 +++ /tmp/Linux-PAM-0.72/modules/pam_unix/support.c Sat May 11 20:56:47 2002 @@ -14,6 +14,9 @@ #include #include #include +#ifdef __NetBSD__ +#include +#endif #include #include @@ -114,7 +117,11 @@ setutent(); strncpy(line.ut_line, curr_tty, sizeof line.ut_line); if ((ut = getutline(&line)) != NULL) { +#ifdef __NetBSD__ + strncpy(curr_user, ut->ut_name, UT_NAMESIZE); +#else strncpy(curr_user, ut->ut_user, UT_NAMESIZE); +#endif retval = curr_user; } endutent(); diff -urN ./modules/pam_userdb/Makefile /tmp/Linux-PAM-0.72/modules/pam_userdb/Makefile --- ./modules/pam_userdb/Makefile Sun May 12 18:00:38 2002 +++ /tmp/Linux-PAM-0.72/modules/pam_userdb/Makefile Sat May 11 21:01:02 2002 @@ -13,7 +13,7 @@ LIBOBJD = $(addprefix dynamic/,$(LIBOBJ)) #LIBOBJS = $(addprefix static/,$(LIBOBJ)) -EXTRALS += -ldb3 +EXTRALS += dynamic/%.o : %.c $(CC) $(CFLAGS) $(DYNAMIC) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@