---
name: "openpam_get_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_get_feature"
---

# openpam\_get\_feature(3)

query the state of an optional feature

## NAME

**openpam\_get\_feature** – query the state of an optional feature

## SYNOPSIS

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

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

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

*int*\

**openpam\_get\_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\_get\_feature**() function stores the current state of the specified feature in the variable pointed to by its *onoff* argument.

The following features are recognized:

- OPENPAM\_RESTRICT\_SERVICE\_NAME

  Disallow path separators in service names. This feature is enabled by default. Disabling it allows the application to specify the path to the desired policy file directly.

- OPENPAM\_VERIFY\_POLICY\_FILE

  Verify the ownership and permissions of the policy file and the path leading up to it. This feature is enabled by default.

- OPENPAM\_RESTRICT\_MODULE\_NAME

  Disallow path separators in module names. This feature is disabled by default. Enabling it prevents the use of modules in non-standard locations.

- OPENPAM\_VERIFY\_MODULE\_FILE

  Verify the ownership and permissions of each loadable module and the path leading up to it. This feature is enabled by default.

## RETURN VALUES

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

- \[PAM\_SUCCESS\]

  Success.

- \[PAM\_BAD\_FEATURE\]

  Unrecognized or restricted feature.

## SEE ALSO

[openpam\_set\_feature(3)](/openpam_set_feature/3.md), [pam(3)](/pam/3.md), [pam\_strerror(3)](/pam_strerror/3.md)

## STANDARDS

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

## AUTHORS

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