Date: Thu, 24 Jul 2014 08:27:20 -0700 From: Arthur Mesh <amesh@juniper.net> To: Dag-Erling Smorgrav <des@des.no> Cc: arch@freebsd.org Subject: Re: pam_lastlog Message-ID: <20140724152720.GU57013@juniper.net> In-Reply-To: <86iomnt2i6.fsf@nine.des.no> References: <20140723174211.GQ57013@juniper.net> <86iomnt2i6.fsf@nine.des.no>
next in thread | previous in thread | raw e-mail | index | archive | help
--SvF6CGw9fzJC4Rcx
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
On Thu, Jul 24, 2014 at 01:33:37PM +0200, Dag-Erling Smorgrav wrote:
> Arthur Mesh <amesh@juniper.net> writes:
> > Here is a proposed change where that adds a knob to disable this lookup:
>=20
> Why not just remove it altogether?
Here is a diff to remove it altogether:
Index: lib/libpam/modules/pam_lastlog/pam_lastlog.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- lib/libpam/modules/pam_lastlog/pam_lastlog.c (revision 269064)
+++ lib/libpam/modules/pam_lastlog/pam_lastlog.c (working copy)
@@ -49,7 +49,6 @@
#include <sys/time.h>
=20
#include <paths.h>
-#include <pwd.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
@@ -68,7 +67,6 @@
pam_sm_open_session(pam_handle_t *pamh, int flags,
int argc __unused, const char *argv[] __unused)
{
- struct passwd *pwd;
struct utmpx *utx, utl;
time_t t;
const char *user;
@@ -79,7 +77,7 @@
pam_err =3D pam_get_user(pamh, &user, NULL);
if (pam_err !=3D PAM_SUCCESS)
return (pam_err);
- if (user =3D=3D NULL || (pwd =3D getpwnam(user)) =3D=3D NULL)
+ if (user =3D=3D NULL)
return (PAM_SERVICE_ERR);
PAM_LOG("Got user: %s", user);
=20
--=20
Arthur Mesh <amesh@juniper.net>
Juniper Networks
+1 408 936-4968
--SvF6CGw9fzJC4Rcx
Content-Type: application/pgp-signature
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQGcBAEBCAAGBQJT0SXYAAoJEO/ZUtudxDntCq0L/ia4j8A2Lv4vIKotyCho2YJK
0ouJ3UiOhHalp/dAYPFfwRFBsSJ+w/Vk0C4eoCG39G9l9fyKBAxIipZCfgh7GL96
/eSMCBWiI1JopePfKeAeX+cEjHNGQwBeGkvzHau22Ev+wP2Sb1ByDVVs1ONhhUBU
2vUp9X0Q90sFbWXziEJ7GdYm5LHrwENaycXktDYIJRjDPP4sCFlI+FtvJl/IuJ0a
tQB1dvrDLi5N7UwG7k8DPiZCk7ApT9LXBOJO4cR49BIkowUFZ1IHfZqaIEi4spci
fmMLuy+2LF/40j7yhjST7cqN5i0BhAd5Vj9K8Eani9Z12Uoowd0ugkD7RSYHOH/S
d/PV3/A1MXexju1WUDBVgqR5NVGkgsoc38bqQgoxxaXxniirctTQbA0w3KnNNvVR
CyiHv0xD9h8Jk8P5c4OaswOobW+4FZdXeMKdMrIyfy0crawXbqgwqE2P7VQO2hbv
2gcU6qbcckjvpkuvPnXvy4dPzMsFa+/6P8otb13ofw==
=V+kI
-----END PGP SIGNATURE-----
--SvF6CGw9fzJC4Rcx--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140724152720.GU57013>
