---
name: "pam_canonicalize_user"
section: "8"
platform: "linux"
package: "pam"
version: "1.7.3-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/pam_canonicalize_user"
---

# pam\_canonicalize\_user(8)

Get user name and canonicalize it

## NAME

pam\_canonicalize\_user - Get user name and canonicalize it

## SYNOPSIS

**pam\_canonicalize\_user.so**

## DESCRIPTION

This PAM module uses the name of the user obtained via [**pam\_get\_user**(3)](/pam_get_user/3.md) as a key to query the password database, and replaces *PAM\_USER* with the *pw\_name* value that has been returned.

## OPTIONS

This module does not recognise any options.

## MODULE TYPES PROVIDED

Only the **auth** module type is provided.

## RETURN VALUES

PAM\_IGNORE

The user name was set successfully.

PAM\_USER\_UNKNOWN

The user was not found.

PAM\_SYSTEM\_ERR

The application did not supply neither a user name nor a conversation method.

PAM\_INCOMPLETE

The conversation method supplied by the application is waiting for an event.

PAM\_CONV\_ERR

The conversation method supplied by the application failed to obtain the user name.

PAM\_ABORT

Error resuming an old conversation.

PAM\_BUF\_ERR

Memory buffer error.

## EXAMPLES

Prepend the PAM auth stack with the following line to canonicalize the user name before the authentication:

```
        auth required pam_canonicalize_user.so
```

## SEE ALSO

[**pam\_get\_user**(3)](/pam_get_user/3.md), [**pam\_get\_item**(3)](/pam_get_item/3.md), [**pam\_set\_item**(3)](/pam_set_item/3.md), [**getpwnam**(3)](/getpwnam/3.md), [**pam.conf**(5)](/pam.conf/5.md), [**pam.d**(5)](/pam.d/5.md), [**pam**(8)](/pam/8.md)

## AUTHOR

pam\_canonicalize\_user was written by Dmitry V. Levin \<ldv@strace.io\>.
