diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-02 15:48:37 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-10-02 15:48:37 +0200 |
commit | 36bfaf63485a444d58ca359191377b6694720a37 (patch) | |
tree | 01adbbd7e230f2be9b73c0ed8e640af1a83d6ae5 | |
parent | 724ba2b27f4a2c583b3e257e33a2f0b4b9649ef1 (diff) | |
download | rsyslog-36bfaf63485a444d58ca359191377b6694720a37.tar.gz rsyslog-36bfaf63485a444d58ca359191377b6694720a37.tar.xz rsyslog-36bfaf63485a444d58ca359191377b6694720a37.zip |
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.
-rw-r--r-- | tools/omfile.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/omfile.c b/tools/omfile.c index bb12b4b6..c938f18c 100644 --- a/tools/omfile.c +++ b/tools/omfile.c @@ -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)); |