diff options
| author | Walter de Jong <walter@heiho.net> | 2013-03-28 21:49:33 +0100 |
|---|---|---|
| committer | Walter de Jong <walter@heiho.net> | 2013-03-28 21:49:33 +0100 |
| commit | a2ee53a0868a5bd5612c4d6529ae460b3e7dd4ab (patch) | |
| tree | d0cff66509d229e7bea3f8f1cdeeaefaedcadbed | |
| parent | 73e1f110666d7aee4e7a5a5d865c1bf54cded84a (diff) | |
| download | pam_tacplus-a2ee53a0868a5bd5612c4d6529ae460b3e7dd4ab.tar.gz pam_tacplus-a2ee53a0868a5bd5612c4d6529ae460b3e7dd4ab.zip | |
more stuff belongs in headers
| -rw-r--r-- | libtac/include/libtac.h | 3 | ||||
| -rw-r--r-- | pam_tacplus.c | 24 | ||||
| -rw-r--r-- | pam_tacplus.h | 17 | ||||
| -rw-r--r-- | support.h | 1 |
4 files changed, 25 insertions, 20 deletions
diff --git a/libtac/include/libtac.h b/libtac/include/libtac.h index 6ede892..bab3d26 100644 --- a/libtac/include/libtac.h +++ b/libtac/include/libtac.h @@ -151,6 +151,9 @@ extern void tac_add_attrib_pair(struct tac_attrib **attr, char *name, char sep, char *value); extern int tac_read_wait(int fd, int timeout, int size, int *time_left); +/* magic.c */ +u_int32_t magic(void); + #ifdef __cplusplus } #endif diff --git a/pam_tacplus.c b/pam_tacplus.c index f240c8e..42d5f54 100644 --- a/pam_tacplus.c +++ b/pam_tacplus.c @@ -19,6 +19,9 @@ * See `CHANGES' file for revision history. */ +#include "pam_tacplus.h" +#include "support.h" + #include <stdlib.h> /* malloc */ #include <stdio.h> #include <syslog.h> @@ -34,28 +37,13 @@ #include <unistd.h> #include <strings.h> -#include "libtac.h" -#include "pam_tacplus.h" -#include "support.h" - -#define PAM_SM_AUTH -#define PAM_SM_ACCOUNT -#define PAM_SM_SESSION -/* #define PAM_SM_PASSWORD */ - -#include <security/pam_appl.h> -#include <security/pam_modules.h> - #ifdef HAVE_CONFIG_H - #include "config.h" + #include "config.h" #endif -/* magic.c */ -extern u_int32_t magic(); - /* address of server discovered by pam_sm_authenticate */ -static struct addrinfo *active_server; -char *active_key; +static struct addrinfo *active_server = NULL; +static char *active_key = NULL; /* accounting task identifier */ static short int task_id = 0; diff --git a/pam_tacplus.h b/pam_tacplus.h index c65212d..b2f2b3c 100644 --- a/pam_tacplus.h +++ b/pam_tacplus.h @@ -19,6 +19,18 @@ * See `CHANGES' file for revision history. */ +#ifndef PAM_TACPLUS_H +#define PAM_TACPLUS_H + +/* define these before including PAM headers */ +#define PAM_SM_AUTH +#define PAM_SM_ACCOUNT +#define PAM_SM_SESSION +/* #define PAM_SM_PASSWORD */ + +#include <security/pam_appl.h> +#include <security/pam_modules.h> + /* pam_tacplus command line options */ #define PAM_TAC_DEBUG 0x01 #define PAM_TAC_ACCT 0x02 /* account on all specified servers */ @@ -31,5 +43,8 @@ #define PAM_TAC_VPAT 8 #ifndef PAM_EXTERN - #define PAM_EXTERN extern + #define PAM_EXTERN extern #endif + +#endif /* PAM_TACPLUS_H */ + @@ -24,7 +24,6 @@ #include "libtac.h" -#include <security/pam_appl.h> #include <security/pam_modules.h> extern struct addrinfo *tac_srv[TAC_PLUS_MAXSERVERS]; |
