19a10bb17SJohn Polstra /*- 29a10bb17SJohn Polstra * Copyright 1998 Juniper Networks, Inc. 39a10bb17SJohn Polstra * All rights reserved. 48d3978c1SDag-Erling Smørgrav * Copyright (c) 2001 Networks Associates Technologies, Inc. 58d3978c1SDag-Erling Smørgrav * All rights reserved. 68d3978c1SDag-Erling Smørgrav * 78d3978c1SDag-Erling Smørgrav * Portions of this software were developed for the FreeBSD Project by 88d3978c1SDag-Erling Smørgrav * ThinkSec AS and NAI Labs, the Security Research Division of Network 98d3978c1SDag-Erling Smørgrav * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 108d3978c1SDag-Erling Smørgrav * ("CBOSS"), as part of the DARPA CHATS research program. 119a10bb17SJohn Polstra * 129a10bb17SJohn Polstra * Redistribution and use in source and binary forms, with or without 139a10bb17SJohn Polstra * modification, are permitted provided that the following conditions 149a10bb17SJohn Polstra * are met: 159a10bb17SJohn Polstra * 1. Redistributions of source code must retain the above copyright 169a10bb17SJohn Polstra * notice, this list of conditions and the following disclaimer. 179a10bb17SJohn Polstra * 2. Redistributions in binary form must reproduce the above copyright 189a10bb17SJohn Polstra * notice, this list of conditions and the following disclaimer in the 199a10bb17SJohn Polstra * documentation and/or other materials provided with the distribution. 208d3978c1SDag-Erling Smørgrav * 3. The name of the author may not be used to endorse or promote 218d3978c1SDag-Erling Smørgrav * products derived from this software without specific prior written 228d3978c1SDag-Erling Smørgrav * permission. 239a10bb17SJohn Polstra * 249a10bb17SJohn Polstra * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 259a10bb17SJohn Polstra * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 269a10bb17SJohn Polstra * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 279a10bb17SJohn Polstra * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 289a10bb17SJohn Polstra * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 299a10bb17SJohn Polstra * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 309a10bb17SJohn Polstra * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 319a10bb17SJohn Polstra * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 329a10bb17SJohn Polstra * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 339a10bb17SJohn Polstra * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 349a10bb17SJohn Polstra * SUCH DAMAGE. 359a10bb17SJohn Polstra */ 369a10bb17SJohn Polstra 37ceaf33f5SMatthew Dillon #include <sys/cdefs.h> 38ceaf33f5SMatthew Dillon __FBSDID("$FreeBSD$"); 39ceaf33f5SMatthew Dillon 409a10bb17SJohn Polstra #include <sys/param.h> 419a10bb17SJohn Polstra #include <pwd.h> 429a10bb17SJohn Polstra #include <radlib.h> 439a10bb17SJohn Polstra #include <stdlib.h> 449a10bb17SJohn Polstra #include <string.h> 459a10bb17SJohn Polstra #include <syslog.h> 469a10bb17SJohn Polstra #include <unistd.h> 479a10bb17SJohn Polstra 489a10bb17SJohn Polstra #define PAM_SM_AUTH 498d3978c1SDag-Erling Smørgrav #define PAM_SM_ACCOUNT 508d3978c1SDag-Erling Smørgrav #define PAM_SM_SESSION 518d3978c1SDag-Erling Smørgrav #define PAM_SM_PASSWORD 528d3978c1SDag-Erling Smørgrav 539a10bb17SJohn Polstra #include <security/pam_modules.h> 549a10bb17SJohn Polstra 559a10bb17SJohn Polstra #include "pam_mod_misc.h" 569a10bb17SJohn Polstra 571642eb1aSMark Murray enum { PAM_OPT_CONF=PAM_OPT_STD_MAX, PAM_OPT_TEMPLATE_USER }; 581642eb1aSMark Murray 591642eb1aSMark Murray static struct opttab other_options[] = { 601642eb1aSMark Murray { "conf", PAM_OPT_CONF }, 611642eb1aSMark Murray { "template_user", PAM_OPT_TEMPLATE_USER }, 621642eb1aSMark Murray { NULL, 0 } 631642eb1aSMark Murray }; 641642eb1aSMark Murray 659a10bb17SJohn Polstra #define MAX_CHALLENGE_MSGS 10 669a10bb17SJohn Polstra #define PASSWORD_PROMPT "RADIUS password:" 679a10bb17SJohn Polstra 689a10bb17SJohn Polstra static int build_access_request(struct rad_handle *, const char *, 699a10bb17SJohn Polstra const char *, const void *, size_t); 709a10bb17SJohn Polstra static int do_accept(pam_handle_t *, struct rad_handle *); 719a10bb17SJohn Polstra static int do_challenge(pam_handle_t *, struct rad_handle *, 729a10bb17SJohn Polstra const char *); 739a10bb17SJohn Polstra 749a10bb17SJohn Polstra /* 759a10bb17SJohn Polstra * Construct an access request, but don't send it. Returns 0 on success, 769a10bb17SJohn Polstra * -1 on failure. 779a10bb17SJohn Polstra */ 789a10bb17SJohn Polstra static int 799a10bb17SJohn Polstra build_access_request(struct rad_handle *radh, const char *user, 809a10bb17SJohn Polstra const char *pass, const void *state, size_t state_len) 819a10bb17SJohn Polstra { 829a10bb17SJohn Polstra char host[MAXHOSTNAMELEN]; 839a10bb17SJohn Polstra 849a10bb17SJohn Polstra if (rad_create_request(radh, RAD_ACCESS_REQUEST) == -1) { 859a10bb17SJohn Polstra syslog(LOG_CRIT, "rad_create_request: %s", rad_strerror(radh)); 869a10bb17SJohn Polstra return -1; 879a10bb17SJohn Polstra } 889a10bb17SJohn Polstra if ((user != NULL && 899a10bb17SJohn Polstra rad_put_string(radh, RAD_USER_NAME, user) == -1) || 909a10bb17SJohn Polstra (pass != NULL && 919a10bb17SJohn Polstra rad_put_string(radh, RAD_USER_PASSWORD, pass) == -1) || 929a10bb17SJohn Polstra (gethostname(host, sizeof host) != -1 && 939a10bb17SJohn Polstra rad_put_string(radh, RAD_NAS_IDENTIFIER, host) == -1)) { 949a10bb17SJohn Polstra syslog(LOG_CRIT, "rad_put_string: %s", rad_strerror(radh)); 959a10bb17SJohn Polstra return -1; 969a10bb17SJohn Polstra } 979a10bb17SJohn Polstra if (state != NULL && rad_put_attr(radh, RAD_STATE, state, 989a10bb17SJohn Polstra state_len) == -1) { 999a10bb17SJohn Polstra syslog(LOG_CRIT, "rad_put_attr: %s", rad_strerror(radh)); 1009a10bb17SJohn Polstra return -1; 1019a10bb17SJohn Polstra } 1029a10bb17SJohn Polstra if (rad_put_int(radh, RAD_SERVICE_TYPE, RAD_AUTHENTICATE_ONLY) == -1) { 1039a10bb17SJohn Polstra syslog(LOG_CRIT, "rad_put_int: %s", rad_strerror(radh)); 1049a10bb17SJohn Polstra return -1; 1059a10bb17SJohn Polstra } 1069a10bb17SJohn Polstra return 0; 1079a10bb17SJohn Polstra } 1089a10bb17SJohn Polstra 1099a10bb17SJohn Polstra static int 1109a10bb17SJohn Polstra do_accept(pam_handle_t *pamh, struct rad_handle *radh) 1119a10bb17SJohn Polstra { 1129a10bb17SJohn Polstra int attrtype; 1139a10bb17SJohn Polstra const void *attrval; 1149a10bb17SJohn Polstra size_t attrlen; 1159a10bb17SJohn Polstra char *s; 1169a10bb17SJohn Polstra 1179a10bb17SJohn Polstra while ((attrtype = rad_get_attr(radh, &attrval, &attrlen)) > 0) { 1189a10bb17SJohn Polstra if (attrtype == RAD_USER_NAME) { 1199a10bb17SJohn Polstra s = rad_cvt_string(attrval, attrlen); 1209a10bb17SJohn Polstra if (s == NULL) { 1219a10bb17SJohn Polstra syslog(LOG_CRIT, 1229a10bb17SJohn Polstra "rad_cvt_string: out of memory"); 1239a10bb17SJohn Polstra return -1; 1249a10bb17SJohn Polstra } 1259a10bb17SJohn Polstra pam_set_item(pamh, PAM_USER, s); 1269a10bb17SJohn Polstra free(s); 1279a10bb17SJohn Polstra } 1289a10bb17SJohn Polstra } 1299a10bb17SJohn Polstra if (attrtype == -1) { 1309a10bb17SJohn Polstra syslog(LOG_CRIT, "rad_get_attr: %s", rad_strerror(radh)); 1319a10bb17SJohn Polstra return -1; 1329a10bb17SJohn Polstra } 1339a10bb17SJohn Polstra return 0; 1349a10bb17SJohn Polstra } 1359a10bb17SJohn Polstra 1369a10bb17SJohn Polstra static int 1379a10bb17SJohn Polstra do_challenge(pam_handle_t *pamh, struct rad_handle *radh, const char *user) 1389a10bb17SJohn Polstra { 1399a10bb17SJohn Polstra int retval; 1409a10bb17SJohn Polstra int attrtype; 1419a10bb17SJohn Polstra const void *attrval; 1429a10bb17SJohn Polstra size_t attrlen; 1439a10bb17SJohn Polstra const void *state; 1449a10bb17SJohn Polstra size_t statelen; 1459a10bb17SJohn Polstra struct pam_message msgs[MAX_CHALLENGE_MSGS]; 1469a10bb17SJohn Polstra const struct pam_message *msg_ptrs[MAX_CHALLENGE_MSGS]; 1479a10bb17SJohn Polstra struct pam_response *resp; 1489a10bb17SJohn Polstra int num_msgs; 1499a10bb17SJohn Polstra const void *item; 1509a10bb17SJohn Polstra const struct pam_conv *conv; 1519a10bb17SJohn Polstra 1529a10bb17SJohn Polstra state = NULL; 1539a10bb17SJohn Polstra statelen = 0; 1549a10bb17SJohn Polstra num_msgs = 0; 1559a10bb17SJohn Polstra while ((attrtype = rad_get_attr(radh, &attrval, &attrlen)) > 0) { 1569a10bb17SJohn Polstra switch (attrtype) { 1579a10bb17SJohn Polstra 1589a10bb17SJohn Polstra case RAD_STATE: 1599a10bb17SJohn Polstra state = attrval; 1609a10bb17SJohn Polstra statelen = attrlen; 1619a10bb17SJohn Polstra break; 1629a10bb17SJohn Polstra 1639a10bb17SJohn Polstra case RAD_REPLY_MESSAGE: 1649a10bb17SJohn Polstra if (num_msgs >= MAX_CHALLENGE_MSGS) { 1659a10bb17SJohn Polstra syslog(LOG_CRIT, 1669a10bb17SJohn Polstra "Too many RADIUS challenge messages"); 1679a10bb17SJohn Polstra return PAM_SERVICE_ERR; 1689a10bb17SJohn Polstra } 1699a10bb17SJohn Polstra msgs[num_msgs].msg = rad_cvt_string(attrval, attrlen); 1709a10bb17SJohn Polstra if (msgs[num_msgs].msg == NULL) { 1719a10bb17SJohn Polstra syslog(LOG_CRIT, 1729a10bb17SJohn Polstra "rad_cvt_string: out of memory"); 1739a10bb17SJohn Polstra return PAM_SERVICE_ERR; 1749a10bb17SJohn Polstra } 1759a10bb17SJohn Polstra msgs[num_msgs].msg_style = PAM_TEXT_INFO; 1769a10bb17SJohn Polstra msg_ptrs[num_msgs] = &msgs[num_msgs]; 1779a10bb17SJohn Polstra num_msgs++; 1789a10bb17SJohn Polstra break; 1799a10bb17SJohn Polstra } 1809a10bb17SJohn Polstra } 1819a10bb17SJohn Polstra if (attrtype == -1) { 1829a10bb17SJohn Polstra syslog(LOG_CRIT, "rad_get_attr: %s", rad_strerror(radh)); 1839a10bb17SJohn Polstra return PAM_SERVICE_ERR; 1849a10bb17SJohn Polstra } 1859a10bb17SJohn Polstra if (num_msgs == 0) { 1869a10bb17SJohn Polstra msgs[num_msgs].msg = strdup("(null RADIUS challenge): "); 1879a10bb17SJohn Polstra if (msgs[num_msgs].msg == NULL) { 1889a10bb17SJohn Polstra syslog(LOG_CRIT, "Out of memory"); 1899a10bb17SJohn Polstra return PAM_SERVICE_ERR; 1909a10bb17SJohn Polstra } 1919a10bb17SJohn Polstra msgs[num_msgs].msg_style = PAM_TEXT_INFO; 1929a10bb17SJohn Polstra msg_ptrs[num_msgs] = &msgs[num_msgs]; 1939a10bb17SJohn Polstra num_msgs++; 1949a10bb17SJohn Polstra } 1959a10bb17SJohn Polstra msgs[num_msgs-1].msg_style = PAM_PROMPT_ECHO_ON; 1969a10bb17SJohn Polstra if ((retval = pam_get_item(pamh, PAM_CONV, &item)) != PAM_SUCCESS) { 1979a10bb17SJohn Polstra syslog(LOG_CRIT, "do_challenge: cannot get PAM_CONV"); 1989a10bb17SJohn Polstra return retval; 1999a10bb17SJohn Polstra } 2009a10bb17SJohn Polstra conv = (const struct pam_conv *)item; 2019a10bb17SJohn Polstra if ((retval = conv->conv(num_msgs, msg_ptrs, &resp, 2029a10bb17SJohn Polstra conv->appdata_ptr)) != PAM_SUCCESS) 2039a10bb17SJohn Polstra return retval; 2049a10bb17SJohn Polstra if (build_access_request(radh, user, resp[num_msgs-1].resp, state, 2059a10bb17SJohn Polstra statelen) == -1) 2069a10bb17SJohn Polstra return PAM_SERVICE_ERR; 2079a10bb17SJohn Polstra memset(resp[num_msgs-1].resp, 0, strlen(resp[num_msgs-1].resp)); 2089a10bb17SJohn Polstra free(resp[num_msgs-1].resp); 2099a10bb17SJohn Polstra free(resp); 2109a10bb17SJohn Polstra while (num_msgs > 0) 2119a10bb17SJohn Polstra free((void *)msgs[--num_msgs].msg); 2129a10bb17SJohn Polstra return PAM_SUCCESS; 2139a10bb17SJohn Polstra } 2149a10bb17SJohn Polstra 2159a10bb17SJohn Polstra PAM_EXTERN int 2161642eb1aSMark Murray pam_sm_authenticate(pam_handle_t *pamh, int flags, int argc, const char **argv) 2179a10bb17SJohn Polstra { 2181642eb1aSMark Murray struct options options; 2199a10bb17SJohn Polstra struct rad_handle *radh; 2201642eb1aSMark Murray const char *user, *tmpuser, *pass; 2211642eb1aSMark Murray char *conf_file, *template_user; 2229a10bb17SJohn Polstra int retval; 2239a10bb17SJohn Polstra int e; 2249a10bb17SJohn Polstra 2251642eb1aSMark Murray pam_std_option(&options, other_options, argc, argv); 2269a10bb17SJohn Polstra 2271642eb1aSMark Murray PAM_LOG("Options processed"); 2289a10bb17SJohn Polstra 2291642eb1aSMark Murray conf_file = NULL; 2301642eb1aSMark Murray pam_test_option(&options, PAM_OPT_CONF, &conf_file); 2311642eb1aSMark Murray template_user = NULL; 2321642eb1aSMark Murray pam_test_option(&options, PAM_OPT_TEMPLATE_USER, &template_user); 2331642eb1aSMark Murray 2341642eb1aSMark Murray retval = pam_get_user(pamh, &user, NULL); 2351642eb1aSMark Murray if (retval != PAM_SUCCESS) 2361642eb1aSMark Murray PAM_RETURN(retval); 2371642eb1aSMark Murray 2381642eb1aSMark Murray PAM_LOG("Got user: %s", user); 2391642eb1aSMark Murray 2401642eb1aSMark Murray retval = pam_get_pass(pamh, &pass, PASSWORD_PROMPT, &options); 2411642eb1aSMark Murray if (retval != PAM_SUCCESS) 2421642eb1aSMark Murray PAM_RETURN(retval); 2431642eb1aSMark Murray 2441642eb1aSMark Murray PAM_LOG("Got password"); 2451642eb1aSMark Murray 2461642eb1aSMark Murray radh = rad_open(); 2471642eb1aSMark Murray if (radh == NULL) { 2489a10bb17SJohn Polstra syslog(LOG_CRIT, "rad_open failed"); 2491642eb1aSMark Murray PAM_RETURN(PAM_SERVICE_ERR); 2509a10bb17SJohn Polstra } 2511642eb1aSMark Murray 2521642eb1aSMark Murray PAM_LOG("Radius opened"); 2531642eb1aSMark Murray 2549a10bb17SJohn Polstra if (rad_config(radh, conf_file) == -1) { 2559a10bb17SJohn Polstra syslog(LOG_ALERT, "rad_config: %s", rad_strerror(radh)); 2569a10bb17SJohn Polstra rad_close(radh); 2571642eb1aSMark Murray PAM_RETURN(PAM_SERVICE_ERR); 2589a10bb17SJohn Polstra } 2591642eb1aSMark Murray 2601642eb1aSMark Murray PAM_LOG("Radius config file read"); 2611642eb1aSMark Murray 2629a10bb17SJohn Polstra if (build_access_request(radh, user, pass, NULL, 0) == -1) { 2639a10bb17SJohn Polstra rad_close(radh); 2641642eb1aSMark Murray PAM_RETURN(PAM_SERVICE_ERR); 2659a10bb17SJohn Polstra } 2661642eb1aSMark Murray 2671642eb1aSMark Murray PAM_LOG("Radius build access done"); 2681642eb1aSMark Murray 2699a10bb17SJohn Polstra for (;;) { 2709a10bb17SJohn Polstra switch (rad_send_request(radh)) { 2719a10bb17SJohn Polstra 2729a10bb17SJohn Polstra case RAD_ACCESS_ACCEPT: 2739a10bb17SJohn Polstra e = do_accept(pamh, radh); 2749a10bb17SJohn Polstra rad_close(radh); 2759a10bb17SJohn Polstra if (e == -1) 2761642eb1aSMark Murray PAM_RETURN(PAM_SERVICE_ERR); 2779a10bb17SJohn Polstra if (template_user != NULL) { 2781642eb1aSMark Murray 2791642eb1aSMark Murray PAM_LOG("Trying template user: %s", 2801642eb1aSMark Murray template_user); 2819a10bb17SJohn Polstra 2829a10bb17SJohn Polstra /* 2839a10bb17SJohn Polstra * If the given user name doesn't exist in 2849a10bb17SJohn Polstra * the local password database, change it 2859a10bb17SJohn Polstra * to the value given in the "template_user" 2869a10bb17SJohn Polstra * option. 2879a10bb17SJohn Polstra */ 2881642eb1aSMark Murray retval = pam_get_item(pamh, PAM_USER, 2891642eb1aSMark Murray (void *)&tmpuser); 2909a10bb17SJohn Polstra if (retval != PAM_SUCCESS) 2911642eb1aSMark Murray PAM_RETURN(retval); 2921642eb1aSMark Murray if (getpwnam(tmpuser) == NULL) { 2939a10bb17SJohn Polstra pam_set_item(pamh, PAM_USER, 2949a10bb17SJohn Polstra template_user); 2951642eb1aSMark Murray PAM_LOG("Using template user"); 2969a10bb17SJohn Polstra } 2971642eb1aSMark Murray 2981642eb1aSMark Murray } 2991642eb1aSMark Murray PAM_RETURN(PAM_SUCCESS); 3009a10bb17SJohn Polstra 3019a10bb17SJohn Polstra case RAD_ACCESS_REJECT: 3029a10bb17SJohn Polstra rad_close(radh); 30365550d9bSMark Murray PAM_VERBOSE_ERROR("Radius rejection"); 3041642eb1aSMark Murray PAM_RETURN(PAM_AUTH_ERR); 3059a10bb17SJohn Polstra 3069a10bb17SJohn Polstra case RAD_ACCESS_CHALLENGE: 3071642eb1aSMark Murray retval = do_challenge(pamh, radh, user); 3081642eb1aSMark Murray if (retval != PAM_SUCCESS) { 3099a10bb17SJohn Polstra rad_close(radh); 3101642eb1aSMark Murray PAM_RETURN(retval); 3119a10bb17SJohn Polstra } 3129a10bb17SJohn Polstra break; 3139a10bb17SJohn Polstra 3149a10bb17SJohn Polstra case -1: 3159a10bb17SJohn Polstra syslog(LOG_CRIT, "rad_send_request: %s", 3169a10bb17SJohn Polstra rad_strerror(radh)); 3179a10bb17SJohn Polstra rad_close(radh); 31865550d9bSMark Murray PAM_VERBOSE_ERROR("Radius failure"); 3191642eb1aSMark Murray PAM_RETURN(PAM_AUTHINFO_UNAVAIL); 3209a10bb17SJohn Polstra 3219a10bb17SJohn Polstra default: 3229a10bb17SJohn Polstra syslog(LOG_CRIT, 3239a10bb17SJohn Polstra "rad_send_request: unexpected return value"); 3249a10bb17SJohn Polstra rad_close(radh); 32565550d9bSMark Murray PAM_VERBOSE_ERROR("Radius error"); 3261642eb1aSMark Murray PAM_RETURN(PAM_SERVICE_ERR); 3279a10bb17SJohn Polstra } 3289a10bb17SJohn Polstra } 3299a10bb17SJohn Polstra } 3309a10bb17SJohn Polstra 3319a10bb17SJohn Polstra PAM_EXTERN int 3329a10bb17SJohn Polstra pam_sm_setcred(pam_handle_t *pamh, int flags, int argc, const char **argv) 3339a10bb17SJohn Polstra { 33465550d9bSMark Murray struct options options; 33565550d9bSMark Murray 33665550d9bSMark Murray pam_std_option(&options, NULL, argc, argv); 33765550d9bSMark Murray 33865550d9bSMark Murray PAM_LOG("Options processed"); 33965550d9bSMark Murray 34065550d9bSMark Murray PAM_RETURN(PAM_SUCCESS); 3419a10bb17SJohn Polstra } 3429294327dSJohn Polstra 3438d3978c1SDag-Erling Smørgrav PAM_EXTERN int 3448d3978c1SDag-Erling Smørgrav pam_sm_acct_mgmt(pam_handle_t *pamh, int flags, int argc ,const char **argv) 3458d3978c1SDag-Erling Smørgrav { 3468d3978c1SDag-Erling Smørgrav struct options options; 3478d3978c1SDag-Erling Smørgrav 3488d3978c1SDag-Erling Smørgrav pam_std_option(&options, NULL, argc, argv); 3498d3978c1SDag-Erling Smørgrav 3508d3978c1SDag-Erling Smørgrav PAM_LOG("Options processed"); 3518d3978c1SDag-Erling Smørgrav 3528d3978c1SDag-Erling Smørgrav PAM_RETURN(PAM_IGNORE); 3538d3978c1SDag-Erling Smørgrav } 3548d3978c1SDag-Erling Smørgrav 3558d3978c1SDag-Erling Smørgrav PAM_EXTERN int 3568d3978c1SDag-Erling Smørgrav pam_sm_chauthtok(pam_handle_t *pamh, int flags, int argc, const char **argv) 3578d3978c1SDag-Erling Smørgrav { 3588d3978c1SDag-Erling Smørgrav struct options options; 3598d3978c1SDag-Erling Smørgrav 3608d3978c1SDag-Erling Smørgrav pam_std_option(&options, NULL, argc, argv); 3618d3978c1SDag-Erling Smørgrav 3628d3978c1SDag-Erling Smørgrav PAM_LOG("Options processed"); 3638d3978c1SDag-Erling Smørgrav 3648d3978c1SDag-Erling Smørgrav PAM_RETURN(PAM_IGNORE); 3658d3978c1SDag-Erling Smørgrav } 3668d3978c1SDag-Erling Smørgrav 3678d3978c1SDag-Erling Smørgrav PAM_EXTERN int 3688d3978c1SDag-Erling Smørgrav pam_sm_open_session(pam_handle_t *pamh, int flags, int argc, const char **argv) 3698d3978c1SDag-Erling Smørgrav { 3708d3978c1SDag-Erling Smørgrav struct options options; 3718d3978c1SDag-Erling Smørgrav 3728d3978c1SDag-Erling Smørgrav pam_std_option(&options, NULL, argc, argv); 3738d3978c1SDag-Erling Smørgrav 3748d3978c1SDag-Erling Smørgrav PAM_LOG("Options processed"); 3758d3978c1SDag-Erling Smørgrav 3768d3978c1SDag-Erling Smørgrav PAM_RETURN(PAM_IGNORE); 3778d3978c1SDag-Erling Smørgrav } 3788d3978c1SDag-Erling Smørgrav 3798d3978c1SDag-Erling Smørgrav PAM_EXTERN int 3808d3978c1SDag-Erling Smørgrav pam_sm_close_session(pam_handle_t *pamh, int flags, int argc, const char **argv) 3818d3978c1SDag-Erling Smørgrav { 3828d3978c1SDag-Erling Smørgrav struct options options; 3838d3978c1SDag-Erling Smørgrav 3848d3978c1SDag-Erling Smørgrav pam_std_option(&options, NULL, argc, argv); 3858d3978c1SDag-Erling Smørgrav 3868d3978c1SDag-Erling Smørgrav PAM_LOG("Options processed"); 3878d3978c1SDag-Erling Smørgrav 3888d3978c1SDag-Erling Smørgrav PAM_RETURN(PAM_IGNORE); 3898d3978c1SDag-Erling Smørgrav } 3908d3978c1SDag-Erling Smørgrav 3919294327dSJohn Polstra PAM_MODULE_ENTRY("pam_radius"); 392