Forum: Cfengine Help
Subject: Perms set to 0 during copy
Author: bbomgardner
Link to topic: https://cfengine.com/forum/read.php?3,18716,18716#msg-18716
This code copies the contents of the directory and then sets the permissions on
the copied files to 0. If I don't request any perms, the files remain 600.
I tried setting the preserve option on/off in the remote_cp body but that
didn't change anything.
body common control
{
bundlesequence => { test1 };
}
bundle agent test1
{
files:
"/tmp/test"
copy_from =>
remote_cp("/srv/cfengine/master/test123","149.208.50.73"),
perms => og("sisp-us","users"),
depth_search => recurse("inf"),
action => immediate;
}
body copy_from remote_cp(from,server)
{
servers => { "$(server)" };
source => "$(from)";
compare => "mtime";
}
body perms og(u,g)
{
owners => { "$(u)" };
groups => { "$(g)" };
}
body action immediate
{
ifelapsed => "0";
}
body depth_search recurse(d)
{
depth => "$(d)";
xdev => "true";
}
momo:/var/cfengine # bin/cf-agent -If test1.cf
-> Copying from 149.208.50.73:/srv/cfengine/master/test123/file2
-> Owner of /tmp/test/file2 was 0, setting to 1001
-> Group of /tmp/test/file2 was 0, setting to 100
-> Object /tmp/test/file2 had permission 600, changed it to 0
-> Copying from 149.208.50.73:/srv/cfengine/master/test123/file1
-> Owner of /tmp/test/file1 was 0, setting to 1001
-> Group of /tmp/test/file1 was 0, setting to 100
-> Object /tmp/test/file1 had permission 600, changed it to 0
What is going on here? I feel pretty stupid because I know I'm missing
something obvious...
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine