Bug 189173 - [PATCH] pw(8): Minor cosmetic cleanup of usr.sbin/pw/pwupd.c
Summary: [PATCH] pw(8): Minor cosmetic cleanup of usr.sbin/pw/pwupd.c
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 9.1-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Baptiste Daroussin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-01 10:10 UTC by fullermd
Modified: 2014-07-06 23:26 UTC (History)
0 users

See Also:


Attachments
file.diff (641 bytes, patch)
2014-05-01 10:10 UTC, fullermd
no flags Details | Diff
Updated patch (804 bytes, patch)
2014-06-10 10:06 UTC, fullermd
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description fullermd 2014-05-01 10:10:00 UTC
	- I don't think we care about portability of this code to versions
	  prior to 2.2 anymore.
	- Fix some broken indentation.
Comment 1 fullermd 2014-05-01 10:19:51 UTC
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);
Comment 2 fullermd 2014-06-10 10:06:33 UTC
Created attachment 143610 [details]
Updated patch

Upload updated patch as attachment.
Comment 3 commit-hook freebsd_committer freebsd_triage 2014-06-20 10:34:43 UTC
A commit references this bug:

Author: bapt
Date: Fri Jun 20 10:34:33 UTC 2014
New revision: 267669
URL: http://svnweb.freebsd.org/changeset/base/267669

Log:
  Removed compatibility with pre FreeBSD 2.2 pw_mkdb command
  Fix some broken indentattion

  PR:		189173
  Submitted by:	fullermd@over-yonder.net
  MFC after:	1 week

Changes:
  head/usr.sbin/pw/pwupd.c