--- src/Makefile +++ src/Makefile 2010-04-13 00:00:00.000000000 +0000 @@ -8,7 +8,7 @@ # Version: @(#)Makefile 2.85-13 23-Mar-2004 miquels@cistron.nl # -CPPFLAGS = +CPPFLAGS = -DUSE_PAM CFLAGS ?= -ansi -O2 -fomit-frame-pointer override CFLAGS += -W -Wall -D_GNU_SOURCE STATIC = @@ -78,6 +78,13 @@ else endif # Additional libs for GNU libc. +ifneq ($(findstring -DUSE_PAM,$(CPPFLAGS)),) + INITLIBS += -lpam + PAMDOTD = /etc/pam.d + PAMINIT = $(PAMDOTD)/init +endif + +# Additional libs for GNU libc. ifneq ($(wildcard /usr/lib*/libcrypt.a),) SULOGINLIBS += -lcrypt endif @@ -149,6 +156,11 @@ install: for i in $(USRBIN); do \ $(INSTALL_EXEC) $$i $(ROOT)/usr/bin/ ; \ done +ifneq ($(findstring -DUSE_PAM,$(CPPFLAGS)),) + $(INSTALL_DIR) $(ROOT)$(PAMDOTD) + test -s $(ROOT)$(PAMINIT) || \ + $(INSTALL_DATA) init.sample $(ROOT)$(PAMINIT) +endif # $(INSTALL_DIR) $(ROOT)/etc/ # $(INSTALL_EXEC) initscript.sample $(ROOT)/etc/ ln -sf halt $(ROOT)/sbin/reboot --- src/init.sample +++ src/init.sample 2010-04-13 00:00:00.000000000 +0000 @@ -0,0 +1,8 @@ +#%PAM-1.0 +# +# The PAM configuration file for /sbin/init +# Used for updating the lastlog logging file +# +auth sufficient pam_rootok.so +account include common-account +session requisite pam_lastlog.so silent +