diff options
author | des <des@FreeBSD.org> | 2002-01-21 16:19:38 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2002-01-21 16:19:38 +0000 |
commit | 99b518cd8be15a8078a9fe7958314af3dff0c021 (patch) | |
tree | 4c4b0568a272953dbfe147a945b410810bbb7109 /usr.bin/login/login.c | |
parent | 8d3eaf171b8426e26b2c400ab0af8e9100e9793f (diff) | |
download | FreeBSD-src-99b518cd8be15a8078a9fe7958314af3dff0c021.zip FreeBSD-src-99b518cd8be15a8078a9fe7958314af3dff0c021.tar.gz |
When running on a local terminal, set PAM_RHOST to the local hostname.
Sponsored by: DARPA, NAI Labs
Diffstat (limited to 'usr.bin/login/login.c')
-rw-r--r-- | usr.bin/login/login.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/usr.bin/login/login.c b/usr.bin/login/login.c index 59707b5..1dcd150 100644 --- a/usr.bin/login/login.c +++ b/usr.bin/login/login.c @@ -1,6 +1,13 @@ /*- * Copyright (c) 1980, 1987, 1988, 1991, 1993, 1994 * The Regents of the University of California. All rights reserved. + * Copyright (c) 2002 Networks Associates Technologies, Inc. + * All rights reserved. + * + * Portions of this software were developed for the FreeBSD Project by + * ThinkSec AS and NAI Labs, the Security Research Division of Network + * Associates, Inc. under DARPA/SPAWAR contract N66001-01-C-8035 + * ("CBOSS"), as part of the DARPA CHATS research program. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -763,8 +770,9 @@ auth_pam() pam_strerror(pamh, e)); return -1; } - if (hostname != NULL && - (e = pam_set_item(pamh, PAM_RHOST, full_hostname)) != PAM_SUCCESS) { + if (hostname == NULL) + gethostname(full_hostname, sizeof full_hostname); + if ((e = pam_set_item(pamh, PAM_RHOST, full_hostname)) != PAM_SUCCESS) { syslog(LOG_ERR, "pam_set_item(PAM_RHOST): %s", pam_strerror(pamh, e)); return -1; |