pam_radius.c (90229) | pam_radius.c (91714) |
---|---|
1/*- 2 * Copyright 1998 Juniper Networks, Inc. 3 * All rights reserved. 4 * Copyright (c) 2001 Networks Associates Technologies, Inc. 5 * All rights reserved. 6 * 7 * Portions of this software were developed for the FreeBSD Project by 8 * ThinkSec AS and NAI Labs, the Security Research Division of Network --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright 1998 Juniper Networks, Inc. 3 * All rights reserved. 4 * Copyright (c) 2001 Networks Associates Technologies, Inc. 5 * All rights reserved. 6 * 7 * Portions of this software were developed for the FreeBSD Project by 8 * ThinkSec AS and NAI Labs, the Security Research Division of Network --- 21 unchanged lines hidden (view full) --- 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/lib/libpam/modules/pam_radius/pam_radius.c 90229 2002-02-05 06:08:26Z des $"); | 38__FBSDID("$FreeBSD: head/lib/libpam/modules/pam_radius/pam_radius.c 91714 2002-03-05 21:56:25Z des $"); |
39 40#include <sys/param.h> 41#include <pwd.h> 42#include <radlib.h> 43#include <stdlib.h> 44#include <string.h> 45#include <syslog.h> 46#include <unistd.h> --- 185 unchanged lines hidden (view full) --- 232 pam_test_option(&options, PAM_OPT_TEMPLATE_USER, &template_user); 233 234 retval = pam_get_user(pamh, &user, NULL); 235 if (retval != PAM_SUCCESS) 236 PAM_RETURN(retval); 237 238 PAM_LOG("Got user: %s", user); 239 | 39 40#include <sys/param.h> 41#include <pwd.h> 42#include <radlib.h> 43#include <stdlib.h> 44#include <string.h> 45#include <syslog.h> 46#include <unistd.h> --- 185 unchanged lines hidden (view full) --- 232 pam_test_option(&options, PAM_OPT_TEMPLATE_USER, &template_user); 233 234 retval = pam_get_user(pamh, &user, NULL); 235 if (retval != PAM_SUCCESS) 236 PAM_RETURN(retval); 237 238 PAM_LOG("Got user: %s", user); 239 |
240 retval = pam_get_pass(pamh, &pass, PASSWORD_PROMPT, &options); | 240 retval = pam_get_authtok(pamh, &pass, PASSWORD_PROMPT); |
241 if (retval != PAM_SUCCESS) 242 PAM_RETURN(retval); 243 244 PAM_LOG("Got password"); 245 246 radh = rad_open(); 247 if (radh == NULL) { 248 syslog(LOG_CRIT, "rad_open failed"); --- 31 unchanged lines hidden (view full) --- 280 template_user); 281 282 /* 283 * If the given user name doesn't exist in 284 * the local password database, change it 285 * to the value given in the "template_user" 286 * option. 287 */ | 241 if (retval != PAM_SUCCESS) 242 PAM_RETURN(retval); 243 244 PAM_LOG("Got password"); 245 246 radh = rad_open(); 247 if (radh == NULL) { 248 syslog(LOG_CRIT, "rad_open failed"); --- 31 unchanged lines hidden (view full) --- 280 template_user); 281 282 /* 283 * If the given user name doesn't exist in 284 * the local password database, change it 285 * to the value given in the "template_user" 286 * option. 287 */ |
288 retval = pam_get_item(pamh, PAM_USER, &tmpuser); | 288 retval = pam_get_item(pamh, PAM_USER, 289 (const void **)&tmpuser); |
289 if (retval != PAM_SUCCESS) 290 PAM_RETURN(retval); 291 if (getpwnam(tmpuser) == NULL) { 292 pam_set_item(pamh, PAM_USER, 293 template_user); 294 PAM_LOG("Using template user"); 295 } 296 --- 94 unchanged lines hidden --- | 290 if (retval != PAM_SUCCESS) 291 PAM_RETURN(retval); 292 if (getpwnam(tmpuser) == NULL) { 293 pam_set_item(pamh, PAM_USER, 294 template_user); 295 PAM_LOG("Using template user"); 296 } 297 --- 94 unchanged lines hidden --- |