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:
Rainer Gerhards 2009-10-02 15:48:37 +02:00
parent 724ba2b27f
commit 36bfaf6348

View File

@ -66,6 +66,7 @@
#include "errmsg.h"
#include "stream.h"
#include "unicode-helper.h"
#include "atomic.h"
MODULE_TYPE_OUTPUT
@ -152,12 +153,14 @@ CODESTARTdbgPrintInstInfo
"\tcreate directories: %s\n"
"\tfile 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",
pData->f_fname,
pData->iDynaFileCacheSize,
pData->bCreateDirs ? "yes" : "no",
pData->fileUID, pData->fileGID,
pData->dirUID, pData->dirGID,
pData->fDirCreateMode, pData->fCreateMode,
pData->bFailOnChown ? "yes" : "no"
);
} else { /* regular file */
@ -615,6 +618,7 @@ ENDdoAction
BEGINparseSelectorAct
CODESTARTparseSelectorAct
dbgprintf("XXX: dir create mode, enter omfile, 0%3.3o set in action\n", fDirCreateMode);
if(!(*p == '$' || *p == '?' || *p == '|' || *p == '/' || *p == '-'))
ABORT_FINALIZE(RS_RET_CONFLINE_UNPROCESSED);
@ -676,6 +680,7 @@ CODESTARTparseSelectorAct
pData->iDynaFileCacheSize = iDynaFileCacheSize;
pData->fCreateMode = fCreateMode;
pData->fDirCreateMode = fDirCreateMode;
dbgprintf("XXX: dir create mode 0%3.3o set in action\n", fDirCreateMode);
pData->bCreateDirs = bCreateDirs;
pData->bFailOnChown = bFailOnChown;
pData->fileUID = fileUID;
@ -761,6 +766,8 @@ ENDqueryEtryPt
BEGINmodInit(File)
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 */
CODEmodInit_QueryRegCFSLineHdlr
CHKiRet(objUse(errmsg, CORE_COMPONENT));