From 73c82e3f2fafa65d65c39893c0361de87da910e9 Mon Sep 17 00:00:00 2001 From: Seraphim Mellos Date: Sun, 15 Jun 2008 12:23:55 +0300 Subject: Completed Makefile for pam_unix --- modules/pam_unix/Makefile | 9 ++++----- modules/pam_unix/Makefile~ | 10 +++++----- modules/pam_unix/pam_unix.c | 8 ++++++-- modules/pam_unix/pam_unix.c~ | 13 ++++++++----- 4 files changed, 23 insertions(+), 17 deletions(-) (limited to 'modules') diff --git a/modules/pam_unix/Makefile b/modules/pam_unix/Makefile index 314c0e0..ae80af4 100644 --- a/modules/pam_unix/Makefile +++ b/modules/pam_unix/Makefile @@ -17,18 +17,17 @@ MANMODE = 644 PROJ = $(LIBSHARED) -OBJS = pam_unix.c +OBJS = pam_unix.o all: case "`uname -s`" in \ - Linux) $(MAKE) -I$(INCDIR) CFLAGS="$(CFLAGS) -DHAVE_SHADOW" \ - -L$(LDDIR) LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" \ - $(PROJ);;\ + Linux) $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + LDLIBS="$(LDLIBS)" $(PROJ);;\ FreeBSD) echo "Not yet supported.";;\ *) echo "OS not supported.";;\ esac -$(LIBSHARED): $(OBJS) $(MAP) +$(LIBSHARED): $(OBJS) $(LD) $(LDFLAGS) $(OBJS) $(LDLIBS) -o $(LIBSHARED) .c.o: diff --git a/modules/pam_unix/Makefile~ b/modules/pam_unix/Makefile~ index 1d449ed..eb399cc 100644 --- a/modules/pam_unix/Makefile~ +++ b/modules/pam_unix/Makefile~ @@ -2,7 +2,8 @@ ## Copyright (c) 2008 by Seraphim Mellos. See LICENSE. # -include ../../Makefile +include ../../Make.defs + TITLE = pam_unix PAM_SO_SUFFIX = LIBSHARED = $(TITLE).so$(PAM_SO_SUFFIX) @@ -16,13 +17,12 @@ MANMODE = 644 PROJ = $(LIBSHARED) -OBJS = pam_unix.c +OBJS = pam_unix.o all: case "`uname -s`" in \ - Linux) $(MAKE) -I$(INCDIR) CFLAGS="$(CFLAGS) -DHAVE_SHADOW" \ - -L$(LDDIR) LDFLAGS="$(LDFLAGS)" LDLIBS="$(LDLIBS)" \ - $(PROJ);;\ + Linux) $(MAKE) CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" \ + LDLIBS="$(LDLIBS)" $(PROJ);;\ FreeBSD) echo "Not yet supported.";;\ *) echo "OS not supported.";;\ esac diff --git a/modules/pam_unix/pam_unix.c b/modules/pam_unix/pam_unix.c index 7a8aca3..31e98dd 100644 --- a/modules/pam_unix/pam_unix.c +++ b/modules/pam_unix/pam_unix.c @@ -1,8 +1,12 @@ +#define _XOPEN_SOURCE + /* #include */ #include #include #include #include +#include +#include #ifndef MAXHOSTNAMELEN @@ -20,7 +24,7 @@ #include #include -#include +#include /* * User authentication @@ -249,7 +253,7 @@ pam_sm_chautok(pam_handle_t *pamh, int flags, int argc, const char *argv[]) { - + return (PAM_SUCCESS); } diff --git a/modules/pam_unix/pam_unix.c~ b/modules/pam_unix/pam_unix.c~ index c65ec10..20088ec 100644 --- a/modules/pam_unix/pam_unix.c~ +++ b/modules/pam_unix/pam_unix.c~ @@ -1,8 +1,11 @@ +#define _XOPEN_SOURCE + /* #include */ #include #include #include #include +#include #ifndef MAXHOSTNAMELEN @@ -20,7 +23,7 @@ #include #include -#include +#include /* * User authentication @@ -61,7 +64,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, if (pass[0] == '\0') { if (!(flags & PAM_DISALLOW_NULL_AUTHTOK) && openpam_get_option(pamh, PAM_OPT_NULLOK)){ - PAM_ERROR("Authentication failed. Empty passwd not allowed"); + PAM_ERROR("Authentication failed. Empty passwd not allowed."); return (PAM_SUCCESS); } @@ -71,7 +74,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, lc = login_getpwclass(pwd); #endif } else { - PAM_LOG("Doing dummy authentication"); + PAM_LOG("Doing dummy authentication."); pass = "*"; #ifndef __linux__ lc = login_getpwclass(NULL); @@ -99,7 +102,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags, PAM_ERROR("Wrong password. Authentication failed."); pam_err = PAM_AUTH_ERR; } else { - PAM_LOG("Authentication completed succesfully"); + PAM_LOG("Authentication completed succesfully."); pam_err = PAM_SUCCESS; } @@ -249,7 +252,7 @@ pam_sm_chautok(pam_handle_t *pamh, int flags, int argc, const char *argv[]) { - + return (PAM_SUCCESS); } -- cgit v1.2.3-65-gdbad