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

# pam\_misc\_setenv(3)

BSD like PAM environment variable setting

## NAME

pam\_misc\_setenv - BSD like PAM environment variable setting

## SYNOPSIS

```
#include <security/pam_misc.h>
```

**int pam\_misc\_setenv(pam\_handle\_t \****pamh***, const char \****name***, const char \****value***, int** *readonly***);**

## DESCRIPTION

This function performs a task equivalent to [**pam\_putenv**(3)](/pam_putenv/3.md), its syntax is, however, more like the BSD style function; **setenv()**. The *name* and *value* are concatenated with an '=' to form a name=value and passed to **pam\_putenv()**. If, however, the PAM variable is already set, the replacement will only be applied if the last argument, *readonly*, is zero.

## SEE ALSO

[**pam\_putenv**(3)](/pam_putenv/3.md), [**pam**(8)](/pam/8.md)

## STANDARDS

The **pam\_misc\_setenv** function is part of the **libpam\_misc** Library and not defined in any standard.
