summaryrefslogtreecommitdiffstats
path: root/srUtils.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-07-17 13:16:44 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-07-17 13:16:44 +0000
commita768128281ea07a7f0b0a2ec773a40dbfecd1072 (patch)
tree1a4ae7f053dffe70f01338c6d4a35d3448387374 /srUtils.c
parent648370956683f65c8d60ba71ca158bf68d27db9a (diff)
downloadrsyslog-a768128281ea07a7f0b0a2ec773a40dbfecd1072.tar.gz
rsyslog-a768128281ea07a7f0b0a2ec773a40dbfecd1072.tar.xz
rsyslog-a768128281ea07a7f0b0a2ec773a40dbfecd1072.zip
added $FailOnChownFailure config parameter
Diffstat (limited to 'srUtils.c')
-rwxr-xr-xsrUtils.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/srUtils.c b/srUtils.c
index 2b819ca5..376a0d16 100755
--- a/srUtils.c
+++ b/srUtils.c
@@ -112,7 +112,7 @@ uchar *srUtilStrDup(uchar *pOld, size_t len)
* are to be created with.
*/
int makeFileParentDirs(uchar *szFile, size_t lenFile, mode_t mode,
- uid_t uid, gid_t gid)
+ uid_t uid, gid_t gid, int bFailOnChown)
{
uchar *p;
uchar *pszWork;
@@ -135,7 +135,11 @@ int makeFileParentDirs(uchar *szFile, size_t lenFile, mode_t mode,
if(uid != -1 || gid != -1) {
/* we need to set owner/group */
if(chown(pszWork, uid, gid) != 0)
- bErr = 1;
+ if(bFailOnChown)
+ bErr = 1;
+ /* silently ignore if configured
+ * to do so.
+ */
}
} else
bErr = 1;