summaryrefslogtreecommitdiff
path: root/sysutils/rsyslog6-devel/files
diff options
context:
space:
mode:
authorPhilip M. Gollucci <pgollucci@FreeBSD.org>2010-05-12 21:40:42 +0000
committerPhilip M. Gollucci <pgollucci@FreeBSD.org>2010-05-12 21:40:42 +0000
commit7acc749ea6e7241f7a8d7adbe6578f41793e6a03 (patch)
tree3277e6104fe01f07345e1dad524853e8da2b8de2 /sysutils/rsyslog6-devel/files
parent- Forced commit to note repo copies from sysutils/rsyslog5* -> sysutils/rsysl... (diff)
- Please welcome rsyslog55 which is tracking the -devel
- 2 custom optional patches o) microsecond support for MySQL o) sanely select and return FQDN for use in $fromhost templates PR: ports/146316 No objection from: cristianorolim@hotmail.com (rsyslog* maintainer) Submitted by: pgollucci@ (myself)
Diffstat (limited to 'sysutils/rsyslog6-devel/files')
-rw-r--r--sysutils/rsyslog6-devel/files/extra-patch-mysql-microseconds56
-rw-r--r--sysutils/rsyslog6-devel/files/extra-patch-sane-hostname40
2 files changed, 96 insertions, 0 deletions
diff --git a/sysutils/rsyslog6-devel/files/extra-patch-mysql-microseconds b/sysutils/rsyslog6-devel/files/extra-patch-mysql-microseconds
new file mode 100644
index 000000000000..ec248b064741
--- /dev/null
+++ b/sysutils/rsyslog6-devel/files/extra-patch-mysql-microseconds
@@ -0,0 +1,56 @@
+--- ./runtime/datetime.c.orig 2010-05-04 18:57:25.588028725 -0400
++++ ./runtime/datetime.c 2010-05-04 18:59:12.390680038 -0400
+@@ -644,18 +644,30 @@
+ pBuf[1] = (ts->year / 100) % 10 + '0';
+ pBuf[2] = (ts->year / 10) % 10 + '0';
+ pBuf[3] = ts->year % 10 + '0';
+- pBuf[4] = (ts->month / 10) % 10 + '0';
+- pBuf[5] = ts->month % 10 + '0';
+- pBuf[6] = (ts->day / 10) % 10 + '0';
+- pBuf[7] = ts->day % 10 + '0';
+- pBuf[8] = (ts->hour / 10) % 10 + '0';
+- pBuf[9] = ts->hour % 10 + '0';
+- pBuf[10] = (ts->minute / 10) % 10 + '0';
+- pBuf[11] = ts->minute % 10 + '0';
+- pBuf[12] = (ts->second / 10) % 10 + '0';
+- pBuf[13] = ts->second % 10 + '0';
+- pBuf[14] = '\0';
+- return 15;
++ pBuf[4] = '-';
++ pBuf[5] = (ts->month / 10) % 10 + '0';
++ pBuf[6] = ts->month % 10 + '0';
++ pBuf[7] = '-';
++ pBuf[8] = (ts->day / 10) % 10 + '0';
++ pBuf[9] = ts->day % 10 + '0';
++ pBuf[10] = ' ';
++ pBuf[11] = (ts->hour / 10) % 10 + '0';
++ pBuf[12] = ts->hour % 10 + '0';
++ pBuf[13] = ':';
++ pBuf[14] = (ts->minute / 10) % 10 + '0';
++ pBuf[15] = ts->minute % 10 + '0';
++ pBuf[16] = ':';
++ pBuf[17] = (ts->second / 10) % 10 + '0';
++ pBuf[18] = ts->second % 10 + '0';
++ pBuf[19] = '.';
++ pBuf[20] = (ts->secfrac / 100000) % 10 + '0';
++ pBuf[21] = (ts->secfrac / 10000) % 10 + '0';
++ pBuf[22] = (ts->secfrac / 1000) % 10 + '0';
++ pBuf[23] = (ts->secfrac / 100) % 10 + '0';
++ pBuf[24] = (ts->secfrac / 10) % 10 + '0';
++ pBuf[25] = ts->secfrac % 10 + '0';
++ pBuf[26] = '\0';
++ return 26;
+
+ }
+
+--- ./runtime/msg.c.orig 2010-05-04 19:00:20.241528788 -0400
++++ ./runtime/msg.c 2010-05-04 19:00:06.136349680 -0400
+@@ -1293,7 +1293,7 @@
+ case tplFmtMySQLDate:
+ MsgLock(pM);
+ if(pM->pszTIMESTAMP_MySQL == NULL) {
+- if((pM->pszTIMESTAMP_MySQL = MALLOC(15)) == NULL) {
++ if((pM->pszTIMESTAMP_MySQL = MALLOC(26)) == NULL) {
+ MsgUnlock(pM);
+ return "";
+ }
diff --git a/sysutils/rsyslog6-devel/files/extra-patch-sane-hostname b/sysutils/rsyslog6-devel/files/extra-patch-sane-hostname
new file mode 100644
index 000000000000..bc7251475d81
--- /dev/null
+++ b/sysutils/rsyslog6-devel/files/extra-patch-sane-hostname
@@ -0,0 +1,40 @@
+--- ./tools/syslogd.c.orig 2010-05-04 19:02:05.548362478 -0400
++++ ./tools/syslogd.c 2010-05-04 19:02:27.452450741 -0400
+@@ -2611,37 +2611,6 @@
+ net.getLocalHostname(&LocalFQDNName);
+ CHKmalloc(LocalHostName = (uchar*) strdup((char*)LocalFQDNName));
+ glbl.SetLocalFQDNName(LocalFQDNName); /* set the FQDN before we modify it */
+- if((p = (uchar*)strchr((char*)LocalHostName, '.'))) {
+- *p++ = '\0';
+- LocalDomain = p;
+- } else {
+- LocalDomain = (uchar*)"";
+-
+- /* It's not clearly defined whether gethostname()
+- * should return the simple hostname or the fqdn. A
+- * good piece of software should be aware of both and
+- * we want to distribute good software. Joey
+- *
+- * Good software also always checks its return values...
+- * If syslogd starts up before DNS is up & /etc/hosts
+- * doesn't have LocalHostName listed, gethostbyname will
+- * return NULL.
+- */
+- /* TODO: gethostbyname() is not thread-safe, but replacing it is
+- * not urgent as we do not run on multiple threads here. rgerhards, 2007-09-25
+- */
+- hent = gethostbyname((char*)LocalHostName);
+- if(hent) {
+- free(LocalHostName);
+- CHKmalloc(LocalHostName = (uchar*)strdup(hent->h_name));
+-
+- if((p = (uchar*)strchr((char*)LocalHostName, '.')))
+- {
+- *p++ = '\0';
+- LocalDomain = p;
+- }
+- }
+- }
+
+ /* Convert to lower case to recognize the correct domain laterly */
+ for(p = LocalDomain ; *p ; p++)