luaposix 33.4.0 Reference

# Module `posix.pwd`

Password Database Operations.

Query the system password database.

## Functions

endpwent () | Release password database resources.
getpwent () | Fetch next password entry.
getpwnam (name) | Fetch named user.
getpwuid (uid) | Fetch password entry with given user id.
setpwent () | Rewind next getpwent back to start of database.

## Tables

PosixPasswd | Password record.

## Functions

endpwent ()
  Release password database resources.

  ### See also:

  getpwent
getpwent ()
  Fetch next password entry.

  ### Returns:

  PosixPasswd next password record

  ### See also:

  endpwent

  ### Usage:

        t = P.getpwent ()
        while t ~= nil do
          process (t)
          t = P.getpwent ()
        end
        P.endpwent ()

getpwnam (name)
  Fetch named user.

  ### Parameters:

  - name string user name

  ### Returns:

  PosixPasswd passwd record for name

  ### Usage:

      t = P.getpwnam "root"

getpwuid (uid)
  Fetch password entry with given user id.

  ### Parameters:

  - uid int user id

  ### Returns:

  PosixPasswd passwd record for uid

  ### Usage:

      t = P.getpwuid (0)

setpwent ()
  Rewind next getpwent back to start of database.

  ### See also:

  getpwent

## Tables

PosixPasswd
  Password record.

  ### Fields:

  - pw_name string user's login name
  - pw_uid int unique user id
  - pw_gid int user's default group id
  - pw_dir string initial working directory
  - pw_shell string user's login shell path

generated by LDoc 1.4.3 Last updated 2016-02-27 14:10:34