Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Sep 2014 18:55:55 +0300
From:      Andriy Gapon <avg@FreeBSD.org>
To:        =?UTF-8?B?RGFnLUVybGluZyBTbcO4cmdyYXY=?= <des@des.no>
Cc:        Dimitry Andric <dim@FreeBSD.org>, FreeBSD stable <freebsd-stable@FreeBSD.org>
Subject:   Re: 10.1 BETA2 World - Breaks saslauthd
Message-ID:  <54258C8B.90709@FreeBSD.org>
In-Reply-To: <86ppeieu4t.fsf@nine.des.no>
References:  <b492e700f57a52e21f7755e6d01bd863.squirrel@www.tundraware.com> <3DA4B666-AB81-4F25-ABAE-DDC163F41E20@FreeBSD.org> <542430EB.1040804@tundraware.com> <CAKFCL4WX1gDJFLuJwvSKBX%2B0eKM4OwahXkDqEO84NqiY=eHDCw@mail.gmail.com> <86ppeieu4t.fsf@nine.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On 26/09/2014 10:08, Dag-Erling Smørgrav wrote:
> Brandon Allbery <allbery.b@gmail.com> writes:
>> To me the implication is that before the MFC, PAM had a potentially
>> quite severe security issue involving either incorrect fallback to a
>> default configuration or not correctly handling error returns from a
>> PAM stack --- either of which could result in unauthorized users being
>> permitted access.
> 
> No, that's a different issue.  This patch fixes a potential segfault
> (see http://bugs.freebsd.org/83099).  However, I have recevied reports
> that gdm (amongst others) actually want to be able to call
> pam_login_access without a host or tty.  The following patch makes that
> possible:
> 
> Index: lib/libpam/modules/pam_login_access/pam_login_access.c
> ===================================================================
> --- lib/libpam/modules/pam_login_access/pam_login_access.c	(revision 272101)
> +++ lib/libpam/modules/pam_login_access/pam_login_access.c	(working copy)
> @@ -94,8 +94,10 @@
>  		PAM_VERBOSE_ERROR("%s is not allowed to log in on %s",
>  		    user, tty);
>  	} else {
> -		PAM_VERBOSE_ERROR("PAM_RHOST or PAM_TTY required");
> -		return (PAM_AUTHINFO_UNAVAIL);
> +		PAM_LOG("Checking login.access for user %s", user);
> +		if (login_access(user, "***unknown***") != 0)
> +			return (PAM_SUCCESS);
> +		PAM_VERBOSE_ERROR("%s is not allowed to log in", user);
>  	}
>  
>  	return (PAM_AUTH_ERR);
> 
> Please test and report as soon as possible so I can get it into 10.

BTW, I think that chatted about this topic (no host, no tty) a long time ago and
back then you suggested that PAM_IGNORE could be returned for that combination.
 I do not know much about PAM, so I can't evaluate neither the current code nor
that hypothetical alternative.  So, this is just a reminder about some old ideas.

-- 
Andriy Gapon



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?54258C8B.90709>