OPENPAM_GET_FEATURE(3)
π OPENPAM_GET_FEATURE
okay so bestie, we're in section 3 of the Library Functions Manual today and the star of the show is openpam_get_feature β the little function that lets you peek at whether an optional feature is turned on or off. no cap, it's giving "settings app but make it C". π
β¨ NAME β¨
openpam_get_feature β query the state of an optional feature. literally just reading the vibe check of a feature, that's it, that's the whole job. π
πΈ SYNOPSIS πΈ
#include <sys/types.h>
#include <security/pam_appl.h>
#include <security/openpam.h>
int
openpam_get_feature(int feature, int *onoff);
π¦ DESCRIPTION π¦
So here's the tea: this function is experimental and may be modified or removed in a future release without prior warning. π not me warning you in advance β read that again, fr fr, because it means don't build your entire personality on it.
The openpam_get_feature() function stores the current state of the specified feature in the variable pointed to by its onoff argument. you pass in which feature you're curious about, you hand it a pointer, it fills the pointer in. slay. π
The following features are recognized:
OPENPAM_RESTRICT_SERVICE_NAMEβ disallow path separators in service names. this one is enabled by default β . disabling it allows the application to specify the path to the desired policy file directly (which, iykyk, is a whole vibe shift in how much you're trusting the caller).OPENPAM_VERIFY_POLICY_FILEβ verify the ownership and permissions of the policy file and the path leading up to it. enabled by default β . yes the whole path, not just the file, she's thorough like that. πOPENPAM_RESTRICT_MODULE_NAMEβ disallow path separators in module names. this one is disabled by default π. enabling it prevents the use of modules in non-standard locations. so like, custom module shopping spree = over.OPENPAM_VERIFY_MODULE_FILEβ verify the ownership and permissions of each loadable module and the path leading up to it. enabled by default β . same energy as the policy file check, just for modules. π«Ά
π RETURN VALUES π
The openpam_get_feature() function returns one of the following values:
PAM_SUCCESSβ success. we ate. β¨PAM_BAD_FEATUREβ unrecognized or restricted feature. π you asked about something that doesn't exist or that you're not allowed to poke at.
π SEE ALSO π
openpam_set_feature(3), pam(3), pam_strerror(3)
like obviously go read the setter if you wanna change stuff instead of just looking, and pam_strerror(3) to translate your error codes into actual words. π§
β STANDARDS β
The openpam_get_feature() function is an OpenPAM extension. so if you're looking for it in POSIX, bestie, it's not there. it's an OpenPAM original. π
πΈ AUTHORS πΈ
The openpam_get_feature() function and this manual page were developed by Dag-Erling SmΓΈrgrav <des@des.no>. legend behaviour, honestly. π«‘
okay that's the whole page!! go set some features, go read some features, live your truth. π₯
and that's a wrap, cuties β this page came to you courtesy of Debian, dated June 27, 2023 (yes, the exact same date as the original, I'm not out here inventing lore π). mwah, bye! π
π¦ where this page comes from
- freebsd 14.5: base 14.5
- nixos 26.05: openpam 20230627
- nixpkgs unstable: openpam 20230627
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms