From fullermd@over-yonder.net  Thu May  1 09:08:21 2014
Return-Path: <fullermd@over-yonder.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id 2CD3CBD6
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 May 2014 09:08:21 +0000 (UTC)
Received: from thyme.infocus-llc.com (server.infocus-llc.com [206.156.254.44])
	(using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits))
	(Client CN "*.infocus-llc.com", Issuer "*.infocus-llc.com" (not verified))
	by mx1.freebsd.org (Postfix) with ESMTPS id 077C61205
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 May 2014 09:08:20 +0000 (UTC)
Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net [75.65.60.66])
	(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))
	(No client certificate requested)
	by thyme.infocus-llc.com (Postfix) with ESMTPSA id 04B9537B515
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  1 May 2014 04:08:20 -0500 (CDT)
Received: by draco.over-yonder.net (Postfix, from userid 100)
	id 3gK9jv42Tnz2VT; Thu,  1 May 2014 04:08:19 -0500 (CDT)
Message-Id: <3gK9jv42Tnz2VT@draco.over-yonder.net>
Date: Thu,  1 May 2014 04:08:19 -0500 (CDT)
From: Matthew D.Fuller <fullermd@over-yonder.net>
Reply-To: Matthew D.Fuller <fullermd@over-yonder.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [PATCH] Minor cosmetic cleanup of usr.sbin/pw/pwupd.c
X-Send-Pr-Version: 3.114
X-GNATS-Notify:

>Number:         189173
>Category:       bin
>Synopsis:       [PATCH] pw(8): Minor cosmetic cleanup of usr.sbin/pw/pwupd.c
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu May 01 09:10:00 UTC 2014
>Closed-Date:    
>Last-Modified:  Sun May 04 02:28:07 UTC 2014
>Originator:     Matthew D. Fuller
>Release:        FreeBSD 9.1-STABLE amd64
>Organization:
>Environment:
System: FreeBSD draco.over-yonder.net 9.1-STABLE FreeBSD 9.1-STABLE #0 r251584: Sun Jun 9 14:23:33 CDT 2013 root@draco.over-yonder.net:/usr/obj/usr/src/sys/DRACO amd64


	
>Description:
	- I don't think we care about portability of this code to versions
	  prior to 2.2 anymore.
	- Fix some broken indentation.

>How-To-Repeat:
	
>Fix:


Index: pwupd.c
===================================================================
--- pwupd.c	(revision 264991)
+++ pwupd.c	(working copy)
@@ -114,20 +114,15 @@
 
 	/*
 	 * First, let's check the see if the database is alright
-	 * Note: -C is only available in FreeBSD 2.2 and above
 	 */
-#ifdef HAVE_PWDB_C
 	rc = pwdb("-C", (char *)NULL);	/* Check only */
 	if (rc == 0) {
-#else
-	{				/* No -C */
-#endif
 		int pfd, tfd;
 		struct passwd *pw = NULL;
 		struct passwd *old_pw = NULL;
 
-	       	if (pwd != NULL)
-		       pw = pw_dup(pwd);
+		if (pwd != NULL)
+			pw = pw_dup(pwd);
 
 		if (user != NULL)
 			old_pw = GETPWNAM(user);

>Release-Note:
>Audit-Trail:

From: "Matthew D.Fuller" <fullermd@over-yonder.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:  
Subject: Re: bin/189173: [PATCH] Minor cosmetic cleanup of usr.sbin/pw/pwupd.c
Date: Thu, 1 May 2014 04:19:51 -0500

 Actually the #define's related to this can go away too; use of
 HAVE_PWDB_C is removed by this, and HAVE_PWDB_U is unused since
 r242349.
 
 
 Index: pwupd.c
 ===================================================================
 --- pwupd.c	(revision 264991)
 +++ pwupd.c	(working copy)
 @@ -45,9 +45,6 @@
  
  #include "pwupd.h"
  
 -#define HAVE_PWDB_C	1
 -#define	HAVE_PWDB_U	1
 -
  static char pathpwd[] = _PATH_PWD;
  static char * pwpath = pathpwd;
   
 @@ -114,20 +111,15 @@
  
  	/*
  	 * First, let's check the see if the database is alright
 -	 * Note: -C is only available in FreeBSD 2.2 and above
  	 */
 -#ifdef HAVE_PWDB_C
  	rc = pwdb("-C", (char *)NULL);	/* Check only */
  	if (rc == 0) {
 -#else
 -	{				/* No -C */
 -#endif
  		int pfd, tfd;
  		struct passwd *pw = NULL;
  		struct passwd *old_pw = NULL;
  
 -	       	if (pwd != NULL)
 -		       pw = pw_dup(pwd);
 +		if (pwd != NULL)
 +			pw = pw_dup(pwd);
  
  		if (user != NULL)
  			old_pw = GETPWNAM(user);
>Unformatted:
