X-Git-Url: http://git.jankratochvil.net/?a=blobdiff_plain;f=tcpwrap.c;h=744a1dfc55bee74609e1e4c07212803b58a1d670;hb=33efcad5728d54fa7368a424556e883e556a4791;hp=ef3d3adc5e3527e5f5b29ca221bb4b3d83782232;hpb=a4d53c2fe3dc1952c7c7d8a4283545389ba5aa64;p=tac_plus.git diff --git a/tcpwrap.c b/tcpwrap.c index ef3d3ad..744a1df 100644 --- a/tcpwrap.c +++ b/tcpwrap.c @@ -1,24 +1,44 @@ -/* +/* This function use for check access control rules from hosts.deny and - hosts.access file. - Writen by Devrim SERAL. This file protected by - GNU Copyright agreement. + hosts.access file. + Writen by Devrim SERAL. This file protected by + GNU Copyright agreement. */ + + +#include "tac_plus.h" + #ifdef TCPWRAPPER + #include -#include "tac_plus.h" -int allow_severity = LOG_INFO; +#include "tcpwrap.h" +#include "report.h" +#include "packet.h" +#include "do_author.h" /* for "struct identity" */ +#include "main.h" + + +int allow_severity = LOG_INFO; /* *_severity accessed from libwrap */ int deny_severity = LOG_WARNING; +/* Configurable: + */ + +/* Define tac_plus name for hosts.* files */ +#define TACNAME "tac_plus" + + +int check_from_wrap TAC_ARGS((struct identity *datap)); + int check_from_wrap(datap) struct identity *datap; { struct request_info req; - request_init(&req, RQ_DAEMON,TACNAME,RQ_CLIENT_ADDR,datap->NAS_name , NULL); + request_init(&req, RQ_FILE,session.sock,RQ_DAEMON,TACNAME,RQ_CLIENT_ADDR,datap->NAS_name , NULL); fromhost(&req); /* validate client host info */ if (!hosts_access(&req)) { @@ -27,11 +47,16 @@ struct identity *datap; send_authen_error("You are not allowed to access here"); refuse(&req); /* If connection is not allowed, clean up and exit. */ return 0; - } - + } + if (debug & DEBUG_AUTHEN_FLAG ) report(LOG_DEBUG, "Access permited for NAS=%s",datap->NAS_name); -return 1; +return 1; } + +#else /* TCPWRAPPER */ + +TAC_SOURCEFILE_EMPTY + #endif /* TCPWRAPPER */