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

rxdirs needs it's own complete example

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Done
    • Priority: (None)
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.15.5, 3.18.1, 3.19.0
    • Component/s: Documentation
    • Labels:
      None
    • Story Points:
      0

      Description

      rxdirs needs it's own complete example. It's seen in several places in the files type promise docs but there is no example illustrating it's behavior.

      Example illustrating rxdirs behavior
      bundle agent __main__
      # @brief Illustrating the behavior of rxdirs in perms bodies. Note, by default, when read is requested for a directory, execute is given as well.
      {
        vars:
            "example_dirs" slist => {
                                      "/tmp/rxdirs_example/rxdirs=default(true)-r",
                                      "/tmp/rxdirs_example/rxdirs=default(true)-rx",
                                      "/tmp/rxdirs_example/rxdirs=false-r",
                                      "/tmp/rxdirs_example/rxdirs=false-rx",
            };
      
        files:
            "$(example_dirs)/."
              create => "true";
      
            "/tmp/rxdirs_example/rxdirs=default(true)-r"
              perms => example:m( 600 );
      
            "/tmp/rxdirs_example/rxdirs=default(true)-rx"
              perms => example:m( 700 );
      
            "/tmp/rxdirs_example/rxdirs=false-r"
              perms => example:m_rxdirs_off( 600 );
      
            "/tmp/rxdirs_example/rxdirs=false-rx"
              perms => example:m_rxdirs_off( 700 );
      
        reports:
            "$(example_dirs) modeoct='$(with)'"
              with => filestat( $(example_dirs), modeoct );
      }
      
      body file control{ namespace => "example"; }
      
      body perms m(mode)
      # @brief Set the file mode
      # @param mode The new mode
      {
              mode   => "$(mode)";
      }
      body perms m_rxdirs_off(mode)
      # @brief Set the file mode, don't be clever and try to set +x on directory when +r is desired
      # @param mode The new mode
      {
              inherit_from => m( $(mode) );
              rxdirs => "false";
      }
      
      R: /tmp/rxdirs_example/rxdirs=default(true)-r modeoct='40700'
      R: /tmp/rxdirs_example/rxdirs=default(true)-rx modeoct='40700'
      R: /tmp/rxdirs_example/rxdirs=false-r modeoct='40600'
      R: /tmp/rxdirs_example/rxdirs=false-rx modeoct='40700'

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              a10042 Nick Anderson
              Reporter:
              a10042 Nick Anderson
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: