Module Name:    src
Committed By:   bouyer
Date:           Tue Mar 24 21:33:59 UTC 2009

Modified Files:
        src/sbin/fsck_ext2fs [netbsd-4]: fsck.h fsck_ext2fs.8 inode.c main.c
        src/sbin/fsck_ffs [netbsd-4]: fsck.h fsck_ffs.8 inode.c main.c
        src/sbin/fsck_lfs [netbsd-4]: fsck.h fsck_lfs.8 inode.c main.c

Log Message:
Pull up following revision(s) (requested by manu in ticket #1288):
        sbin/fsck_lfs/inode.c: revision 1.40 via patch
        sbin/fsck_ffs/fsck_ffs.8: revision 1.44 via patch
        sbin/fsck_ext2fs/fsck.h: revision 1.14 via patch
        sbin/fsck_ext2fs/main.c: revision 1.30 via patch
        sbin/fsck_ffs/inode.c: revision 1.61 via patch
        sbin/fsck_ffs/main.c: revision 1.71 via patch
        sbin/fsck_ext2fs/inode.c: revision 1.23 via patch
        sbin/fsck_lfs/fsck.h: revision 1.18 via patch
        sbin/fsck_lfs/fsck_lfs.8: revision 1.21 via patch
        sbin/fsck_lfs/main.c: revision 1.38 via patch
        sbin/fsck_ext2fs/fsck_ext2fs.8: revision 1.15 via patch
        sbin/fsck_ffs/fsck.h: revision 1.47 via patch
Disable userid to username lookups by default. Add a -U flag to perform them.
In single user mode lookups that involve the network might not work and they
slow down fsck.


To generate a diff of this commit:
cvs rdiff -u -r1.13 -r1.13.4.1 src/sbin/fsck_ext2fs/fsck.h
cvs rdiff -u -r1.14 -r1.14.16.1 src/sbin/fsck_ext2fs/fsck_ext2fs.8
cvs rdiff -u -r1.20 -r1.20.4.1 src/sbin/fsck_ext2fs/inode.c
cvs rdiff -u -r1.23 -r1.23.4.1 src/sbin/fsck_ext2fs/main.c
cvs rdiff -u -r1.45 -r1.45.4.1 src/sbin/fsck_ffs/fsck.h
cvs rdiff -u -r1.40 -r1.40.10.1 src/sbin/fsck_ffs/fsck_ffs.8
cvs rdiff -u -r1.57.4.1 -r1.57.4.2 src/sbin/fsck_ffs/inode.c
cvs rdiff -u -r1.62 -r1.62.2.1 src/sbin/fsck_ffs/main.c
cvs rdiff -u -r1.16 -r1.16.2.1 src/sbin/fsck_lfs/fsck.h
cvs rdiff -u -r1.20 -r1.20.4.1 src/sbin/fsck_lfs/fsck_lfs.8
cvs rdiff -u -r1.36 -r1.36.2.1 src/sbin/fsck_lfs/inode.c
cvs rdiff -u -r1.32 -r1.32.2.1 src/sbin/fsck_lfs/main.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sbin/fsck_ext2fs/fsck.h
diff -u src/sbin/fsck_ext2fs/fsck.h:1.13 src/sbin/fsck_ext2fs/fsck.h:1.13.4.1
--- src/sbin/fsck_ext2fs/fsck.h:1.13	Sun Jun 26 23:01:39 2005
+++ src/sbin/fsck_ext2fs/fsck.h	Tue Mar 24 21:33:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsck.h,v 1.13 2005/06/26 23:01:39 christos Exp $	*/
+/*	$NetBSD: fsck.h,v 1.13.4.1 2009/03/24 21:33:59 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -197,6 +197,7 @@
 char	nflag;			/* assume a no response */
 char	yflag;			/* assume a yes response */
 int	bflag;			/* location of alternate super block */
+int	Uflag;			/* resolve user names */
 int	debug;			/* output debugging info */
 int	preen;			/* just fix normal inconsistencies */
 char	havesb;			/* superblock has been read */

Index: src/sbin/fsck_ext2fs/fsck_ext2fs.8
diff -u src/sbin/fsck_ext2fs/fsck_ext2fs.8:1.14 src/sbin/fsck_ext2fs/fsck_ext2fs.8:1.14.16.1
--- src/sbin/fsck_ext2fs/fsck_ext2fs.8:1.14	Mon Mar 22 19:46:53 2004
+++ src/sbin/fsck_ext2fs/fsck_ext2fs.8	Tue Mar 24 21:33:59 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fsck_ext2fs.8,v 1.14 2004/03/22 19:46:53 bouyer Exp $
+.\"	$NetBSD: fsck_ext2fs.8,v 1.14.16.1 2009/03/24 21:33:59 bouyer Exp $
 .\"
 .\" Copyright (c) 1980, 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -56,7 +56,7 @@
 .\"
 .\"	@(#)fsck.8	8.3 (Berkeley) 11/29/94
 .\"
-.Dd November 29, 1994
+.Dd October 9, 2008
 .Dt FSCK_EXT2FS 8
 .Os
 .Sh NAME
@@ -70,6 +70,7 @@
 .Op Fl f
 .Op Fl m Ar mode
 .Op Fl p
+.Op Fl U
 .Op Fl y
 .Op Fl n
 .Ar filesystem ...
@@ -178,6 +179,8 @@
 do not open the filesystem for writing.
 .It Fl p
 Specify ``preen'' mode, described above.
+.It Fl U
+Resolve numeric userids to usernames.
 .It Fl y
 Assume a yes response to all questions asked by
 .Nm ;

Index: src/sbin/fsck_ext2fs/inode.c
diff -u src/sbin/fsck_ext2fs/inode.c:1.20 src/sbin/fsck_ext2fs/inode.c:1.20.4.1
--- src/sbin/fsck_ext2fs/inode.c:1.20	Fri Aug 19 02:07:18 2005
+++ src/sbin/fsck_ext2fs/inode.c	Tue Mar 24 21:33:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: inode.c,v 1.20 2005/08/19 02:07:18 christos Exp $	*/
+/*	$NetBSD: inode.c,v 1.20.4.1 2009/03/24 21:33:59 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -63,7 +63,7 @@
 #if 0
 static char sccsid[] = "@(#)inode.c	8.5 (Berkeley) 2/8/95";
 #else
-__RCSID("$NetBSD: inode.c,v 1.20 2005/08/19 02:07:18 christos Exp $");
+__RCSID("$NetBSD: inode.c,v 1.20.4.1 2009/03/24 21:33:59 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -616,7 +616,7 @@
 	dp = ginode(ino);
 	printf(" OWNER=");
 #ifndef SMALL
-	if ((pw = getpwuid((int)dp->e2di_uid)) != 0)
+	if (Uflag && (pw = getpwuid((int)dp->e2di_uid)) != 0)
 		printf("%s ", pw->pw_name);
 	else
 #endif

Index: src/sbin/fsck_ext2fs/main.c
diff -u src/sbin/fsck_ext2fs/main.c:1.23 src/sbin/fsck_ext2fs/main.c:1.23.4.1
--- src/sbin/fsck_ext2fs/main.c:1.23	Fri Sep 23 12:10:34 2005
+++ src/sbin/fsck_ext2fs/main.c	Tue Mar 24 21:33:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.23 2005/09/23 12:10:34 jmmv Exp $	*/
+/*	$NetBSD: main.c,v 1.23.4.1 2009/03/24 21:33:59 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -68,7 +68,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c	8.2 (Berkeley) 1/23/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.23 2005/09/23 12:10:34 jmmv Exp $");
+__RCSID("$NetBSD: main.c,v 1.23.4.1 2009/03/24 21:33:59 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -105,7 +105,7 @@
 
 	sync();
 	skipclean = 1;
-	while ((ch = getopt(argc, argv, "b:dfm:npqy")) != -1) {
+	while ((ch = getopt(argc, argv, "b:dfm:npqUy")) != -1) {
 		switch (ch) {
 		case 'b':
 			skipclean = 0;
@@ -144,6 +144,12 @@
 		case 'q':		/* Quiet not implemented */
 			break;
 
+#ifndef SMALL
+		case 'U':
+			Uflag++;
+			break;
+#endif
+
 		case 'y':
 			yflag++;
 			nflag = 0;

Index: src/sbin/fsck_ffs/fsck.h
diff -u src/sbin/fsck_ffs/fsck.h:1.45 src/sbin/fsck_ffs/fsck.h:1.45.4.1
--- src/sbin/fsck_ffs/fsck.h:1.45	Fri Apr 21 15:00:49 2006
+++ src/sbin/fsck_ffs/fsck.h	Tue Mar 24 21:33:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fsck.h,v 1.45 2006/04/21 15:00:49 skrll Exp $	*/
+/*	$NetBSD: fsck.h,v 1.45.4.1 2009/03/24 21:33:59 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -251,6 +251,7 @@
 long	secsize;		/* actual disk sector size */
 char	nflag;			/* assume a no response */
 char	yflag;			/* assume a yes response */
+int	Uflag;			/* resolve user names */
 int	bflag;			/* location of alternate super block */
 int	debug;			/* output debugging info */
 int	cvtlevel;		/* convert to newer file system format */

Index: src/sbin/fsck_ffs/fsck_ffs.8
diff -u src/sbin/fsck_ffs/fsck_ffs.8:1.40 src/sbin/fsck_ffs/fsck_ffs.8:1.40.10.1
--- src/sbin/fsck_ffs/fsck_ffs.8:1.40	Wed Jan 19 16:41:04 2005
+++ src/sbin/fsck_ffs/fsck_ffs.8	Tue Mar 24 21:33:59 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fsck_ffs.8,v 1.40 2005/01/19 16:41:04 wiz Exp $
+.\"	$NetBSD: fsck_ffs.8,v 1.40.10.1 2009/03/24 21:33:59 bouyer Exp $
 .\"
 .\" Copyright (c) 1980, 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -37,7 +37,7 @@
 .Nd Fast File System consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm
-.Op Fl adFfPpq
+.Op Fl adFfPpqU
 .Op Fl B Ar byteorder
 .Op Fl b Ar block
 .Op Fl c Ar level
@@ -250,6 +250,8 @@
 mode, described above.
 .It Fl q
 Quiet mode, do not output any messages for clean filesystems.
++.It Fl U
++Resolve user ids to usernames.
 .It Fl y
 Assume a yes response to all questions asked by
 .Nm ;

Index: src/sbin/fsck_ffs/inode.c
diff -u src/sbin/fsck_ffs/inode.c:1.57.4.1 src/sbin/fsck_ffs/inode.c:1.57.4.2
--- src/sbin/fsck_ffs/inode.c:1.57.4.1	Thu Apr 12 19:39:09 2007
+++ src/sbin/fsck_ffs/inode.c	Tue Mar 24 21:33:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: inode.c,v 1.57.4.1 2007/04/12 19:39:09 bouyer Exp $	*/
+/*	$NetBSD: inode.c,v 1.57.4.2 2009/03/24 21:33:59 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)inode.c	8.8 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: inode.c,v 1.57.4.1 2007/04/12 19:39:09 bouyer Exp $");
+__RCSID("$NetBSD: inode.c,v 1.57.4.2 2009/03/24 21:33:59 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -647,7 +647,7 @@
 	dp = ginode(ino);
 	printf(" OWNER=");
 #ifndef SMALL
-	if ((pw = getpwuid((int)iswap32(DIP(dp, uid)))) != 0)
+	if (Uflag && (pw = getpwuid((int)iswap32(DIP(dp, uid)))) != 0)
 		printf("%s ", pw->pw_name);
 	else
 #endif

Index: src/sbin/fsck_ffs/main.c
diff -u src/sbin/fsck_ffs/main.c:1.62 src/sbin/fsck_ffs/main.c:1.62.2.1
--- src/sbin/fsck_ffs/main.c:1.62	Tue Nov 14 22:51:11 2006
+++ src/sbin/fsck_ffs/main.c	Tue Mar 24 21:33:59 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.62 2006/11/14 22:51:11 apb Exp $	*/
+/*	$NetBSD: main.c,v 1.62.2.1 2009/03/24 21:33:59 bouyer Exp $	*/
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -39,7 +39,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c	8.6 (Berkeley) 5/14/95";
 #else
-__RCSID("$NetBSD: main.c,v 1.62 2006/11/14 22:51:11 apb Exp $");
+__RCSID("$NetBSD: main.c,v 1.62.2.1 2009/03/24 21:33:59 bouyer Exp $");
 #endif
 #endif /* not lint */
 
@@ -91,7 +91,7 @@
 	forceimage = 0;
 	endian = 0;
 	isappleufs = 0;
-	while ((ch = getopt(argc, argv, "aB:b:c:dFfm:npPqy")) != -1) {
+	while ((ch = getopt(argc, argv, "aB:b:c:dFfm:npPqUy")) != -1) {
 		switch (ch) {
 		case 'a':
 			isappleufs = 1;
@@ -155,6 +155,11 @@
 		case 'q':
 			quiet++;
 			break;
+#ifndef SMALL
+		case 'U':
+			Uflag++;
+			break;
+#endif
 
 		case 'y':
 			yflag++;

Index: src/sbin/fsck_lfs/fsck.h
diff -u src/sbin/fsck_lfs/fsck.h:1.16 src/sbin/fsck_lfs/fsck.h:1.16.2.1
--- src/sbin/fsck_lfs/fsck.h:1.16	Thu Nov  9 19:36:36 2006
+++ src/sbin/fsck_lfs/fsck.h	Tue Mar 24 21:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: fsck.h,v 1.16 2006/11/09 19:36:36 christos Exp $	 */
+/* $NetBSD: fsck.h,v 1.16.2.1 2009/03/24 21:33:58 bouyer Exp $	 */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -203,6 +203,8 @@
 #define	clrbmap(blkno)		blockmap[blkno] = 0
 #endif
 
+int	Uflag;			/* resolve user names */
+
 #define	STOP	0x01
 #define	SKIP	0x02
 #define	KEEPON	0x04

Index: src/sbin/fsck_lfs/fsck_lfs.8
diff -u src/sbin/fsck_lfs/fsck_lfs.8:1.20 src/sbin/fsck_lfs/fsck_lfs.8:1.20.4.1
--- src/sbin/fsck_lfs/fsck_lfs.8:1.20	Thu Apr 14 21:29:29 2005
+++ src/sbin/fsck_lfs/fsck_lfs.8	Tue Mar 24 21:33:58 2009
@@ -1,4 +1,4 @@
-.\"	$NetBSD: fsck_lfs.8,v 1.20 2005/04/14 21:29:29 wiz Exp $
+.\"	$NetBSD: fsck_lfs.8,v 1.20.4.1 2009/03/24 21:33:58 bouyer Exp $
 .\"
 .\" Copyright (c) 1980, 1989, 1991, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"	@(#)fsck.8	8.3 (Berkeley) 11/29/94
 .\"
-.Dd April 14, 2005
+.Dd October 9, 2008
 .Dt FSCK_LFS 8
 .Os
 .Sh NAME
@@ -37,7 +37,7 @@
 .Nd Log-structured File System consistency check and interactive repair
 .Sh SYNOPSIS
 .Nm fsck_lfs
-.Op Fl dfpq
+.Op Fl dfpqU
 .Op Fl b Ar block
 .Op Fl m Ar mode
 .Op Fl y | n
@@ -137,6 +137,8 @@
 rolls forward from the older checkpoint, and performs no other action.
 .It Fl q
 Quiet mode, do not output any messages for clean filesystems.
+.It Fl U
+Resolve user ids to user names.
 .It Fl y
 Assume a yes response to all questions asked by
 .Nm ;

Index: src/sbin/fsck_lfs/inode.c
diff -u src/sbin/fsck_lfs/inode.c:1.36 src/sbin/fsck_lfs/inode.c:1.36.2.1
--- src/sbin/fsck_lfs/inode.c:1.36	Thu Nov  9 19:36:36 2006
+++ src/sbin/fsck_lfs/inode.c	Tue Mar 24 21:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: inode.c,v 1.36 2006/11/09 19:36:36 christos Exp $	 */
+/* $NetBSD: inode.c,v 1.36.2.1 2009/03/24 21:33:58 bouyer Exp $	 */
 
 /*-
  * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@@ -537,7 +537,7 @@
 	if (dp) {
 		printf(" OWNER=");
 #ifndef SMALL
-		if ((pw = getpwuid((int) dp->di_uid)) != 0)
+		if (Uflag && (pw = getpwuid((int) dp->di_uid)) != 0)
 			printf("%s ", pw->pw_name);
 		else
 #endif

Index: src/sbin/fsck_lfs/main.c
diff -u src/sbin/fsck_lfs/main.c:1.32 src/sbin/fsck_lfs/main.c:1.32.2.1
--- src/sbin/fsck_lfs/main.c:1.32	Fri Dec  1 06:38:39 2006
+++ src/sbin/fsck_lfs/main.c	Tue Mar 24 21:33:58 2009
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.32 2006/12/01 06:38:39 tls Exp $	 */
+/* $NetBSD: main.c,v 1.32.2.1 2009/03/24 21:33:58 bouyer Exp $	 */
 
 /*
  * Copyright (c) 1980, 1986, 1993
@@ -73,7 +73,7 @@
 {
 	int ch;
 	int ret = 0;
-	const char *optstring = "b:dfi:m:npPqy";
+	const char *optstring = "b:dfi:m:npPqUy";
 
 	skipclean = 1;
 	exitonfail = 0;
@@ -121,7 +121,11 @@
 		case 'q':
 			quiet++;
 			break;
-
+#ifndef SMALL
+		case 'U':
+			Uflag++;
+			break;
+#endif
 		case 'y':
 			yflag++;
 			nflag = 0;

Reply via email to