Uploaded image for project: 'CFEngine Community'
  1. CFEngine Community
  2. CFE-2334

'perm' should be applied only to new files in recursive copies

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Rejected
    • Priority: Medium
    • Resolution: Won't Do
    • Affects Version/s: 3.8.1
    • Fix Version/s: None
    • Component/s: cf-runagent
    • Labels:
      None

      Description

      When doing a recursive copy, permissions of already existing files in the target directory are changed.

      E.g.

      Unable to find source-code formatter for language: cfengine. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
           files:
       	    "/etc/profile.d"
       	    copy_from		=> copy("pub_cfinput/profile.d"),
       	    depth_search	=> recurse(1),
       	    perms		=> system_owned(0444);
      

      will change permissions of already existing files, which
      are not managed by cfengine:

           info: Updated '/etc/profile.d/00-no-bash_completion.sh' from source 'pub_cfinput/profile.d/00-no-bash_completion.sh' ...
           info: Object '/etc/profile.d/00-no-bash_completion.sh' had permission 0600, changed it to 0444
       
           info: Object '/etc/profile.d/less.sh' had permission 0644, changed it to 0444
           info: Object '/etc/profile.d/lang.sh' had permission 0644, changed it to 0444
      

      Although there are existing hacks like copying to a temporary location first, fixing perms there and copying into real destination with perms_cp(), this makes things very complicated and is unexpected and unwanted in nearly every case.

      It is a regresion from cfengine2 too,

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              a10003 Eystein Maloy Stenberg
              Reporter:
              ensc Enrico Scholz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: