diff options
author | Thorsten Kukuk <kukuk@thkukuk.de> | 2006-01-22 15:40:58 +0000 |
---|---|---|
committer | Thorsten Kukuk <kukuk@thkukuk.de> | 2006-01-22 15:40:58 +0000 |
commit | a5c4da8d631c538490c1920689d590c19a60f1d6 (patch) | |
tree | 9e3a8eec690a10f484114a915e1aea21a6af0e25 /modules | |
parent | 5116bebb80ac7ee441c66b1a884d2653755dc4d9 (diff) | |
download | pam-a5c4da8d631c538490c1920689d590c19a60f1d6.tar.gz pam-a5c4da8d631c538490c1920689d590c19a60f1d6.tar.bz2 pam-a5c4da8d631c538490c1920689d590c19a60f1d6.zip |
Relevant BUGIDs: none
Purpose of commit: bugfix
Commit summary:
---------------
Fix infrastructure and compile errors for PAM_STATIC (static modules):
2006-01-22 Thorsten Kukuk <kukuk@thkukuk.de>
* modules/pam_succeed_if/pam_succeed_if.c (pam_sm_acct_mgmt):
Add support for static modules.
* modules/pam_xauth/pam_xauth.c: Likewise.
* libpam/pam_handlers.c (_pam_add_handler): Add pamh to
_pam_open_static_handler call.
* libpam/pam_static.c (_pam_open_static_handler): Add pamh
as argument.
* libpam/pam_private.h: Adjust prototype.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/pam_succeed_if/pam_succeed_if.c | 27 | ||||
-rw-r--r-- | modules/pam_xauth/pam_xauth.c | 17 |
2 files changed, 37 insertions, 7 deletions
diff --git a/modules/pam_succeed_if/pam_succeed_if.c b/modules/pam_succeed_if/pam_succeed_if.c index f84fdd3f..d343cae8 100644 --- a/modules/pam_succeed_if/pam_succeed_if.c +++ b/modules/pam_succeed_if/pam_succeed_if.c @@ -53,6 +53,10 @@ #include <pwd.h> #include <grp.h> #include <netdb.h> + +#define PAM_SM_AUTH +#define PAM_SM_ACCOUNT + #include <security/pam_modules.h> #include <security/pam_modutil.h> #include <security/pam_ext.h> @@ -313,21 +317,21 @@ evaluate(pam_handle_t *pamh, int debug, if (strcasecmp(qual, "innetgr") == 0) { const void *rhost; if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS) - rhost = NULL; + rhost = NULL; return evaluate_innetgr(rhost, pwd->pw_name, right); } /* (Rhost, user) is not in this group. */ if (strcasecmp(qual, "notinnetgr") == 0) { const void *rhost; if (pam_get_item(pamh, PAM_RHOST, &rhost) != PAM_SUCCESS) - rhost = NULL; + rhost = NULL; return evaluate_notinnetgr(rhost, pwd->pw_name, right); } /* Fail closed. */ return PAM_SERVICE_ERR; } -int +PAM_EXTERN int pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, int argc, const char **argv) { @@ -460,15 +464,28 @@ pam_sm_authenticate (pam_handle_t *pamh, int flags UNUSED, return ret; } -int +PAM_EXTERN int pam_sm_setcred(pam_handle_t *pamh UNUSED, int flags UNUSED, int argc UNUSED, const char **argv UNUSED) { return PAM_SUCCESS; } -int +PAM_EXTERN int pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc, const char **argv) { return pam_sm_authenticate(pamh, flags, argc, argv); } + +/* static module data */ +#ifdef PAM_STATIC +struct pam_module _pam_succeed_if_modstruct = { + "pam_succeed_if", + pam_sm_authenticate, + pam_sm_setcred, + pam_sm_acct_mgmt, + NULL, + NULL, + NULL +}; +#endif diff --git a/modules/pam_xauth/pam_xauth.c b/modules/pam_xauth/pam_xauth.c index 5376bd8b..3772bd06 100644 --- a/modules/pam_xauth/pam_xauth.c +++ b/modules/pam_xauth/pam_xauth.c @@ -33,8 +33,6 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* "$Id$" */ - #include "config.h" #include <sys/types.h> #include <sys/fsuid.h> @@ -52,6 +50,8 @@ #include <syslog.h> #include <unistd.h> +#define PAM_SM_SESSION + #include <security/pam_modules.h> #include <security/_pam_macros.h> #include <security/pam_modutil.h> @@ -665,3 +665,16 @@ pam_sm_close_session (pam_handle_t *pamh, int flags UNUSED, } return PAM_SUCCESS; } + +/* static module data */ +#ifdef PAM_STATIC +struct pam_module _pam_xauth_modstruct = { + "pam_xauth", + NULL, + NULL, + NULL, + pam_sm_open_session, + pam_sm_close_session, + NULL +}; +#endif |