passwd file update functions
() functions allow a program to update
the system passwd database.
() function attempts to lock the passwd
database by creating the file /etc/ptmp
returns the file descriptor of that file. If
is greater than zero,
() will try multiple times to open
, waiting one second between tries. In
addition to being a lock file, /etc/ptmp
also hold the contents of the new passwd file. A different lock file can be
specified with pw_file(3)
must be called before
() function updates the passwd file from
the contents of /etc/ptmp
. If a
is specified, only the record for
the specified user will be updated. The
are specified by OR'ing the following
By default the secure and insecure password databases and the legacy password
are updated. You should finish
writing to and close the file descriptor returned by
() before calling
() fails and you do not wish to retry, you
should make sure to call pw_abort
() to clean up
the lock file.
() function aborts a passwd file update
by deleting /etc/ptmp
. The passwd database
() function returns -1 on error and sets
() function returns -1 if it is unable to
- Current password file.
- Legacy password file.
- Password lock file.
- Insecure password database file.
- Secure password database file.
- pw_lock() was called before
() may also fail and set
for any of the errors specified for the