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

findusers() and findgroups() functions

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Built-in functions
    • Labels:
      None

      Description

      From #7990

      I propose the new functions @findusers()@ and @findgroups()@ that return data containers with key = user/group name and value = all the details.

      • Should be able to find only local users
      • Should be able to find users or groups by any attribute
      • Need function specification proposal

      Example data container result for @findusers()@:

      <pre>
      {
      "nickanderson":

      { "uid": 1000, "gid": 1000, "comment": "Nick Anderson", "home": "/home/nickanderson" }

      ,
      "root":

      { "uid": 0, "gid": 0, "comment": "Root", "home": "/root" }

      }
      </pre>

      Example data container for @findgroups()@:
      <pre>
      {
      "nickanderson":

      { "gid": 1000, "members": ["nickanderson"], }

      ,
      "cdrom":

      { "gid": 24, "comment": "", "members": ["nickanderson", "tzz" ] }

      }
      </pre>

      (Also note than in @3.9@ you are able to say @getindices(findgroups())@ to get the keys of the data container, so @getgroups()@ will not be very useful generally if there is a @findgroups()@ function.)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                a10003 Eystein Maloy Stenberg
                Reporter:
                a10042 Nick Anderson
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:

                  Summary Panel