svn commit: r272351 - stable/10/lib/libpam/modules/pam_login_access

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


Author: des
Date: Wed Oct  1 10:26:43 2014
New Revision: 272351
URL: https://svnweb.freebsd.org/changeset/base/272351

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

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

Modified: stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c
==============================================================================
--- stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c	Wed Oct  1 08:26:51 2014	(r272350)
+++ stable/10/lib/libpam/modules/pam_login_access/pam_login_access.c	Wed Oct  1 10:26:43 2014	(r272351)
@@ -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-all mailing list