OPENPAM_GET_FEATURE(3)

πŸ“¦
version 14.5 Β· 2 versions
, in freebsd 14.5, nixos 26.05, nixpkgs unstable

πŸ’… 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