---
name: "openpam_restore_cred"
section: "3"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/openpam_restore_cred"
---

# openpam\_restore\_cred(3)

restore credentials

## NAME

**openpam\_restore\_cred** – restore credentials

## SYNOPSIS

**#include \<sys/types.h\>**

**#include \<security/pam\_appl.h\>**

**#include \<security/openpam.h\>**

*int*\

**openpam\_restore\_cred**(*pam\_handle\_t \*pamh*);

## DESCRIPTION

The **openpam\_restore\_cred**() function restores the credentials saved by [openpam\_borrow\_cred(3)](/openpam_borrow_cred/3.md).

## RETURN VALUES

The **openpam\_restore\_cred**() function returns one of the following values:

- \[PAM\_SUCCESS\]

  Success.

- \[PAM\_NO\_MODULE\_DATA\]

  Module data not found.

- \[PAM\_SYSTEM\_ERR\]

  System error.

## SEE ALSO

[setegid(2)](/setegid/2.md), [seteuid(2)](/seteuid/2.md), [setgroups(2)](/setgroups/2.md), [openpam\_borrow\_cred(3)](/openpam_borrow_cred/3.md), [pam(3)](/pam/3.md), [pam\_strerror(3)](/pam_strerror/3.md)

## STANDARDS

The **openpam\_restore\_cred**() function is an OpenPAM extension.

## AUTHORS

The **openpam\_restore\_cred**() function and this manual page were developed for the FreeBSD Project by ThinkSec AS and Network Associates Laboratories, the Security Research Division of Network Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 (“CBOSS”), as part of the DARPA CHATS research program.

The OpenPAM library is maintained by Dag-Erling Smørgrav ⟨*des@des.dev*⟩.
