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

cant change permission on file socket or owner

    XMLWordPrintable

    Details

    • Platform:
      Debian
    • Steps to reproduce:
      Manual steps provided

      Description

      I am trying to create a permission based promise for a socket file on one of our servers and looks like it cant open the file in safe_open function and safe_chmod and safe_chown always fails

      Output (When permission is different from promise):
      cf-agent -KI -f ./teste.cf
      2014-12-08T18:33:59-0200 error: /default/socket/files/'/root/testsocket'[0]: chmod failed on '/root/testsocket'. (chmod: No such device or address)

      Output (When uid is different from promise):
      2014-12-08T18:39:21-0200 info: /default/socket/files/'/root/testsocket'[0]: Owner of '/root/testsocket' was 0, setting to 450001
      2014-12-08T18:39:21-0200 info: /default/socket/files/'/root/testsocket'[0]: Cannot set ownership on file '/root/testsocket'. (chown: No such device or address)

      My test promise:

      body perms change_owner(p,u,g) {
          mode   => "${p}";
          owners => { "${u}" };
          groups => { "${g}" };
      }
      
      body common control
      {
          bundlesequence => { "socket" };
      }
      
      bundle agent socket
      {
          files:
              "/root/testsocket"
                  perms => change_owner("0775", "root", "root");
      }
      

      Our socket:

      # stat testsocket 
        File: `testsocket'
        Size: 0               Blocks: 0          IO Block: 4096   socket
      Device: fd00h/64768d    Inode: 38699027    Links: 1
      Access: (0755/srwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)
      Access: 2014-12-08 17:25:49.000000000 -0200
      Modify: 2014-12-08 17:25:49.000000000 -0200
      Change: 2014-12-08 17:29:21.000000000 -0200
      

        Attachments

        1. perm.cf
          1 kB
        2. perm.cf
          1 kB

          Issue Links

            Activity

              People

              • Assignee:
                a10003 Eystein Maloy Stenberg
                Reporter:
                deferraz Andre Ferraz
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Summary Panel