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

# openpam\_set\_feature(3)

enable or disable an optional feature

## NAME

**openpam\_set\_feature** – enable or disable an optional feature

## SYNOPSIS

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

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

**#include \<security/openpam.h\>**

*int*\

**openpam\_set\_feature**(*int feature*, *int onoff*);

## DESCRIPTION

This function is experimental and may be modified or removed in a future release without prior warning.

The **openpam\_set\_feature**() function sets the state of the specified feature to the value specified by the *onoff* argument. See [openpam\_get\_feature(3)](/openpam_get_feature/3.md) for a list of recognized features.

## RETURN VALUES

The **openpam\_set\_feature**() function returns one of the following values:

- \[PAM\_SUCCESS\]

  Success.

- \[PAM\_BAD\_FEATURE\]

  Unrecognized or restricted feature.

## SEE ALSO

[openpam\_get\_feature(3)](/openpam_get_feature/3.md), [pam(3)](/pam/3.md), [pam\_strerror(3)](/pam_strerror/3.md)

## STANDARDS

The **openpam\_set\_feature**() function is an OpenPAM extension.

## AUTHORS

The **openpam\_set\_feature**() function and this manual page were developed by Dag-Erling Smørgrav ⟨*des@des.dev*⟩.
