Blame SOURCES/rsyslog-8.2102.0-rhbz1984489-remove-abort-on-id-resolution-fail.patch

000b35
diff -up rsyslog-8.2102.0/runtime/cfsysline.c.orig rsyslog-8.2102.0/runtime/cfsysline.c
000b35
--- rsyslog-8.2102.0/runtime/cfsysline.c.orig	2021-08-04 07:16:02.663163106 +0200
000b35
+++ rsyslog-8.2102.0/runtime/cfsysline.c	2021-08-04 07:18:05.952490008 +0200
000b35
@@ -353,13 +353,8 @@ static rsRetVal doGetGID(uchar **pp, rsR
000b35
 	assert(*pp != NULL);
000b35
 
000b35
 	if(getSubString(pp, (char*) szName, sizeof(szName), ' ')  != 0) {
000b35
-		if(loadConf->globals.abortOnIDResolutionFail) {
000b35
-			fprintf(stderr, "could not extract group name: %s\n", (char*)szName);
000b35
-			exit(1); /* good exit */
000b35
-		} else {
000b35
-			LogError(0, RS_RET_NOT_FOUND, "could not extract group name");
000b35
-			ABORT_FINALIZE(RS_RET_NOT_FOUND);
000b35
-		}
000b35
+		LogError(0, RS_RET_NOT_FOUND, "could not extract group name");
000b35
+		ABORT_FINALIZE(RS_RET_NOT_FOUND);
000b35
 	}
000b35
 
000b35
 	do {
000b35
@@ -380,10 +375,6 @@ static rsRetVal doGetGID(uchar **pp, rsR
000b35
 			LogError(0, RS_RET_NOT_FOUND, "ID for group '%s' could not be found", szName);
000b35
 		}
000b35
 		iRet = RS_RET_NOT_FOUND;
000b35
-		if(loadConf->globals.abortOnIDResolutionFail) {
000b35
-			fprintf(stderr, "ID for group '%s' could not be found or error\n", szName);
000b35
-			exit(1); /* good exit */
000b35
-		}
000b35
 	} else {
000b35
 		if(pSetHdlr == NULL) {
000b35
 			/* we should set value directly to var */
000b35
@@ -418,25 +409,15 @@ static rsRetVal doGetUID(uchar **pp, rsR
000b35
 	assert(*pp != NULL);
000b35
 
000b35
 	if(getSubString(pp, (char*) szName, sizeof(szName), ' ')  != 0) {
000b35
-		if(loadConf->globals.abortOnIDResolutionFail) {
000b35
-			fprintf(stderr, "could not extract user name: %s\n", (char*)szName);
000b35
-			exit(1); /* good exit */
000b35
-		} else {
000b35
-			LogError(0, RS_RET_NOT_FOUND, "could not extract user name");
000b35
-			ABORT_FINALIZE(RS_RET_NOT_FOUND);
000b35
-		}
000b35
+		LogError(0, RS_RET_NOT_FOUND, "could not extract user name");
000b35
+		ABORT_FINALIZE(RS_RET_NOT_FOUND);
000b35
 	}
000b35
 
000b35
 	getpwnam_r((char*)szName, &pwBuf, stringBuf, sizeof(stringBuf), &ppwBuf);
000b35
 
000b35
 	if(ppwBuf == NULL) {
000b35
-		if(loadConf->globals.abortOnIDResolutionFail) {
000b35
-			fprintf(stderr, "ID for user '%s' could not be found or error\n", (char*)szName);
000b35
-			exit(1); /* good exit */
000b35
-		} else {
000b35
-			LogError(0, RS_RET_NOT_FOUND, "ID for user '%s' could not be found or error", (char*)szName);
000b35
-			iRet = RS_RET_NOT_FOUND;
000b35
-		}
000b35
+		LogError(0, RS_RET_NOT_FOUND, "ID for user '%s' could not be found or error", (char*)szName);
000b35
+		iRet = RS_RET_NOT_FOUND;
000b35
 	} else {
000b35
 		if(pSetHdlr == NULL) {
000b35
 			/* we should set value directly to var */
000b35
diff -up rsyslog-8.2102.0/runtime/glbl.c.orig rsyslog-8.2102.0/runtime/glbl.c
000b35
--- rsyslog-8.2102.0/runtime/glbl.c.orig	2021-08-04 07:18:19.301633677 +0200
000b35
+++ rsyslog-8.2102.0/runtime/glbl.c	2021-08-04 07:19:02.409019106 +0200
000b35
@@ -210,7 +210,6 @@ static struct cnfparamdescr cnfparamdesc
000b35
 	{ "environment", eCmdHdlrArray, 0 },
000b35
 	{ "processinternalmessages", eCmdHdlrBinary, 0 },
000b35
 	{ "umask", eCmdHdlrFileCreateMode, 0 },
000b35
-	{ "security.abortonidresolutionfail", eCmdHdlrBinary, 0 },
000b35
 	{ "internal.developeronly.options", eCmdHdlrInt, 0 },
000b35
 	{ "internalmsg.ratelimit.interval", eCmdHdlrPositiveInt, 0 },
000b35
 	{ "internalmsg.ratelimit.burst", eCmdHdlrPositiveInt, 0 },
000b35
@@ -1443,8 +1442,6 @@ glblDoneLoadCnf(void)
000b35
 			glblInputTimeoutShutdown = (int) cnfparamvals[i].val.d.n;
000b35
 		} else if(!strcmp(paramblk.descr[i].name, "privdrop.group.keepsupplemental")) {
000b35
 			loadConf->globals.gidDropPrivKeepSupplemental = (int) cnfparamvals[i].val.d.n;
000b35
-		} else if(!strcmp(paramblk.descr[i].name, "security.abortonidresolutionfail")) {
000b35
-			loadConf->globals.abortOnIDResolutionFail = (int) cnfparamvals[i].val.d.n;
000b35
 		} else if(!strcmp(paramblk.descr[i].name, "net.acladdhostnameonfail")) {
000b35
 			*(net.pACLAddHostnameOnFail) = (int) cnfparamvals[i].val.d.n;
000b35
 		} else if(!strcmp(paramblk.descr[i].name, "net.aclresolvehostname")) {
000b35
diff -up rsyslog-8.2102.0/runtime/rsconf.c.orig rsyslog-8.2102.0/runtime/rsconf.c
000b35
--- rsyslog-8.2102.0/runtime/rsconf.c.orig	2021-08-04 07:19:13.103104854 +0200
000b35
+++ rsyslog-8.2102.0/runtime/rsconf.c	2021-08-04 07:19:44.635357684 +0200
000b35
@@ -156,7 +156,6 @@ static void cnfSetDefaults(rsconf_t *pTh
000b35
 	pThis->globals.maxErrMsgToStderr = -1;
000b35
 	pThis->globals.umask = -1;
000b35
 	pThis->globals.gidDropPrivKeepSupplemental = 0;
000b35
-	pThis->globals.abortOnIDResolutionFail = 1;
000b35
 	pThis->templates.root = NULL;
000b35
 	pThis->templates.last = NULL;
000b35
 	pThis->templates.lastStatic = NULL;
000b35
diff -up rsyslog-8.2102.0/runtime/rsconf.h.orig rsyslog-8.2102.0/runtime/rsconf.h
000b35
--- rsyslog-8.2102.0/runtime/rsconf.h.orig	2021-08-04 07:20:15.848607958 +0200
000b35
+++ rsyslog-8.2102.0/runtime/rsconf.h	2021-08-04 07:20:42.782823920 +0200
000b35
@@ -73,7 +73,6 @@ struct globals_s {
000b35
 	int uidDropPriv;	/* user-id to which priveleges should be dropped to */
000b35
 	int gidDropPriv;	/* group-id to which priveleges should be dropped to */
000b35
 	int gidDropPrivKeepSupplemental; /* keep supplemental groups when dropping? */
000b35
-	int abortOnIDResolutionFail;
000b35
 	int umask;		/* umask to use */
000b35
 	uchar *pszConfDAGFile;	/* name of config DAG file, non-NULL means generate one */
000b35