Skip to content

Commit cdf57e6

Browse files
authored
Merge pull request #3406 from victormlg/findlocalusers-documentation
Added documentation for findlocalusers() policy function
2 parents dd22b8c + 5c21b06 commit cdf57e6

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
layout: default
3+
title: findlocalusers
4+
published: true
5+
---
6+
7+
[%CFEngine_function_prototype(filter)%]
8+
9+
**Description:** Returns a data container of all local users with their attributes that are matching a filter. If no filter is specified, it will return all the local users.
10+
11+
[%CFEngine_function_attributes(filter)%]
12+
13+
The `filter` argument can be used to look up users with specific attributes that match values. The filter is a `"data"` container or `"slist"` comprised of pairs of attribute and value/regex pattern `{ "attribute1=value1", "attribute2=value2", ... }`.
14+
15+
The possible attributes are:
16+
* `name`: name
17+
* `uid`: user id
18+
* `gid`: group id
19+
* `gecos`: description
20+
* `dir`: path to home directory
21+
* `shell`: default shell
22+
23+
24+
25+
**Example:**
26+
27+
[%CFEngine_include_snippet(findlocalusers.cf, #\+begin_src cfengine3, .*end_src)%]
28+
29+
Output:
30+
31+
[%CFEngine_include_snippet(findlocalusers.cf, #\+begin_src\s+example_output\s*, .*end_src)%]
32+
33+
**Notes:**
34+
35+
* This function is currently only available on Unix-like systems.
36+
37+
**History:**
38+
39+
* Function added in 3.26.0.

0 commit comments

Comments
 (0)