mirror of
https://github.com/rsyslog/rsyslog.git
synced 2025-12-22 23:30:46 +01:00
Merge branch 'v4-stable' into v5-stable
Conflicts: tools/syslogd.c
This commit is contained in:
commit
2f2169c5c2
@ -863,6 +863,8 @@ Version 4.8.1 [v4-stable], 2011-09-??
|
||||
- bugfix: potential fatal abort in omgssapi
|
||||
Thanks to Tomas Heinrich for the patch.
|
||||
- added doc for omprog
|
||||
- FQDN hostname for multihomed host was not always set to the correct name
|
||||
if multiple aliases existed. Thanks to Tomas Heinreich for the patch.
|
||||
---------------------------------------------------------------------------
|
||||
Version 4.8.0 [v4-stable] (rgerhards), 2011-09-07
|
||||
***************************************************************************
|
||||
|
||||
@ -2685,8 +2685,28 @@ int realMain(int argc, char **argv)
|
||||
*/
|
||||
hent = gethostbyname((char*)LocalHostName);
|
||||
if(hent) {
|
||||
int i = 0;
|
||||
|
||||
if(hent->h_aliases) {
|
||||
size_t hnlen;
|
||||
|
||||
hnlen = strlen((char *) LocalHostName);
|
||||
|
||||
for (i = 0; hent->h_aliases[i]; i++) {
|
||||
if (!strncmp(hent->h_aliases[i], (char *) LocalHostName, hnlen)
|
||||
&& hent->h_aliases[i][hnlen] == '.') {
|
||||
/* found a matching hostname */
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
free(LocalHostName);
|
||||
CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_name));
|
||||
if(hent->h_aliases && hent->h_aliases[i]) {
|
||||
CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_aliases[i]));
|
||||
} else {
|
||||
CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_name));
|
||||
}
|
||||
|
||||
if((p = (uchar*)strchr((char*)LocalHostName, '.')))
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user