diff options
author | Seraphim Mellos <mellos@ceid.upatras.gr> | 2008-06-15 12:23:55 +0300 |
---|---|---|
committer | Seraphim Mellos <mellos@ceid.upatras.gr> | 2008-06-15 12:23:55 +0300 |
commit | 73c82e3f2fafa65d65c39893c0361de87da910e9 (patch) | |
tree | 2211db4e92fb9222b860b2c7882485ee036ac3a7 /modules | |
parent | Started work on Makefiles (diff) | |
download | openpam-modules-73c82e3f2fafa65d65c39893c0361de87da910e9.tar.gz openpam-modules-73c82e3f2fafa65d65c39893c0361de87da910e9.tar.bz2 openpam-modules-73c82e3f2fafa65d65c39893c0361de87da910e9.zip |
Completed Makefile for pam_unix
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_unix/Makefile | 9 | ||||
-rw-r--r-- | modules/pam_unix/Makefile~ | 10 | ||||
-rw-r--r-- | modules/pam_unix/pam_unix.c | 8 | ||||
-rw-r--r-- | modules/pam_unix/pam_unix.c~ | 13 |
4 files changed, 23 insertions, 17 deletions
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 <pwd.h> */ #include <netdb.h> #include <shadow.h> #include <sys/types.h> #include <unistd.h> +#include <time.h> +#include <string.h> #ifndef MAXHOSTNAMELEN @@ -20,7 +24,7 @@ #include <security/pam_modules.h> #include <security/pam_appl.h> -#include <pam_mod_misc.h> +#include <security/pam_mod_misc.h> /* * 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 <pwd.h> */ #include <netdb.h> #include <shadow.h> #include <sys/types.h> #include <unistd.h> +#include <time.h> #ifndef MAXHOSTNAMELEN @@ -20,7 +23,7 @@ #include <security/pam_modules.h> #include <security/pam_appl.h> -#include <pam_mod_misc.h> +#include <security/pam_mod_misc.h> /* * 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); } |