Forum: CFEngine Help
Subject: Re: Permissions and ownership with recursive copy_from
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,25291,25322#msg-25322

I'd be inclined to set preserve to false in the rcp body, and have separate 
permission setting code per-file/directory.  You could probably create a 2-D 
array and use something along the lines of:


vars:
  "perms"  string => "johnny";
  "perms"   string => "0644";
  "perms" string => "billy"
  "perms"  string => "0640"
  "files" slist => getindices("perms");

files:
 "$(files)" perms => mo("$(perls[$(files)])", "$(perls[$(files)])");


...Assuming "mo" is a perms body which takes mode and owner as parameters.  
Adding suport for groups and maybe an option for enabling/disabling recursion 
are excercises left for the reader. ;)

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to