Skip to content

Commit

Permalink
document posix only
Browse files Browse the repository at this point in the history
  • Loading branch information
traylenator committed Mar 1, 2024
1 parent 3d833e7 commit 3a91ee4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3461,7 +3461,8 @@ One of more values to use as a custom seed. These will be combined with the host

Type: Ruby 4.x API

Given a username returns the user's entry from the `/etc/passwd` file.
>* Note:* The `stdlib::getpwnam` function will work only on platforms that support
`getpwnam`. Typically that is on POSIX like OSes and not Windows.

#### Examples

Expand All @@ -3479,7 +3480,8 @@ $uid = stdlib::getpwnam('steve')["uid"]

#### `stdlib::getpwnam(String $user)`

The stdlib::getpwnam function.
>* Note:* The `stdlib::getpwnam` function will work only on platforms that support
`getpwnam`. Typically that is on POSIX like OSes and not Windows.

Returns: `Hash` [Hash] For example {"name"=>"root", "passwd"=>"x", "uid"=>0, "gid"=>0, "gecos"=>"root", "dir"=>"/root", "shell"=>"/bin/bash"}

Expand Down
4 changes: 4 additions & 0 deletions lib/puppet/functions/stdlib/getpwnam.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
# @summary
# Given a username returns the user's entry from the `/etc/passwd` file.
#
# >* Note:* The `stdlib::getpwnam` function will work only on platforms that support
# `getpwnam`. Typically that is on POSIX like OSes and not Windows.
#
# @see getpwnam(3) https://man7.org/linux/man-pages/man3/getpwuid.3.html
#
Puppet::Functions.create_function(:'stdlib::getpwnam') do
# @param user
Expand Down

0 comments on commit 3a91ee4

Please sign in to comment.