Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2018 15:17:24 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r336762 - head/usr.sbin/pw
Message-ID:  <201807271517.w6RFHOB0016120@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Fri Jul 27 15:17:24 2018
New Revision: 336762
URL: https://svnweb.freebsd.org/changeset/base/336762

Log:
  Remove some code that's no longer needed because it's now part of pw_scan(3).
  It was also leading to segfaults; pw can be NULL when control reaches these
  lines now, because of the way my previous change restructured the loops.
  
  Reported by:	lwhsu@

Modified:
  head/usr.sbin/pw/pw_vpw.c

Modified: head/usr.sbin/pw/pw_vpw.c
==============================================================================
--- head/usr.sbin/pw/pw_vpw.c	Fri Jul 27 13:49:17 2018	(r336761)
+++ head/usr.sbin/pw/pw_vpw.c	Fri Jul 27 15:17:24 2018	(r336762)
@@ -113,18 +113,6 @@ vnextpwent(char const *nam, uid_t uid, int doclose)
 	}
 	free(line);
 
-	/*
-	 * If we read the non-master passwd, some fields may not have been
-	 * populated.  Clean them up so that the output looks the same as that
-	 * generated using getpwnam() which also inits them to these values.
-	 */
-	if (!(pw->pw_fields & _PWF_CLASS))
-		pw->pw_class = "";
-	if (!(pw->pw_fields & _PWF_CHANGE))
-		pw->pw_change = 0;
-	if (!(pw->pw_fields & _PWF_EXPIRE))
-		pw->pw_expire = 0;
-
 	return (pw);
 }
 



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