[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: editfiles AutoCreate options
From: |
Chris Edillon |
Subject: |
Re: editfiles AutoCreate options |
Date: |
Thu, 30 Jan 2003 00:57:55 -0400 (GMT+4) |
On Thu, 30 Jan 2003, Jamie Wilkinson wrote:
> Quoting Chris Edillon <jce@zot.com>:
>
> > there is a Umask action which you should be able to set a per-edit
> > umask with autocreate:
> >
> > editfiles:
> > any::
> > { /tmp/foo
> > Umask "027"
>
> Oh, cool. Thanks :-)
>
of course, now that i actually try it on my machine, i find
that it doesn't seem to work for me. from the debug output it
looks as if cfagent tries to set the umask, but then goes ahead
and ignores it:
DoEditFile(/tmp/foo)
IgnoredOrExcluded(/tmp/foo)
GetLock(editfile,_tmp_foo,time=1043902665), ExpireAfter=120, IfElapsed=1
GetLastLock()
PutLock(last.cfagent_conf.100.clea.editfile._tmp_foo)
Unable to delete lock
[last.cfagent_conf.100.clea.editfile._tmp_foo]: DB_NOTFOUND: No matching
key/data pair found
CheckOldLock(lock.cfagent_conf.clea.editfile._tmp_foo)
Unable to find lock data lock.cfagent_conf.clea.editfile._tmp_foo
SetLock(lock.cfagent_conf.clea.editfile._tmp_foo)
PutLock(lock.cfagent_conf.clea.editfile._tmp_foo)
Unable to delete lock
[lock.cfagent_conf.clea.editfile._tmp_foo]: DB_NOTFOUND: No matching
key/data pair found
(Setting umask to 77)
cfengine:clea: Creating file /tmp/foo, mode 644
Begin editing /tmp/foo
Edit action: AutoCreate
Edit action: Umask
Edit action: AppendIfNoSuchLine
Appending [foo]
End editing /tmp/foo
/tmp/foo gets created, but mode 0644. in CheckEditSwitches()
in src/edittools.c, it looks like the mode is hardcoded to
0644 when the file is created. unfortunately, i'm not enough
of a c programmer to try fixing it... anyone else? this is
both in cfengine 2.0.4 and cfengine 2.0.5pre2.
chris