!1185 lib文件夹下的安全编译

Merge pull request !1185 from nwen/master
This commit is contained in:
opengauss-bot
2021-08-05 08:31:03 +00:00
committed by Gitee
2 changed files with 8 additions and 2 deletions

View File

@ -32,8 +32,8 @@ VERSION = 1
override CPPFLAGS := -I$(top_builddir)/src/common/port -DFRONTEND $(CPPFLAGS) $(CFLAGS_SSE42)
LIBS += $(PTHREAD_LIBS)
override CPPFLAGS := $(filter-out -fPIE, $(CPPFLAGS)) -fPIC
override CFLAGS := $(filter-out -fPIE, $(CFLAGS)) -fPIC
override CPPFLAGS := $(filter-out -fPIE, $(CPPFLAGS)) -fPIC -fstack-protector-all
override CFLAGS := $(filter-out -fPIE, $(CFLAGS)) -fPIC -fstack-protector-all
override CPPSources=$(shell find -name "*.cpp" ! -name "path.cpp" | sort)
ifneq "$(MAKECMDGOALS)" "clean"

View File

@ -660,6 +660,9 @@ static void init_session_share_memory()
static bool InitSession(knl_session_context* session)
{
/* non't send ereport to client now */
t_thrd.postgres_cxt.whereToSendOutput = DestNone;
/* Switch context to Session context. */
AutoContextSwitch memSwitch(session->mcxt_group->GetMemCxtGroup(MEMORY_CONTEXT_DEFAULT));
@ -681,6 +684,9 @@ static bool InitSession(knl_session_context* session)
/* Read in remaining GUC variables */
read_nondefault_variables();
/* now safe to ereport to client */
t_thrd.postgres_cxt.whereToSendOutput = DestRemote;
/* Init port and connection. */
if (!InitPort(session->proc_cxt.MyProcPort)) {