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

# pam\_sm\_chauthtok(3)

service module implementation for pam\_chauthtok

## NAME

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

## SYNOPSIS

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

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

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

*int*\

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

## DESCRIPTION

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

When the application calls [pam\_chauthtok(3)](/pam_chauthtok/3.md), the service function is called twice, first with the PAM\_PRELIM\_CHECK flag set and then again with the PAM\_UPDATE\_AUTHTOK flag set.

## RETURN VALUES

The **pam\_sm\_chauthtok**() function returns one of the following values:

- \[PAM\_SUCCESS\]

  Success.

- \[PAM\_ABORT\]

  General failure.

- \[PAM\_AUTHTOK\_DISABLE\_AGING\]

  Authentication token aging disabled.

- \[PAM\_AUTHTOK\_ERR\]

  Authentication token failure.

- \[PAM\_AUTHTOK\_LOCK\_BUSY\]

  Authentication token lock busy.

- \[PAM\_AUTHTOK\_RECOVERY\_ERR\]

  Failed to recover old authentication token.

- \[PAM\_BUF\_ERR\]

  Memory buffer error.

- \[PAM\_CONV\_ERR\]

  Conversation failure.

- \[PAM\_IGNORE\]

  Ignore this module.

- \[PAM\_PERM\_DENIED\]

  Permission denied.

- \[PAM\_SERVICE\_ERR\]

  Error in service module.

- \[PAM\_SYSTEM\_ERR\]

  System error.

- \[PAM\_TRY\_AGAIN\]

  Try again.

## SEE ALSO

[pam(3)](/pam/3.md), [pam\_chauthtok(3)](/pam_chauthtok/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\_chauthtok**() 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*⟩.
