---
name: "openpam_restore_cred"
section: "3"
platform: "macos"
package: "OpenPAM"
version: "35"
release: "macOS 26.5"
platforms: ["freebsd", "macos"]
url: "https://new.carta.tech/openpam_restore_cred"
---

# openpam\_restore\_cred(3)

restore credentials

## NAME

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

## LIBRARY

library “libpam”

## 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\_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.
