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

chmod permsions denied in files promise

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Fixed
    • Affects Version/s: 3.7.2
    • Fix Version/s: 3.7.3
    • Component/s: None
    • Labels:
      None
    • Environment:
      CentOS 7 x86_64

      Description

      The following policy fails on CentOS 7, but works on Debian. SElinx is NOT enabled. The files have NO extended attributes.

      body common control
      {
              bundlesequence => { "pre", "main", };
      }
      
      bundle agent pre {
              commands:
                      "/usr/bin/mkdir /tmp/test/";
                      "/usr/bin/touch /tmp/test/d";
                      "/usr/bin/chmod 600 /tmp/test/d";
      }
      
      bundle agent main {
              files:
                      "/tmp/test/d"
                              file_select => by_name( "d" ),
                              perms => mog( '755', 'daemon', 'daemon' );
      }
      
      body file_select by_name ( name ){
              leaf_name => { ${name} };
              file_result => 'leaf_name';
      }
      
      body perms mog ( mode, user, group ) {
              mode => ${mode};
              owners => { ${user} };
              groups => { ${group} };
      }
      
      [root@altair01 masterfiles]# cf-agent -Kf ./test.cf
         error: Finished command related to promiser '/usr/bin/mkdir /tmp/test/' -- an error occurred, returned 1
        notice: Q: ".../bin/mkdir /tmp": /usr/bin/mkdir: cannot create directory '/tmp/test/': File exists
         error: chmod failed on '/tmp/test/d'. (chmod: Permission denied)
         error: chmod failed on '/tmp/test/d'. (chmod: Permission denied)
      
      

        Attachments

          Activity

            People

            • Assignee:
              a10003 Eystein Maloy Stenberg
              Reporter:
              neilhwatson Neil Watson
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Summary Panel