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

# pam\_sm\_setcred(3)

service module implementation for pam\_setcred

## NAME

**pam\_sm\_setcred** – service module implementation for pam\_setcred

## LIBRARY

library “libpam”

## SYNOPSIS

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

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

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

*int*\

**pam\_sm\_setcred**(*pam\_handle\_t \*pamh*, *int flags*, *int argc*, *const char \*\*argv*);

## DESCRIPTION

The **pam\_sm\_setcred** function is the service module's implementation of the [pam\_setcred(3)](/pam_setcred/3.md) API function.

## RETURN VALUES

The **pam\_sm\_setcred** function returns one of the following values:

- \[PAM\_ABORT\]

  General failure.

- \[PAM\_BUF\_ERR\]

  Memory buffer error.

- \[PAM\_CONV\_ERR\]

  Conversation failure.

- \[PAM\_CRED\_ERR\]

  Failed to set user credentials.

- \[PAM\_CRED\_EXPIRED\]

  User credentials have expired.

- \[PAM\_CRED\_UNAVAIL\]

  Failed to retrieve user credentials.

- \[PAM\_IGNORE\]

  Ignore this module.

- \[PAM\_PERM\_DENIED\]

  Permission denied.

- \[PAM\_SERVICE\_ERR\]

  Error in service module.

- \[PAM\_SYSTEM\_ERR\]

  System error.

- \[PAM\_USER\_UNKNOWN\]

  Unknown user.

## SEE ALSO

[pam(3)](/pam/3.md), [pam\_setcred(3)](/pam_setcred/3.md), [pam\_strerror(3)](/pam_strerror/3.md)

## STANDARDS

*X/Open Single Sign-On Service (XSSO) - Pluggable Authentication Modules*, June 1997.

## AUTHORS

The **pam\_sm\_setcred** 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.
