From 73e1f110666d7aee4e7a5a5d865c1bf54cded84a Mon Sep 17 00:00:00 2001 From: Walter de Jong Date: Thu, 28 Mar 2013 21:35:34 +0100 Subject: stuff belongs in an include file --- pam_tacplus.c | 16 ---------------- support.c | 9 +-------- support.h | 37 ++++++++++++++++++++++++------------- 3 files changed, 25 insertions(+), 37 deletions(-) diff --git a/pam_tacplus.c b/pam_tacplus.c index c573c83..f240c8e 100644 --- a/pam_tacplus.c +++ b/pam_tacplus.c @@ -50,22 +50,6 @@ #include "config.h" #endif -/* support.c */ -extern struct addrinfo *tac_srv[TAC_PLUS_MAXSERVERS]; -extern char *tac_srv_key[TAC_PLUS_MAXSERVERS]; -extern int tac_srv_no; -extern char *tac_service; -extern char *tac_protocol; -extern int _pam_parse (int argc, const char **argv); -extern unsigned long _getserveraddr (char *serv); -extern int tacacs_get_password (pam_handle_t * pamh, int flags - ,int ctrl, char **password); -extern int converse (pam_handle_t * pamh, int nargs - ,struct pam_message **message - ,struct pam_response **response); -extern void _pam_log (int err, const char *format,...); -extern void *_xcalloc (size_t size); - /* magic.c */ extern u_int32_t magic(); diff --git a/support.c b/support.c index 0dacf7b..df09aba 100644 --- a/support.c +++ b/support.c @@ -24,11 +24,8 @@ #define PAM_SM_SESSION /* #define PAM_SM_PASSWORD */ -#include -#include - +#include "support.h" #include "pam_tacplus.h" -#include "libtac.h" struct addrinfo *tac_srv[TAC_PLUS_MAXSERVERS]; int tac_srv_no = 0; @@ -38,10 +35,6 @@ char *tac_service = NULL; char *tac_protocol = NULL; char *tac_prompt = NULL; -/* libtac */ -extern char *tac_login; -extern int tac_timeout; - /* FIXME using xcalloc() leaks memory for long-running programs that authenticate multiple times */ diff --git a/support.h b/support.h index 6e5da87..9c2a24e 100644 --- a/support.h +++ b/support.h @@ -19,19 +19,30 @@ * See `CHANGES' file for revision history. */ +#ifndef PAM_TACPLUS_SUPPORT_H +#define PAM_TACPLUS_SUPPORT_H + +#include "libtac.h" + #include #include -/* support.c */ -extern int _pam_parse (int argc, const char **argv); -extern unsigned long _resolve_name (char *serv); -extern int tacacs_get_password (pam_handle_t * pamh, int flags - ,int ctrl, char **password); -extern int converse (pam_handle_t * pamh, int nargs - ,struct pam_message **message - ,struct pam_response **response); -extern void _pam_log (int err, const char *format,...); -extern void *_xcalloc (size_t size); -extern char *_pam_get_user(pam_handle_t *pamh); -extern char *_pam_get_terminal(pam_handle_t *pamh); -extern char *_pam_get_rhost(pam_handle_t *pamh); +extern struct addrinfo *tac_srv[TAC_PLUS_MAXSERVERS]; +extern char *tac_srv_key[TAC_PLUS_MAXSERVERS]; +extern int tac_srv_no; +extern char *tac_service; +extern char *tac_protocol; + +int _pam_parse (int, const char **); +unsigned long _resolve_name (char *); +unsigned long _getserveraddr (char *serv); +int tacacs_get_password (pam_handle_t *, int, int, char **); +int converse (pam_handle_t *, int, const struct pam_message *, struct pam_response **); +void _pam_log (int, const char *, ...); +void *_xcalloc (size_t); +char *_pam_get_user(pam_handle_t *); +char *_pam_get_terminal(pam_handle_t *); +char *_pam_get_rhost(pam_handle_t *); + +#endif /* PAM_TACPLUS_SUPPORT_H */ + -- cgit v1.2.3