diff options
author | Dmitry V. Levin <ldv@strace.io> | 2024-01-09 08:00:00 +0000 |
---|---|---|
committer | Dmitry V. Levin <ldv@strace.io> | 2024-01-13 08:00:00 +0000 |
commit | 1f1dff78cd1e58a26b302d138f75f51061acc12c (patch) | |
tree | 7ccc0f39886ba7b7b339cb075ff9827220557c97 /modules | |
parent | 66106ea2c9c20c1c5c05f919b363ae6ca3e7d5ca (diff) | |
download | pam-1f1dff78cd1e58a26b302d138f75f51061acc12c.tar.gz pam-1f1dff78cd1e58a26b302d138f75f51061acc12c.tar.bz2 pam-1f1dff78cd1e58a26b302d138f75f51061acc12c.zip |
pam_sepermit: do not call pam_sm_authenticate
Calling an exported function from the module is unsafe as there is no
guarantee that the function that will be actually called is the one that
is provided by the module.
* modules/pam_sepermit/pam_sepermit.c (pam_sm_authenticate): Rename
to pam_sepermit, add static qualifier, remove "flags" argument.
Update all callers. Add a new pam_sm_authenticate as a thin wrapper
around pam_sepermit.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_sepermit/pam_sepermit.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/modules/pam_sepermit/pam_sepermit.c b/modules/pam_sepermit/pam_sepermit.c index fca74beb..e8e1cf5b 100644 --- a/modules/pam_sepermit/pam_sepermit.c +++ b/modules/pam_sepermit/pam_sepermit.c @@ -371,9 +371,8 @@ sepermit_match(pam_handle_t *pamh, const char *cfgfile, const char *user, return -1; } -int -pam_sm_authenticate(pam_handle_t *pamh, int flags UNUSED, - int argc, const char **argv) +static int +pam_sepermit(pam_handle_t *pamh, int argc, const char **argv) { int i; int rv; @@ -460,8 +459,15 @@ pam_sm_setcred (pam_handle_t *pamh UNUSED, int flags UNUSED, } int -pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, - int argc, const char **argv) +pam_sm_authenticate(pam_handle_t *pamh, int flags UNUSED, + int argc, const char **argv) +{ + return pam_sepermit(pamh, argc, argv); +} + +int +pam_sm_acct_mgmt(pam_handle_t *pamh, int flags UNUSED, + int argc, const char **argv) { - return pam_sm_authenticate(pamh, flags, argc, argv); + return pam_sepermit(pamh, argc, argv); } |