diff options
-rw-r--r-- | plugins/imgssapi/imgssapi.c | 42 | ||||
-rw-r--r-- | plugins/imtcp/imtcp.c | 24 |
2 files changed, 45 insertions, 21 deletions
diff --git a/plugins/imgssapi/imgssapi.c b/plugins/imgssapi/imgssapi.c index 62bcb2dd..cac3bda9 100644 --- a/plugins/imgssapi/imgssapi.c +++ b/plugins/imgssapi/imgssapi.c @@ -110,7 +110,10 @@ int TCPSessGSSInit(void) } -/* returns 0 if all went OK, -1 if it failed */ +/* returns 0 if all went OK, -1 if it failed + * Calls TCPSessAccept() and then tries to guess if the connection uses + * gssapi. + */ int TCPSessGSSAccept(int fd) { gss_buffer_desc send_tok, recv_tok; @@ -273,7 +276,9 @@ int TCPSessGSSAccept(int fd) } -/* returns: ? */ +/* returns: ? + * Replaces recv() for gssapi connections. + */ int TCPSessGSSRecv(int iSess, void *buf, size_t buf_len) { gss_buffer_desc xmit_buf, msg_buf; @@ -311,6 +316,9 @@ int TCPSessGSSRecv(int iSess, void *buf, size_t buf_len) } +/* Takes care of cleaning up gssapi stuff and then calls + * TCPSessClose(). + */ void TCPSessGSSClose(int iSess) { OM_uint32 maj_stat, min_stat; gss_ctx_id_t *context; @@ -333,6 +341,7 @@ void TCPSessGSSClose(int iSess) { } +/* Counterpart of TCPSessGSSInit() */ void TCPSessGSSDeinit(void) { OM_uint32 maj_stat, min_stat; @@ -341,3 +350,32 @@ void TCPSessGSSDeinit(void) { display_status("releasing credentials", maj_stat, min_stat); } + +static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) +{ + if (gss_listen_service_name != NULL) { + free(gss_listen_service_name); + gss_listen_service_name = NULL; + } + bPermitPlainTcp = 0; + return RS_RET_OK; +} + + +BEGINmodInit() +CODESTARTmodInit + *ipIFVersProvided = 1; /* so far, we only support the initial definition */ +CODEmodInit_QueryRegCFSLineHdlr + /* register config file handlers */ + CHKiRet(omsdRegCFSLineHdlr((uchar *)"permitplaintcp", 0, eCmdHdlrBinary, + NULL, bPermitPlainTcp, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputgssserverrun", 0, eCmdHdlrGetWord, + addGSSListener, NULL, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputgssserverservicename", 0, eCmdHdlrGetWord, + NULL, &gss_listen_service_name, STD_LOADABLE_MODULE_ID)); + CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, + resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); +ENDmodInit + +/* vim:set ai: + */ diff --git a/plugins/imtcp/imtcp.c b/plugins/imtcp/imtcp.c index a1fabea7..d3752d42 100644 --- a/plugins/imtcp/imtcp.c +++ b/plugins/imtcp/imtcp.c @@ -918,7 +918,6 @@ CODESTARTwillRun /* first apply some config settings */ #endif -dbgprintf("imtcp: bEnableTCP %d\n", bEnableTCP); PrintAllowedSenders(2); /* TCP */ #ifdef USE_GSSAPI PrintAllowedSenders(3); /* GSS */ @@ -986,15 +985,10 @@ CODESTARTqueryEtryPt CODEqueryEtryPt_STD_IMOD_QUERIES ENDqueryEtryPt + +#ifndef USE_GSSAPI static rsRetVal resetConfigVariables(uchar __attribute__((unused)) *pp, void __attribute__((unused)) *pVal) { -#if defined(USE_GSSAPI) - if (gss_listen_service_name != NULL) { - free(gss_listen_service_name); - gss_listen_service_name = NULL; - } - bPermitPlainTcp = 0; -#endif return RS_RET_OK; } @@ -1004,22 +998,14 @@ CODESTARTmodInit *ipIFVersProvided = 1; /* so far, we only support the initial definition */ CODEmodInit_QueryRegCFSLineHdlr /* register config file handlers */ -#if defined(USE_GSSAPI) - CHKiRet(omsdRegCFSLineHdlr((uchar *)"permitplaintcp", 0, eCmdHdlrBinary, - NULL, bPermitPlainTcp, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputgssserverrun", 0, eCmdHdlrGetWord, - addGSSListener, NULL, STD_LOADABLE_MODULE_ID)); - CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputgssserverservicename", 0, eCmdHdlrGetWord, - NULL, &gss_listen_service_name, STD_LOADABLE_MODULE_ID)); -#else CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputtcpserverrun", 0, eCmdHdlrGetWord, addTCPListener, NULL, STD_LOADABLE_MODULE_ID)); CHKiRet(omsdRegCFSLineHdlr((uchar *)"inputtcpmaxsessions", 0, eCmdHdlrInt, NULL, &iTCPSessMax, STD_LOADABLE_MODULE_ID)); -#endif CHKiRet(omsdRegCFSLineHdlr((uchar *)"resetconfigvariables", 1, eCmdHdlrCustomHandler, resetConfigVariables, NULL, STD_LOADABLE_MODULE_ID)); ENDmodInit -/* - * vi:set ai: +#endif + +/* vim:set ai: */ |