summaryrefslogtreecommitdiffstats
path: root/plugins/imgssapi
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-02-26 11:16:05 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-02-26 11:16:05 +0000
commit3467a10c06414a5dea2ef933fc9709085d362446 (patch)
tree2c13bdbd02764105eba153a7a22dc920ee18a544 /plugins/imgssapi
parentb98ca5114ed1d1975e06614472d4019d8c1767ab (diff)
downloadrsyslog-3467a10c06414a5dea2ef933fc9709085d362446.tar.gz
rsyslog-3467a10c06414a5dea2ef933fc9709085d362446.tar.xz
rsyslog-3467a10c06414a5dea2ef933fc9709085d362446.zip
shuffled some more code, added comments varmojfekoj sent me a while ago to
imgssapi
Diffstat (limited to 'plugins/imgssapi')
-rw-r--r--plugins/imgssapi/imgssapi.c42
1 files changed, 40 insertions, 2 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:
+ */