svn commit: r272352 - stable/9/lib/libpam/modules/pam_login_access

Dag-Erling Smørgrav des at FreeBSD.org
Wed Oct 1 10:29:15 UTC 2014


Author: des
Date: Wed Oct  1 10:29:14 2014
New Revision: 272352
URL: https://svnweb.freebsd.org/changeset/base/272352

Log:
  MFH (r272280, r272281, r272348): allow use with null user and rhost
  
  PR:		83099 193927

Modified:
  stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c
Directory Properties:
  stable/9/lib/libpam/   (props changed)

Modified: stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c
==============================================================================
--- stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c	Wed Oct  1 10:26:43 2014	(r272351)
+++ stable/9/lib/libpam/modules/pam_login_access/pam_login_access.c	Wed Oct  1 10:29:14 2014	(r272352)
@@ -85,17 +85,21 @@ pam_sm_acct_mgmt(pam_handle_t *pamh, int
 		if (login_access(user, rhost) != 0)
 			return (PAM_SUCCESS);
 		PAM_VERBOSE_ERROR("%s is not allowed to log in from %s",
-		    user, rhost);
+		    (const char *)user, (const char *)rhost);
 	} else if (tty != NULL && *(const char *)tty != '\0') {
 		PAM_LOG("Checking login.access for user %s on tty %s",
 		    (const char *)user, (const char *)tty);
 		if (login_access(user, tty) != 0)
 			return (PAM_SUCCESS);
 		PAM_VERBOSE_ERROR("%s is not allowed to log in on %s",
-		    user, tty);
+		    (const char *)user, (const char *)tty);
 	} else {
-		PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required");
-		return (PAM_AUTHINFO_UNAVAIL);
+		PAM_LOG("Checking login.access for user %s",
+		    (const char *)user);
+		if (login_access(user, "***unknown***") != 0)
+			return (PAM_SUCCESS);
+		PAM_VERBOSE_ERROR("%s is not allowed to log in",
+		    (const char *)user);
 	}
 
 	return (PAM_AUTH_ERR);


More information about the svn-src-stable-9 mailing list