summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2003-04-30 00:44:05 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2003-04-30 00:44:05 +0000
commitccd703cfe46dd618f8567fb8014624dac903498c (patch)
treeddfe4bbdabb2f5dcd1eb53956ec434e9c1decf19
parent8ba20a48bd70ea00df3b2c827e3acc1b427bf547 (diff)
Notes
-rw-r--r--lib/libpam/modules/pam_lastlog/pam_lastlog.c4
-rw-r--r--lib/libpam/modules/pam_login_access/pam_login_access.c2
-rw-r--r--lib/libpam/modules/pam_opieaccess/pam_opieaccess.c2
-rw-r--r--lib/libpam/modules/pam_unix/pam_unix.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/lib/libpam/modules/pam_lastlog/pam_lastlog.c b/lib/libpam/modules/pam_lastlog/pam_lastlog.c
index 66f61d3a3b26..200f48906fda 100644
--- a/lib/libpam/modules/pam_lastlog/pam_lastlog.c
+++ b/lib/libpam/modules/pam_lastlog/pam_lastlog.c
@@ -129,7 +129,7 @@ pam_sm_open_session(pam_handle_t *pamh, int flags,
/* note: does not need to be NUL-terminated */
strncpy(ll.ll_line, tty, sizeof(ll.ll_line));
- if (rhost != NULL)
+ if (rhost != NULL && *rhost != '\0')
/* note: does not need to be NUL-terminated */
strncpy(ll.ll_host, rhost, sizeof(ll.ll_host));
@@ -145,7 +145,7 @@ pam_sm_open_session(pam_handle_t *pamh, int flags,
utmp.ut_time = time(NULL);
/* note: does not need to be NUL-terminated */
strncpy(utmp.ut_name, user, sizeof(utmp.ut_name));
- if (rhost != NULL)
+ if (rhost != NULL && *rhost != '\0')
strncpy(utmp.ut_host, rhost, sizeof(utmp.ut_host));
(void)strncpy(utmp.ut_line, tty, sizeof(utmp.ut_line));
login(&utmp);
diff --git a/lib/libpam/modules/pam_login_access/pam_login_access.c b/lib/libpam/modules/pam_login_access/pam_login_access.c
index 8f8ac546e2e4..f41326bc4b54 100644
--- a/lib/libpam/modules/pam_login_access/pam_login_access.c
+++ b/lib/libpam/modules/pam_login_access/pam_login_access.c
@@ -79,7 +79,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused,
gethostname(hostname, sizeof hostname);
- if (rhost == NULL) {
+ if (rhost == NULL || *rhost == '\0') {
PAM_LOG("Checking login.access for user %s on tty %s",
user, tty);
if (login_access(user, tty) != 0)
diff --git a/lib/libpam/modules/pam_opieaccess/pam_opieaccess.c b/lib/libpam/modules/pam_opieaccess/pam_opieaccess.c
index 66ad399f6239..61a97bfc41a8 100644
--- a/lib/libpam/modules/pam_opieaccess/pam_opieaccess.c
+++ b/lib/libpam/modules/pam_opieaccess/pam_opieaccess.c
@@ -73,7 +73,7 @@ pam_sm_authenticate(pam_handle_t *pamh, int flags __unused,
r = pam_get_item(pamh, PAM_RHOST, (const void **)&rhost);
if (r != PAM_SUCCESS)
return (r);
- if (rhost == NULL)
+ if (rhost == NULL || *rhost == '\0')
rhost = openpam_get_option(pamh, "allow_local") ?
"" : "localhost";
diff --git a/lib/libpam/modules/pam_unix/pam_unix.c b/lib/libpam/modules/pam_unix/pam_unix.c
index afceb0eb517b..28b9c17e10ea 100644
--- a/lib/libpam/modules/pam_unix/pam_unix.c
+++ b/lib/libpam/modules/pam_unix/pam_unix.c
@@ -246,7 +246,7 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int flags __unused,
* PAM_NEW_AUTHTOK_REQD.
*/
- if (rhost) {
+ if (rhost && *rhost) {
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
if (getaddrinfo(rhost, NULL, &hints, &res) == 0) {