Projects
Eulaceura:Factory
rsyslog
_service:obs_scm:rsyslog-8.24.0-ensure-parent-d...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:rsyslog-8.24.0-ensure-parent-dir-exists-when-writting-log-file.patch of Package rsyslog
From 4196f125b63ad889c071b25a6a72176be2e31f65 Mon Sep 17 00:00:00 2001 From: guoxiaoqi <guoxiaoqi2@huawei.com> Date: Sat, 26 Jan 2019 12:21:02 +0000 Subject: [PATCH] rsyslog-8.24.0, ensure parent dir exists when writting log file reason: rsyslog-8.24.0, ensure parent dir exists when writting log file Signed-off-by: guoxiaoqi <guoxiaoqi2@huawei.com> --- tools/omfile.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tools/omfile.c b/tools/omfile.c index c1a5615..30d792a 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -805,7 +805,14 @@ doWrite(instanceData *__restrict__ const pData, uchar *__restrict__ const pszBuf DBGPRINTF("omfile: write to stream, pData->pStrm %p, lenBuf %d, strt data %.128s\n", pData->pStrm, lenBuf, pszBuf); - if(pData->pStrm != NULL){ + if(pData->pStrm != NULL) { + if(pData->pStrm->fd == -1 && access((char*)pData->fname, F_OK)) { + if(makeFileParentDirs(pData->fname, ustrlen(pData->fname), + pData->fDirCreateMode, pData->dirUID, + pData->dirGID, pData->bFailOnChown) != 0) { + ABORT_FINALIZE(RS_RET_ERR); /* we give up */ + } + } CHKiRet(strm.Write(pData->pStrm, pszBuf, lenBuf)); if(pData->useSigprov) { CHKiRet(pData->sigprov.OnRecordWrite(pData->sigprovFileData, pszBuf, lenBuf)); -- 1.8.3.1
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2