1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00

Fix for the omprog module -- calling execve() with a NULL second

argument doesn't work.  Instead supply an argv list with just a
terminating NULL entry.

Submitted upstream as https://github.com/rsyslog/rsyslog/pull/1618

Patch files regenerated by 'make makepatch'

Reported by:	(Chun-Tien Chang) <tcs@kitty.2y.idv.tw>
This commit is contained in:
Matthew Seaman 2017-06-14 17:38:26 +00:00
parent 26e4ccd468
commit a7d3428b14
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=443594
5 changed files with 27 additions and 6 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= rsyslog
PORTVERSION= 8.27.0
PORTREVISION= 1
CATEGORIES= sysutils
MASTER_SITES= http://www.rsyslog.com/files/download/rsyslog/

View File

@ -1,4 +1,4 @@
--- grammar/rainerscript.c.orig 2016-11-13 15:46:26 UTC
--- grammar/rainerscript.c.orig 2017-04-28 07:04:53 UTC
+++ grammar/rainerscript.c
@@ -35,6 +35,7 @@
#include <sys/stat.h>

View File

@ -1,4 +1,4 @@
--- plugins/impstats/impstats.c.orig 2016-11-13 15:46:26 UTC
--- plugins/impstats/impstats.c.orig 2017-04-28 07:04:53 UTC
+++ plugins/impstats/impstats.c
@@ -36,6 +36,7 @@
#include <errno.h>

View File

@ -0,0 +1,20 @@
--- plugins/omprog/omprog.c.orig 2017-05-15 09:41:19 UTC
+++ plugins/omprog/omprog.c
@@ -231,6 +231,7 @@ execBinary(wrkrInstanceData_t *pWrkrData
sigset_t set;
char errStr[1024];
char *newenviron[] = { NULL };
+ char *emptyArgv[] = { NULL };
fclose(stdin);
if(dup(fdStdin) == -1) {
@@ -277,6 +278,9 @@ execBinary(wrkrInstanceData_t *pWrkrData
alarm(0);
/* finally exec child */
+ if(pWrkrData->pData->aParams==NULL){
+ pWrkrData->pData->aParams=emptyArgv;
+ }
iRet = execve((char*)pWrkrData->pData->szBinary, pWrkrData->pData->aParams, newenviron);
if(iRet == -1) {
/* Note: this will go to stdout of the **child**, so rsyslog will never

View File

@ -1,6 +1,6 @@
--- runtime/nsd_ptcp.c.orig 2016-11-06 16:32:01 UTC
--- runtime/nsd_ptcp.c.orig 2017-04-28 07:04:53 UTC
+++ runtime/nsd_ptcp.c
@@ -656,7 +656,11 @@ EnableKeepAlive(nsd_t *pNsd)
@@ -665,7 +665,11 @@ EnableKeepAlive(nsd_t *pNsd)
if(pThis->iKeepAliveProbes > 0) {
optval = pThis->iKeepAliveProbes;
optlen = sizeof(optval);
@ -12,7 +12,7 @@
} else {
ret = 0;
}
@@ -671,7 +675,11 @@ EnableKeepAlive(nsd_t *pNsd)
@@ -680,7 +684,11 @@ EnableKeepAlive(nsd_t *pNsd)
if(pThis->iKeepAliveTime > 0) {
optval = pThis->iKeepAliveTime;
optlen = sizeof(optval);
@ -24,7 +24,7 @@
} else {
ret = 0;
}
@@ -686,7 +694,11 @@ EnableKeepAlive(nsd_t *pNsd)
@@ -695,7 +703,11 @@ EnableKeepAlive(nsd_t *pNsd)
if(pThis->iKeepAliveIntvl > 0) {
optval = pThis->iKeepAliveIntvl;
optlen = sizeof(optval);