Neil. You are correct that this option was not implemented. The default value
of all
boolean type /true/false options is always false, so preserving original perms
should not
be the default behaviour. I have patched svn to fix this.
Neil Watson wrote:
> Here is a self contained example.
>
> ######################
> body common control {
> bundlesequence => { "test" };
> }
>
> bundle common g {
> classes:
>
> "all" expression => "any";
> }
>
> bundle agent test {
>
> files:
>
> "/tmp/foobar"
> copy_from => local_cp("/tmp/src-foobar"),
> comment => "check contents only";
>
> reports:
>
> all::
> }
> body copy_from local_cp(from)
> {
> source => "$(from)";
> compare => "digest";
> }
>
> Target and source files:
>
> -rw------- 1 neil neil 9 2010-01-05 20:07 /tmp/foobar
> -rw-r--r-- 1 neil neil 9 2010-01-05 20:08 /tmp/src-foobar
>
> Both files are currently identical in contents but not permissions.
> However, since the files promise makes no promise about permissions I
> expect it to do nothing.
>
> cf-agent -KnIf ./test.cf
> -> Object /tmp/foobar had permission 600, changed it to 644
>
> It would seem that the agent assumes that the source file has the
> correct permissions. There is something called 'preserve' that "Whether
> or not the copy preserves the permissions on the source files." So is
> this set to true by default? Let's try by adding
> preserve => "false";
> to our body and retry.
>
> cf-agent -KnIf ./test.cf
> -> Object /tmp/foobar had permission 600, changed it to 644
>
> For completeness I'll try setting preserve to true.
>
> cf-agent -KnIf ./test.cf
> -> Object /tmp/foobar had permission 600, changed it to 644
>
> No difference.
>
> Why is the agent trying to change permissions? Is this expected
> behaviour? Is this desired behaviour?
>
> Sincerely,
--
Mark Burgess
-------------------------------------------------
Professor of Network and System Administration
Oslo University College, Norway
Personal Web: http://www.iu.hio.no/~mark
Office Telf : +47 22453272
-------------------------------------------------
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine