Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Aug 2014 11:34:55 +0000 (UTC)
From:      Dag-Erling Smørgrav <des@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r270397 - stable/9/lib/libpam/modules/pam_lastlog
Message-ID:  <201408231134.s7NBYtMV059898@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: des
Date: Sat Aug 23 11:34:55 2014
New Revision: 270397
URL: http://svnweb.freebsd.org/changeset/base/270397

Log:
  MFH (r269115): remove useless getpwnam() call

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

Modified: stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.c
==============================================================================
--- stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.c	Sat Aug 23 11:32:48 2014	(r270396)
+++ stable/9/lib/libpam/modules/pam_lastlog/pam_lastlog.c	Sat Aug 23 11:34:55 2014	(r270397)
@@ -49,7 +49,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/time.h>
 
 #include <paths.h>
-#include <pwd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
@@ -68,7 +67,6 @@ PAM_EXTERN int
 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_sm_open_session(pam_handle_t *pamh, 
 	pam_err = pam_get_user(pamh, &user, NULL);
 	if (pam_err != PAM_SUCCESS)
 		return (pam_err);
-	if (user == NULL || (pwd = getpwnam(user)) == NULL)
+	if (user == NULL)
 		return (PAM_SERVICE_ERR);
 	PAM_LOG("Got user: %s", user);
 



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