mirror of
https://github.com/rsyslog/rsyslog.git
synced 2026-08-30 17:30:16 +02:00
DirCreateMode was always zero. work-around now is to do a...
one-time write to the mode, then all works. However, if no such write is done, the variable always remains zero. I have used the memory debugger as well as shuffled the code around and used guard variables nothing changed. The problem always moved with the changes I did. So I now consider the one-time write a usable work-around, because it definitely fixes the issue even though it does not explain why it happens.
This commit is contained in:
parent
724ba2b27f
commit
36bfaf6348
@ -66,6 +66,7 @@
|
|||||||
#include "errmsg.h"
|
#include "errmsg.h"
|
||||||
#include "stream.h"
|
#include "stream.h"
|
||||||
#include "unicode-helper.h"
|
#include "unicode-helper.h"
|
||||||
|
#include "atomic.h"
|
||||||
|
|
||||||
MODULE_TYPE_OUTPUT
|
MODULE_TYPE_OUTPUT
|
||||||
|
|
||||||
@ -152,12 +153,14 @@ CODESTARTdbgPrintInstInfo
|
|||||||
"\tcreate directories: %s\n"
|
"\tcreate directories: %s\n"
|
||||||
"\tfile owner %d, group %d\n"
|
"\tfile owner %d, group %d\n"
|
||||||
"\tdirectory owner %d, group %d\n"
|
"\tdirectory owner %d, group %d\n"
|
||||||
|
"\tdir create mode 0%3.3o, file create mode 0%3.3o\n"
|
||||||
"\tfail if owner/group can not be set: %s\n",
|
"\tfail if owner/group can not be set: %s\n",
|
||||||
pData->f_fname,
|
pData->f_fname,
|
||||||
pData->iDynaFileCacheSize,
|
pData->iDynaFileCacheSize,
|
||||||
pData->bCreateDirs ? "yes" : "no",
|
pData->bCreateDirs ? "yes" : "no",
|
||||||
pData->fileUID, pData->fileGID,
|
pData->fileUID, pData->fileGID,
|
||||||
pData->dirUID, pData->dirGID,
|
pData->dirUID, pData->dirGID,
|
||||||
|
pData->fDirCreateMode, pData->fCreateMode,
|
||||||
pData->bFailOnChown ? "yes" : "no"
|
pData->bFailOnChown ? "yes" : "no"
|
||||||
);
|
);
|
||||||
} else { /* regular file */
|
} else { /* regular file */
|
||||||
@ -615,6 +618,7 @@ ENDdoAction
|
|||||||
|
|
||||||
BEGINparseSelectorAct
|
BEGINparseSelectorAct
|
||||||
CODESTARTparseSelectorAct
|
CODESTARTparseSelectorAct
|
||||||
|
dbgprintf("XXX: dir create mode, enter omfile, 0%3.3o set in action\n", fDirCreateMode);
|
||||||
if(!(*p == '$' || *p == '?' || *p == '|' || *p == '/' || *p == '-'))
|
if(!(*p == '$' || *p == '?' || *p == '|' || *p == '/' || *p == '-'))
|
||||||
ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED);
|
ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED);
|
||||||
|
|
||||||
@ -676,6 +680,7 @@ CODESTARTparseSelectorAct
|
|||||||
pData->iDynaFileCacheSize = iDynaFileCacheSize;
|
pData->iDynaFileCacheSize = iDynaFileCacheSize;
|
||||||
pData->fCreateMode = fCreateMode;
|
pData->fCreateMode = fCreateMode;
|
||||||
pData->fDirCreateMode = fDirCreateMode;
|
pData->fDirCreateMode = fDirCreateMode;
|
||||||
|
dbgprintf("XXX: dir create mode 0%3.3o set in action\n", fDirCreateMode);
|
||||||
pData->bCreateDirs = bCreateDirs;
|
pData->bCreateDirs = bCreateDirs;
|
||||||
pData->bFailOnChown = bFailOnChown;
|
pData->bFailOnChown = bFailOnChown;
|
||||||
pData->fileUID = fileUID;
|
pData->fileUID = fileUID;
|
||||||
@ -761,6 +766,8 @@ ENDqueryEtryPt
|
|||||||
|
|
||||||
BEGINmodInit(File)
|
BEGINmodInit(File)
|
||||||
CODESTARTmodInit
|
CODESTARTmodInit
|
||||||
|
fDirCreateMode = 0700; /* for some reason, we need to do this write, else the variable always is 0 :S */
|
||||||
|
|
||||||
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
|
*ipIFVersProvided = CURR_MOD_IF_VERSION; /* we only support the current interface specification */
|
||||||
CODEmodInit_QueryRegCFSLineHdlr
|
CODEmodInit_QueryRegCFSLineHdlr
|
||||||
CHKiRet(objUse(errmsg, CORE_COMPONENT));
|
CHKiRet(objUse(errmsg, CORE_COMPONENT));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user