diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-01-12 13:05:45 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-01-12 13:05:45 +0100 |
commit | 20ff1ed403f05606b68c13e4d5c591c6b8706f86 (patch) | |
tree | 9f336d20cab6225ca0a92371271797476b0ec826 | |
parent | 197d980f5b1fabef40d908f2aaf51c5be184c0e2 (diff) | |
download | rsyslog-20ff1ed403f05606b68c13e4d5c591c6b8706f86.tar.gz rsyslog-20ff1ed403f05606b68c13e4d5c591c6b8706f86.tar.xz rsyslog-20ff1ed403f05606b68c13e4d5c591c6b8706f86.zip |
fixed a potential segfault condition with $AllowedSender directive
On HUP, the root pointers were not properly cleaned up. Thanks to
Michael Biebel, olgoat, and Juha Koho for reporting and analyzing
the bug.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | net.c | 29 |
2 files changed, 33 insertions, 0 deletions
@@ -1,3 +1,7 @@ +- fixed a potential segfault condition with $AllowedSender directive + On HUP, the root pointers were not properly cleaned up. Thanks to + Michael Biebel, olgoat, and Juha Koho for reporting and analyzing + the bug. - some legacy options were not correctly processed. Thanks to varmojfekoj for the patch. - doc bugfix: some spelling errors in man pages corrected. Thanks to @@ -105,6 +105,30 @@ setAllowRoot(struct AllowedSenders **ppAllowRoot, uchar *pszType) finalize_it: RETiRet; } +/* re-initializes (sets to NULL) the correct allow root pointer + * rgerhards, 2009-01-12 + */ +static inline rsRetVal +reinitAllowRoot(uchar *pszType) +{ + DEFiRet; + + if(!strcmp((char*)pszType, "UDP")) + pAllowedSenders_UDP = NULL; + else if(!strcmp((char*)pszType, "TCP")) + pAllowedSenders_TCP = NULL; +#ifdef USE_GSSAPI + else if(!strcmp((char*)pszType, "GSS")) + pAllowedSenders_GSS = NULL; +#endif + else { + dbgprintf("program error: invalid allowed sender ID '%s', denying...\n", pszType); + ABORT_FINALIZE(RS_RET_CODE_ERR); /* everything is invalid for an invalid type */ + } + +finalize_it: + RETiRet; +} /* Code for handling allowed/disallowed senders @@ -214,6 +238,11 @@ clearAllowedSenders(uchar *pszType) free(pPrev->allowedSender.addr.NetAddr); free(pPrev); } + + /* indicate root pointer is de-init (was forgotten previously, resulting in + * all kinds of interesting things) -- rgerhards, 2009-01-12 + */ + reinitAllowRoot(pszType); } |