PERFORCE change 19670 for review

Robert Watson rwatson at freebsd.org
Sun Oct 20 02:36:23 GMT 2002


http://perforce.freebsd.org/chv.cgi?CH=19670

Change 19670 by rwatson at rwatson_tislabs on 2002/10/19 19:36:20

	Integ FreeBSD base into TrustedBSD base -- loop back merges
	of MAC create/delete/rename checks, various other bits and pieces
	from the main FreeBSD tree.

Affected files ...

.. //depot/projects/trustedbsd/base/contrib/nvi/clib/getopt.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/memchr.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/memmove.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/memset.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/mkstemp.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/mmap.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/snprintf.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/strdup.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/strerror.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/strpbrk.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/strsep.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/strtol.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/strtoul.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/nvi/clib/vsnprintf.c#2 integrate
.. //depot/projects/trustedbsd/base/contrib/tar/src/extract.c#4 integrate
.. //depot/projects/trustedbsd/base/contrib/tar/src/misc.c#2 integrate
.. //depot/projects/trustedbsd/base/etc/mtree/BSD.local.dist#9 integrate
.. //depot/projects/trustedbsd/base/etc/mtree/BSD.usr.dist#17 integrate
.. //depot/projects/trustedbsd/base/games/fortune/datfiles/fortunes#19 integrate
.. //depot/projects/trustedbsd/base/games/fortune/datfiles/freebsd-tips#9 integrate
.. //depot/projects/trustedbsd/base/games/wargames/Makefile#3 integrate
.. //depot/projects/trustedbsd/base/games/wargames/wargames.6#3 integrate
.. //depot/projects/trustedbsd/base/games/wargames/wargames.c#2 integrate
.. //depot/projects/trustedbsd/base/lib/libc/gen/ftok.3#2 integrate
.. //depot/projects/trustedbsd/base/lib/libc/stdio/findfp.c#5 integrate
.. //depot/projects/trustedbsd/base/lib/libc/stdio/printf.3#13 integrate
.. //depot/projects/trustedbsd/base/lib/libc/string/string.3#3 integrate
.. //depot/projects/trustedbsd/base/lib/libdisk/disk.c#8 integrate
.. //depot/projects/trustedbsd/base/lib/libstand/Makefile#8 integrate
.. //depot/projects/trustedbsd/base/libexec/rtld-elf/rtld.c#8 integrate
.. //depot/projects/trustedbsd/base/release/Makefile#23 integrate
.. //depot/projects/trustedbsd/base/release/doc/en_US.ISO8859-1/hardware/common/dev.sgml#28 integrate
.. //depot/projects/trustedbsd/base/release/doc/en_US.ISO8859-1/relnotes/common/new.sgml#45 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/Makefile#3 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/hardware/common/dev.sgml#4 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/Makefile#2 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/common/abstract.sgml#2 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/common/install.sgml#1 branch
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/common/layout.sgml#2 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/common/trouble.sgml#1 branch
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/common/upgrade.sgml#1 branch
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/pc98/Makefile#1 branch
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/pc98/article.sgml#1 branch
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/sparc64/Makefile#1 branch
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/sparc64/article.sgml#1 branch
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/installation/sparc64/install.sgml#1 branch
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/relnotes/Makefile#2 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/relnotes/common/new.sgml#9 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/relnotes/common/relnotes.ent#3 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/relnotes/i386/Makefile#2 integrate
.. //depot/projects/trustedbsd/base/release/doc/fr_FR.ISO8859-1/share/sgml/release.dsl#3 integrate
.. //depot/projects/trustedbsd/base/release/i386/boot_crunch.conf#6 integrate
.. //depot/projects/trustedbsd/base/sbin/fsck_ffs/fsutil.c#10 integrate
.. //depot/projects/trustedbsd/base/sbin/newfs/mkfs.c#10 integrate
.. //depot/projects/trustedbsd/base/share/colldef/Makefile#8 integrate
.. //depot/projects/trustedbsd/base/share/colldef/sr_YU.ISO8859-5.src#1 branch
.. //depot/projects/trustedbsd/base/share/man/man4/Makefile#18 integrate
.. //depot/projects/trustedbsd/base/share/man/man4/gbde.4#1 branch
.. //depot/projects/trustedbsd/base/share/man/man9/kthread.9#4 integrate
.. //depot/projects/trustedbsd/base/share/mklocale/Makefile#7 integrate
.. //depot/projects/trustedbsd/base/share/monetdef/Makefile#8 integrate
.. //depot/projects/trustedbsd/base/share/monetdef/sr_YU.ISO8859-2.src#1 branch
.. //depot/projects/trustedbsd/base/share/monetdef/sr_YU.ISO8859-5.src#1 branch
.. //depot/projects/trustedbsd/base/share/msgdef/Makefile#8 integrate
.. //depot/projects/trustedbsd/base/share/msgdef/sr_YU.ISO8859-2.src#1 branch
.. //depot/projects/trustedbsd/base/share/msgdef/sr_YU.ISO8859-5.src#1 branch
.. //depot/projects/trustedbsd/base/share/numericdef/Makefile#8 integrate
.. //depot/projects/trustedbsd/base/share/numericdef/sr_YU.ISO8859-2.src#1 branch
.. //depot/projects/trustedbsd/base/share/numericdef/sr_YU.ISO8859-5.src#1 branch
.. //depot/projects/trustedbsd/base/share/timedef/Makefile#7 integrate
.. //depot/projects/trustedbsd/base/share/timedef/sr_YU.ISO8859-2.src#1 branch
.. //depot/projects/trustedbsd/base/share/timedef/sr_YU.ISO8859-5.src#1 branch
.. //depot/projects/trustedbsd/base/sys/alpha/alpha/elf_machdep.c#6 integrate
.. //depot/projects/trustedbsd/base/sys/alpha/conf/GENERIC#17 integrate
.. //depot/projects/trustedbsd/base/sys/boot/sparc64/loader/metadata.c#6 integrate
.. //depot/projects/trustedbsd/base/sys/cam/scsi/scsi_cd.c#10 integrate
.. //depot/projects/trustedbsd/base/sys/cam/scsi/scsi_cd.h#3 integrate
.. //depot/projects/trustedbsd/base/sys/compat/linux/linux_ioctl.c#16 integrate
.. //depot/projects/trustedbsd/base/sys/conf/NOTES#20 integrate
.. //depot/projects/trustedbsd/base/sys/conf/files#40 integrate
.. //depot/projects/trustedbsd/base/sys/conf/files.ia64#12 integrate
.. //depot/projects/trustedbsd/base/sys/conf/kern.pre.mk#14 integrate
.. //depot/projects/trustedbsd/base/sys/conf/ldscript.ia64#4 integrate
.. //depot/projects/trustedbsd/base/sys/conf/options#23 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amr.c#5 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amr_cam.c#2 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amr_compat.h#2 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amr_disk.c#3 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amr_pci.c#4 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amr_tables.h#2 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amrio.h#2 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amrreg.h#4 integrate
.. //depot/projects/trustedbsd/base/sys/dev/amr/amrvar.h#5 integrate
.. //depot/projects/trustedbsd/base/sys/dev/ata/atapi-cd.c#16 integrate
.. //depot/projects/trustedbsd/base/sys/dev/usb/ubsa.c#2 integrate
.. //depot/projects/trustedbsd/base/sys/fs/umapfs/umap_vfsops.c#7 integrate
.. //depot/projects/trustedbsd/base/sys/geom/bde/g_bde.c#1 branch
.. //depot/projects/trustedbsd/base/sys/geom/bde/g_bde.h#1 branch
.. //depot/projects/trustedbsd/base/sys/geom/bde/g_bde_crypt.c#1 branch
.. //depot/projects/trustedbsd/base/sys/geom/bde/g_bde_lock.c#1 branch
.. //depot/projects/trustedbsd/base/sys/geom/bde/g_bde_work.c#1 branch
.. //depot/projects/trustedbsd/base/sys/geom/geom_dev.c#14 integrate
.. //depot/projects/trustedbsd/base/sys/gnu/ext2fs/ext2_lookup.c#7 integrate
.. //depot/projects/trustedbsd/base/sys/i386/conf/GENERIC#24 integrate
.. //depot/projects/trustedbsd/base/sys/i386/i386/elf_machdep.c#5 integrate
.. //depot/projects/trustedbsd/base/sys/i386/linux/imgact_linux.c#8 integrate
.. //depot/projects/trustedbsd/base/sys/i386/linux/linux_machdep.c#10 integrate
.. //depot/projects/trustedbsd/base/sys/i386/linux/linux_sysvec.c#10 integrate
.. //depot/projects/trustedbsd/base/sys/ia64/conf/GENERIC#15 integrate
.. //depot/projects/trustedbsd/base/sys/ia64/ia32/syscalls.master#6 integrate
.. //depot/projects/trustedbsd/base/sys/ia64/ia64/elf_machdep.c#7 integrate
.. //depot/projects/trustedbsd/base/sys/ia64/ia64/machdep.c#22 integrate
.. //depot/projects/trustedbsd/base/sys/ia64/ia64/unwind.c#4 integrate
.. //depot/projects/trustedbsd/base/sys/ia64/include/unwind.h#2 integrate
.. //depot/projects/trustedbsd/base/sys/kern/init_sysent.c#20 integrate
.. //depot/projects/trustedbsd/base/sys/kern/kern_mac.c#18 integrate
.. //depot/projects/trustedbsd/base/sys/kern/link_elf.c#10 integrate
.. //depot/projects/trustedbsd/base/sys/kern/syscalls.c#20 integrate
.. //depot/projects/trustedbsd/base/sys/kern/syscalls.master#20 integrate
.. //depot/projects/trustedbsd/base/sys/kern/sysv_sem.c#9 integrate
.. //depot/projects/trustedbsd/base/sys/kern/vfs_lookup.c#9 integrate
.. //depot/projects/trustedbsd/base/sys/kern/vfs_syscalls.c#34 integrate
.. //depot/projects/trustedbsd/base/sys/kern/vfs_vnops.c#29 integrate
.. //depot/projects/trustedbsd/base/sys/modules/amr/Makefile#2 integrate
.. //depot/projects/trustedbsd/base/sys/netinet/ip_fw2.c#8 integrate
.. //depot/projects/trustedbsd/base/sys/nfsserver/nfs_srvsubs.c#8 integrate
.. //depot/projects/trustedbsd/base/sys/pc98/conf/GENERIC#19 integrate
.. //depot/projects/trustedbsd/base/sys/powerpc/conf/GENERIC#13 integrate
.. //depot/projects/trustedbsd/base/sys/powerpc/powerpc/elf_machdep.c#5 integrate
.. //depot/projects/trustedbsd/base/sys/sparc64/conf/GENERIC#21 integrate
.. //depot/projects/trustedbsd/base/sys/sparc64/include/pcb.h#6 integrate
.. //depot/projects/trustedbsd/base/sys/sparc64/sparc64/elf_machdep.c#7 integrate
.. //depot/projects/trustedbsd/base/sys/sys/cdrio.h#5 integrate
.. //depot/projects/trustedbsd/base/sys/sys/linker.h#8 integrate
.. //depot/projects/trustedbsd/base/sys/sys/namei.h#5 integrate
.. //depot/projects/trustedbsd/base/sys/sys/syscall.h#21 integrate
.. //depot/projects/trustedbsd/base/sys/sys/syscall.mk#21 integrate
.. //depot/projects/trustedbsd/base/sys/sys/sysproto.h#22 integrate
.. //depot/projects/trustedbsd/base/sys/ufs/ffs/ffs_balloc.c#6 integrate
.. //depot/projects/trustedbsd/base/sys/ufs/ffs/ffs_vnops.c#13 integrate
.. //depot/projects/trustedbsd/base/sys/ufs/ufs/README.acls#4 integrate
.. //depot/projects/trustedbsd/base/sys/ufs/ufs/README.extattr#4 integrate
.. //depot/projects/trustedbsd/base/sys/ufs/ufs/ufs_extern.h#8 integrate
.. //depot/projects/trustedbsd/base/sys/ufs/ufs/ufs_vnops.c#20 integrate
.. //depot/projects/trustedbsd/base/sys/vm/vm_fault.c#15 integrate
.. //depot/projects/trustedbsd/base/sys/vm/vm_page.c#20 integrate
.. //depot/projects/trustedbsd/base/usr.bin/ldd/ldd.c#9 integrate
.. //depot/projects/trustedbsd/base/usr.sbin/burncd/burncd.8#7 integrate
.. //depot/projects/trustedbsd/base/usr.sbin/burncd/burncd.c#10 integrate
.. //depot/projects/trustedbsd/base/usr.sbin/cdcontrol/cdcontrol.1#4 integrate
.. //depot/projects/trustedbsd/base/usr.sbin/cdcontrol/cdcontrol.c#7 integrate

Differences ...

==== //depot/projects/trustedbsd/base/contrib/nvi/clib/getopt.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/memchr.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/memmove.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/memset.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/mkstemp.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/mmap.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/snprintf.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/strdup.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/strerror.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/strpbrk.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/strsep.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/strtol.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/strtoul.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/nvi/clib/vsnprintf.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/contrib/tar/src/extract.c#4 (text+ko) ====

@@ -19,7 +19,7 @@
    with this program; if not, write to the Free Software Foundation, Inc.,
    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-/* $FreeBSD: src/contrib/tar/src/extract.c,v 1.5 2002/08/01 17:32:08 sobomax Exp $ */
+/* $FreeBSD: src/contrib/tar/src/extract.c,v 1.6 2002/10/19 09:32:03 sobomax Exp $ */
 
 #include "system.h"
 #include <quotearg.h>
@@ -1026,10 +1026,19 @@
       {
 	struct stat st1, st2;
 	int e;
+	size_t skiplinkcrud;
 
+	if (absolute_names_option)
+	  skiplinkcrud = 0;
+	else {
+	  skiplinkcrud = FILESYSTEM_PREFIX_LEN (current_link_name);
+	  while (ISSLASH (current_link_name[skiplinkcrud]))
+	    skiplinkcrud++;
+	}
+
 	/* MSDOS does not implement links.  However, djgpp's link() actually
 	   copies the file.  */
-	status = link (current_link_name, CURRENT_FILE_NAME);
+	status = link (current_link_name + skiplinkcrud, CURRENT_FILE_NAME);
 
 	if (status == 0)
 	  {

==== //depot/projects/trustedbsd/base/contrib/tar/src/misc.c#2 (text+ko) ====

@@ -17,7 +17,7 @@
    with this program; if not, write to the Free Software Foundation, Inc.,
    59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 
-/* $FreeBSD: src/contrib/tar/src/misc.c,v 1.2 2002/06/04 17:31:16 sobomax Exp $ */
+/* $FreeBSD: src/contrib/tar/src/misc.c,v 1.3 2002/10/19 09:32:03 sobomax Exp $ */
 
 #include "system.h"
 #include "rmt.h"
@@ -216,6 +216,13 @@
 	    return 0;
 	}
       while (! ISSLASH (*p));
+
+      do
+	{
+	  if (! *p++)
+	    return 0;
+	}
+      while ( ISSLASH (*p));
     }
 }
 

==== //depot/projects/trustedbsd/base/etc/mtree/BSD.local.dist#9 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.90 2002/04/12 16:22:58 des Exp $
+# $FreeBSD: src/etc/mtree/BSD.local.dist,v 1.91 2002/10/19 12:56:56 ache Exp $
 #
 # Please see the file src/etc/mtree/README before making changes to this file.
 #
@@ -391,6 +391,10 @@
             ..
             sl_SI.ISO8859-2
             ..
+            sr_YU.ISO8859-2
+            ..
+            sr_YU.ISO8859-5
+            ..
             sv_SE.ISO8859-1
             ..
             sv_SE.ISO8859-15

==== //depot/projects/trustedbsd/base/etc/mtree/BSD.usr.dist#17 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.265 2002/09/17 01:48:48 peter Exp $
+# $FreeBSD: src/etc/mtree/BSD.usr.dist,v 1.266 2002/10/19 12:56:56 ache Exp $
 #
 # Please see the file src/etc/mtree/README before making changes to this file.
 #
@@ -499,6 +499,10 @@
             ..
             sl_SI.ISO8859-2
             ..
+            sr_YU.ISO8859-2
+            ..
+            sr_YU.ISO8859-5
+            ..
             sv_SE.ISO8859-1
             ..
             sv_SE.ISO8859-15
@@ -819,6 +823,10 @@
             ..
             sl_SI.ISO8859-2
             ..
+            sr_YU.ISO8859-2
+            ..
+            sr_YU.ISO8859-5
+            ..
             sv_SE.ISO8859-1
             ..
             sv_SE.ISO8859-15

==== //depot/projects/trustedbsd/base/games/fortune/datfiles/fortunes#19 (text+ko) ====

@@ -1,5 +1,5 @@
 This fortune brought to you by:
-$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.97 2002/09/11 11:21:36 tg Exp $
+$FreeBSD: src/games/fortune/datfiles/fortunes,v 1.98 2002/10/19 04:49:10 fanf Exp $
 %
 			-- Gifts for Children --
 
@@ -7644,6 +7644,15 @@
 If Patrick Henry thought that taxation without representation was bad,
 he should see how bad it is with representation.
 %
+If preceded by a '-' , the timezone shall be east of the Prime
+Meridian; otherwise, it shall be west (which may be indicated by
+an optional preceding '+' ).
+		-- POSIX 2001
+
+The "+" or "-" indicates whether the time-of-day is ahead of
+(i.e., east of) or behind (i.e., west of) Universal Time.
+		-- RFC 2822
+%
 If scientific reasoning were limited to the logical processes of
 arithmetic, we should not get very far in our understanding of the
 physical world.  One might as well attempt to grasp the game of poker

==== //depot/projects/trustedbsd/base/games/fortune/datfiles/freebsd-tips#9 (text+ko) ====

@@ -1,5 +1,5 @@
 This fortune brought to you by:
-$FreeBSD: src/games/fortune/datfiles/freebsd-tips,v 1.26 2002/09/04 23:28:35 jmallett Exp $
+$FreeBSD: src/games/fortune/datfiles/freebsd-tips,v 1.27 2002/10/19 21:34:50 blackend Exp $
 %
 Having trouble using fetch through a firewall? Try setting the environment
 variable FTP_PASSIVE_MODE to yes, and see fetch(3) for more details.
@@ -74,7 +74,8 @@
 	$ export VARIABLE
 %
 You can use /etc/make.conf to control the options used to compile software
-on this system.  Example entries are in /usr/share/examples/etc/make.conf.
+on this system.  Example entries are in
+/usr/share/examples/etc/defaults/make.conf.
 %
 To do a fast search for a file, try
 

==== //depot/projects/trustedbsd/base/games/wargames/Makefile#3 (text+ko) ====


==== //depot/projects/trustedbsd/base/games/wargames/wargames.6#3 (text+ko) ====


==== //depot/projects/trustedbsd/base/games/wargames/wargames.c#2 (text+ko) ====


==== //depot/projects/trustedbsd/base/lib/libc/gen/ftok.3#2 (text+ko) ====

@@ -23,7 +23,7 @@
 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 .\"
-.\" $FreeBSD: src/lib/libc/gen/ftok.3,v 1.14 2001/10/01 16:08:50 ru Exp $
+.\" $FreeBSD: src/lib/libc/gen/ftok.3,v 1.15 2002/10/19 13:33:12 tjr Exp $
 .Dd June 24, 1994
 .Os
 .Dt FTOK 3
@@ -38,9 +38,6 @@
 .Ft key_t
 .Fn ftok "const char *path" "int id"
 .Sh DESCRIPTION
-.Bf -symbolic
-This function is available from the compatibility library, libcompat.
-.Ef
 The
 .Fn ftok
 function attempts to create a unique key suitable for use with the

==== //depot/projects/trustedbsd/base/lib/libc/stdio/findfp.c#5 (text+ko) ====

@@ -38,7 +38,7 @@
 static char sccsid[] = "@(#)findfp.c	8.2 (Berkeley) 1/4/94";
 #endif /* LIBC_SCCS and not lint */
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libc/stdio/findfp.c,v 1.22 2002/10/11 22:38:17 peter Exp $");
+__FBSDID("$FreeBSD: src/lib/libc/stdio/findfp.c,v 1.23 2002/10/19 22:28:07 peter Exp $");
 
 #include <sys/param.h>
 #include <machine/atomic.h>
@@ -69,7 +69,7 @@
 
 static struct __sFILEX __sFX[3];
 
-static FILE __sF[3] = {
+FILE __sF[3] = {
 	std(__SRD, STDIN_FILENO),
 	std(__SWR, STDOUT_FILENO),
 	std(__SWR|__SNBF, STDERR_FILENO)

==== //depot/projects/trustedbsd/base/lib/libc/stdio/printf.3#13 (text+ko) ====

@@ -34,7 +34,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)printf.3	8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/stdio/printf.3,v 1.49 2002/09/24 09:22:47 tjr Exp $
+.\" $FreeBSD: src/lib/libc/stdio/printf.3,v 1.50 2002/10/19 13:48:45 tjr Exp $
 .\"
 .Dd November 8, 2001
 .Dt PRINTF 3
@@ -678,14 +678,14 @@
 #include <stdarg.h>
 char *newfmt(const char *fmt, ...)
 {
-		char *p;
-		va_list ap;
-		if ((p = malloc(128)) == NULL)
-			return (NULL);
-		va_start(ap, fmt);
-		(void) vsnprintf(p, 128, fmt, ap);
-		va_end(ap);
-		return (p);
+	char *p;
+	va_list ap;
+	if ((p = malloc(128)) == NULL)
+		return (NULL);
+	va_start(ap, fmt);
+	(void) vsnprintf(p, 128, fmt, ap);
+	va_end(ap);
+	return (p);
 }
 .Ed
 .Sh SECURITY CONSIDERATIONS

==== //depot/projects/trustedbsd/base/lib/libc/string/string.3#3 (text+ko) ====

@@ -32,7 +32,7 @@
 .\" SUCH DAMAGE.
 .\"
 .\"     @(#)string.3	8.2 (Berkeley) 12/11/93
-.\" $FreeBSD: src/lib/libc/string/string.3,v 1.12 2002/10/03 19:39:20 obrien Exp $
+.\" $FreeBSD: src/lib/libc/string/string.3,v 1.13 2002/10/19 13:41:22 tjr Exp $
 .\"
 .Dd December 11, 1993
 .Dt STRING 3
@@ -151,7 +151,6 @@
 .Fn strerror ,
 .Fn strlen ,
 .Fn strpbrk ,
-.Fn strsep ,
 .Fn strspn ,
 .Fn strcspn ,
 .Fn strstr ,

==== //depot/projects/trustedbsd/base/lib/libdisk/disk.c#8 (text+ko) ====

@@ -8,7 +8,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/lib/libdisk/disk.c,v 1.81 2002/10/17 18:34:32 sam Exp $");
+__FBSDID("$FreeBSD: src/lib/libdisk/disk.c,v 1.82 2002/10/19 16:39:28 sam Exp $");
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -28,11 +28,26 @@
 #include <paths.h>
 #include "libdisk.h"
 
+#define	HAVE_GEOM
+#ifdef HAVE_GEOM
+#include <ctype.h>
+#include <errno.h>
+#include <assert.h>
+#endif /*HAVE_GEOM*/
+
 #ifndef PC98
 #define DOSPTYP_EXTENDED        5
 #define DOSPTYP_ONTRACK         84
 #endif
 
+#ifdef DEBUG
+#define	DPRINT(x)	warn x
+#define	DPRINTX(x)	warnx x
+#else
+#define	DPRINT(x)
+#define	DPRINTX(x)
+#endif
+
 const char *chunk_n[] = {
 	"whole",
 	"unknown",
@@ -59,10 +74,371 @@
 }
 #endif
 
+#ifdef HAVE_GEOM
+/*
+ * XXX BEGIN HACK XXX
+ * Scan/parse the XML geom data to retrieve what we need to
+ * carry out the work of Int_Open_Disk.  This is a total hack
+ * and should be replaced with a real XML parser.
+ */
+typedef enum {
+	XML_MESH,
+	XML_MESH_END,
+	XML_CLASS,
+	XML_CLASS_END,
+	XML_GEOM,
+	XML_GEOM_END,
+	XML_CONFIG,
+	XML_CONFIG_END,
+	XML_PROVIDER,
+	XML_PROVIDER_END,
+	XML_NAME,
+	XML_NAME_END,
+	XML_INDEX,
+	XML_INDEX_END,
+	XML_LENGTH,
+	XML_LENGTH_END,
+	XML_SECLENGTH,
+	XML_SECLENGTH_END,
+	XML_SECOFFSET,
+	XML_SECOFFSET_END,
+	XML_OFFSET,
+	XML_OFFSET_END,
+	XML_TYPE,
+	XML_TYPE_END,
+
+	XML_OTHER,
+	XML_OTHER_END
+} XMLToken;
+
+#ifdef DEBUG
+static const char*
+xmltokenname(XMLToken t)
+{
+	switch (t) {
+	case XML_MESH:		return "XML_MESH";
+	case XML_MESH_END:	return "XML_MESH_END";
+	case XML_CLASS:		return "XML_CLASS";
+	case XML_CLASS_END:	return "XML_CLASS_END";
+	case XML_GEOM:		return "XML_GEOM";
+	case XML_GEOM_END:	return "XML_GEOM_END";
+	case XML_CONFIG:	return "XML_CONFIG";
+	case XML_CONFIG_END:	return "XML_CONFIG_END";
+	case XML_PROVIDER:	return "XML_PROVIDER";
+	case XML_PROVIDER_END:	return "XML_PROVIDER_END";
+	case XML_NAME:		return "XML_NAME";
+	case XML_NAME_END:	return "XML_NAME_END";
+	case XML_INDEX:		return "XML_INDEX";
+	case XML_INDEX_END:	return "XML_INDEX_END";
+	case XML_LENGTH:	return "XML_LENGTH";
+	case XML_LENGTH_END:	return "XML_LENGTH_END";
+	case XML_SECLENGTH:	return "XML_SECLENGTH";
+	case XML_SECLENGTH_END:	return "XML_SECLENGTH_END";
+	case XML_SECOFFSET:	return "XML_SECOFFSET";
+	case XML_SECOFFSET_END:	return "XML_SECOFFSET_END";
+	case XML_OFFSET:	return "XML_OFFSET";
+	case XML_OFFSET_END:	return "XML_OFFSET_END";
+	case XML_TYPE:		return "XML_TYPE";
+	case XML_TYPE_END:	return "XML_TYPE_END";
+
+	case XML_OTHER:		return "XML_OTHER";
+	case XML_OTHER_END:	return "XML_OTHER_END";
+	}
+	return "???";
+}
+#endif /*DEBUG*/
+
+/*
+ * Parse the next XML token delimited by <..>.  If the token
+ * has a "builtin terminator" (<... />) then just skip it and
+ * go the next token.
+ */
+static int
+xmltoken(const char *start, const char **next, XMLToken *t)
+{
+	const char *cp = start;
+	const char *token;
+
+again:
+	while (*cp != '<') {
+		if (*cp == '\0') {
+			*next = cp;
+			DPRINTX(("xmltoken: EOD"));
+			return 0;
+		}
+		cp++;
+	}
+	token = ++cp;
+	for (; *cp && *cp != '>' && !isspace(*cp); cp++)
+		;
+	if (*cp == '\0') {
+		*next = cp;
+		DPRINTX(("xmltoken: EOD"));
+		return 0;
+	}
+	*t = (*token == '/');
+	if (*t)
+		token++;
+	if (strncasecmp(token, "mesh", cp-token) == 0)
+		*t += XML_MESH;
+	else if (strncasecmp(token, "class", cp-token) == 0)
+		*t += XML_CLASS;
+	else if (strncasecmp(token, "geom", cp-token) == 0)
+		*t += XML_GEOM;
+	else if (strncasecmp(token, "config", cp-token) == 0)
+		*t += XML_CONFIG;
+	else if (strncasecmp(token, "provider", cp-token) == 0)
+		*t += XML_PROVIDER;
+	else if (strncasecmp(token, "name", cp-token) == 0)
+		*t += XML_NAME;
+	else if (strncasecmp(token, "index", cp-token) == 0)
+		*t += XML_INDEX;
+	else if (strncasecmp(token, "length", cp-token) == 0)
+		*t += XML_LENGTH;
+	else if (strncasecmp(token, "seclength", cp-token) == 0)
+		*t += XML_SECLENGTH;
+	else if (strncasecmp(token, "secoffset", cp-token) == 0)
+		*t += XML_SECOFFSET;
+	else if (strncasecmp(token, "offset", cp-token) == 0)
+		*t += XML_OFFSET;
+	else if (strncasecmp(token, "type", cp-token) == 0)
+		*t += XML_TYPE;
+	else
+		*t += XML_OTHER;
+	/* now collect the remainder of the string */
+	for (; *cp != '>' && *cp != '\0'; cp++)
+		;
+	if (*cp == '\0') {
+		*next = cp;
+		DPRINTX(("xmltoken: EOD"));
+		return 0;
+	}
+	if (cp > token && cp[-1] == '/') {
+		/* e.g. <geom ref="0xc1c8c100"/> */
+		start = cp+1;
+		goto again;
+	}
+	*next = cp+1;
+	DPRINTX(("xmltoken: %s \"%.*s\"", xmltokenname(*t), cp-token, token));
+	return 1;
+}
+
+/*
+ * Parse and discard XML up to the token terminator.
+ */
+static int
+discardxml(const char **next, XMLToken terminator)
+{
+	const char *xml = *next;
+	XMLToken t;
+
+	DPRINTX(("discard XML up to %s", xmltokenname(terminator)));
+	for (;;) {
+		if (xmltoken(xml, next, &t) == 0)
+			return EINVAL;
+		if (t == terminator)
+			break;
+		if ((t & 1) == 0) {
+			int error = discardxml(next, t+1);
+			if (error)
+				return error;
+		}
+		xml = *next;
+	}
+	return 0;
+}
+
+/*
+ * Parse XML from between a range of markers; e.g. <mesh> ... </mesh>.
+ * When the specified class name is located we descend looking for the
+ * geometry information given by diskname.  Once inside there we process
+ * tags calling f back for each useful one.  The arg is passed into f
+ * for use in storing the parsed data.
+ */
+static int
+parsexmlpair(
+	const char *xml,
+	const char **next,
+	const char *classname,
+	XMLToken terminator,
+	const char *diskname,
+	int (*f)(void *, XMLToken, u_int *, u_long),
+	void *arg
+)
+{
+	const char *cp;
+	XMLToken t;
+	int error;
+	u_int ix = (u_int) -1;
+
+	DPRINTX(("parse XML up to %s", xmltokenname(terminator)));
+	do {
+		if (xmltoken(xml, next, &t) == 0) {
+			error = EINVAL;
+			break;
+		}
+		if (t == terminator) {
+			error = 0;
+			break;
+		}
+		if (t & 1) {		/* </mumble> w/o matching <mumble> */
+			DPRINTX(("Unexpected token %s", xmltokenname(t)));
+			error = EINVAL;
+			break;
+		}
+		switch ((int) t) {
+		case XML_NAME:
+			for (cp = *next; *cp && *cp != '<'; cp++)
+				;
+			if (*cp == '\0') {
+				DPRINTX(("parsexmlpair: EOD"));
+				error = EINVAL;
+				goto done;
+			    }
+			DPRINTX(("parsexmlpair: \"%.*s\"", cp-*next, *next));
+			switch ((int) terminator) {
+			case XML_CLASS_END:
+				if (strncasecmp(*next, classname, cp-*next))
+					return discardxml(next, terminator);
+				break;
+			case XML_GEOM_END:
+				if (strncasecmp(*next, diskname, cp-*next))
+					return discardxml(next, terminator);
+				break;
+			}
+			break;
+		case XML_SECOFFSET:
+		case XML_SECLENGTH:
+		case XML_TYPE:
+			if (ix == (u_int) -1) {
+				DPRINTX(("parsexmlpair: slice data w/o "
+					"preceding index"));
+				error = EINVAL;
+				goto done;
+			}
+			/* fall thru... */
+		case XML_INDEX:
+			if (terminator != XML_CONFIG_END) {
+				DPRINTX(("parsexmlpair: %s in unexpected "
+				      "context: terminator %s",
+				      xmltokenname(t),
+				      xmltokenname(terminator)));
+				error = EINVAL;
+				goto done;
+			}
+			error = (*f)(arg, t, &ix, strtoul(*next, NULL, 10));
+			if (error)
+				goto done;
+			break;
+		}
+		error = parsexmlpair(*next, &xml, classname,
+				     t+1, diskname, f, arg);
+	} while (error == 0);
+done:
+	return error;
+}
+
+/*
+ * XML parser.  Just barely smart enough to handle the
+ * gibberish that geom passed back from the kernel.
+ */
+static int
+xmlparse(
+	const char *confxml,
+	const char *classname,
+	const char *diskname,
+	int (*f)(void *, XMLToken, u_int *, u_long),
+	void *arg
+)
+{
+	const char *next;
+	XMLToken t;
+	int error;
+
+	next = confxml;
+	while (xmltoken(next, &next, &t) && t != XML_MESH)
+		;
+	if (t == XML_MESH)
+		error = parsexmlpair(next, &next, classname, XML_MESH_END, diskname, f, arg);
+	else {
+		DPRINTX(("xmlparse: expecting mesh token, got %s",
+		      xmltokenname(t)));
+		error = EINVAL;
+	}
+
+	return (error ? -1 : 0);
+}
+
+/*
+ * Callback to collect slice-related data.
+ */
+static int
+assignToSlice(void *arg, XMLToken t, u_int *slice, u_long v)
+{
+	struct diskslices *ds = (struct diskslices *) arg;
+
+	switch ((int) t) {
+	case XML_INDEX:
+		*slice = BASE_SLICE + (u_int) v;
+		if (*slice >= MAX_SLICES) {
+			DPRINTX(("assignToSlice: invalid slice index %u > max %u",
+			      *slice, MAX_SLICES));
+			return EINVAL;
+		}
+		if (*slice >= ds->dss_nslices)
+			ds->dss_nslices = (*slice)+1;
+		break;
+	case XML_SECOFFSET:
+		ds->dss_slices[*slice].ds_offset = v;
+		break;
+	case XML_SECLENGTH:
+		ds->dss_slices[*slice].ds_size = v;
+		break;
+	case XML_TYPE:
+		ds->dss_slices[*slice].ds_type = v;
+		break;
+	}
+	return 0;
+}
+
+/*
+ * Callback to collect partition-related data.
+ */
+static int
+assignToPartition(void *arg, XMLToken t, u_int *part, u_long v)
+{
+	struct disklabel *dl = (struct disklabel *) arg;
+
+	switch ((int) t) {
+	case XML_INDEX:
+		*part = (u_int) v;
+		if (*part >= MAXPARTITIONS) {
+			DPRINTX(("assignToPartition: invalid partition index %u > max %u",
+			      *part, MAXPARTITIONS));
+			return EINVAL;
+		}
+		if (*part >= dl->d_npartitions)
+			dl->d_npartitions = (*part)+1;
+		break;
+	case XML_SECOFFSET:
+		dl->d_partitions[*part].p_offset = (u_int32_t) v;
+		break;
+	case XML_SECLENGTH:
+		dl->d_partitions[*part].p_size = (u_int32_t) v;
+		break;
+	case XML_TYPE:
+		dl->d_partitions[*part].p_fstype = (u_int8_t) v;
+		break;
+	}
+	return 0;
+}
+#endif /*HAVE_GEOM*/
+
 struct disk *
 Int_Open_Disk(const char *name, u_long size)
 {
-	int i,fd;
+	int i;
+	int fd = -1;
 	struct diskslices ds;
 	struct disklabel dl;
 	char device[64], *buf;
@@ -75,6 +451,11 @@
 	void *p;
 #endif
 	u_long offset = 0;
+#ifdef HAVE_GEOM
+	char *confxml = NULL;
+	size_t xmlsize;
+	int error;
+#endif /*HAVE_GEOM*/
 
 	strlcpy(device, _PATH_DEV, sizeof(device));
 	strlcat(device, name, sizeof(device));
@@ -85,27 +466,52 @@
 
 	fd = open(device, O_RDONLY);
 	if (fd < 0) {
-#ifdef DEBUG
-		warn("open(%s) failed", device);
-#endif
-		return 0;
+		DPRINT(("open(%s) failed", device));
+		goto bad;
 	}
 
 	memset(&dl, 0, sizeof dl);
+	memset(&ds, 0, sizeof ds);
+#ifdef HAVE_GEOM
+	/*
+	 * Read and hack-parse the XML that provides the info we need.
+	 */
+	error = sysctlbyname("kern.geom.confxml", NULL, &xmlsize, NULL, 0);
+	if (error) {
+		warn("kern.geom.confxml sysctl not available, giving up!");
+		goto bad;
+	}
+	confxml = (char *) malloc(xmlsize+1);
+	if (confxml == NULL) {
+		DPRINT(("cannot malloc memory for confxml"));
+		goto bad;
+	}
+	error = sysctlbyname("kern.geom.confxml", confxml, &xmlsize, NULL, 0);
+	if (error) {
+		DPRINT(("error reading kern.geom.confxml from the system"));
+		goto bad;
+	}
+	confxml[xmlsize] = '\0';	/* in case kernel bug is still there */
+
+	if (xmlparse(confxml, "MBR", name, assignToSlice, &ds) != 0) {
+		DPRINTX(("Error parsing MBR geometry specification."));
+		goto bad;
+	}
+	/* XXX how do I get this info from the XML? */
+	for (i = BASE_SLICE; i < ds.dss_nslices; i++) {
+		struct diskslice *dsp = &ds.dss_slices[i];
+		if (dsp->ds_offset + dsp->ds_size > ds.dss_slices[WHOLE_DISK_SLICE].ds_size)
+			ds.dss_slices[WHOLE_DISK_SLICE].ds_size = dsp->ds_offset + dsp->ds_size;
+	}
+#else /* !HAVE_GEOM */
 	if (ioctl(fd, DIOCGDINFO, &dl) < 0) {
-#ifdef DEBUG
-		warn("DIOCGDINFO(%s) failed", device);
-#endif
-		close(fd);
-		return 0;
+		DPRINT(("DIOCGDINFO(%s) failed", device));
+		goto bad;
 	}
 	i = ioctl(fd, DIOCGSLICEINFO, &ds);
 	if (i < 0) {
-#ifdef DEBUG
-		warn("DIOCGSLICEINFO(%s) failed", device);
-#endif
-		close(fd);
-		return 0;
+		DPRINT(("DIOCGSLICEINFO(%s) failed", device));
+		goto bad;
 	}
 
 #ifdef DEBUG
@@ -115,6 +521,7 @@
 				i, ds.dss_slices[i].ds_openmask);
 	printf("\n");
 #endif
+#endif /*SADDLED_WTIH_GEOM*/
 
 /* XXX --- ds.dss_slice[WHOLE_DISK_SLICE].ds.size of MO disk is wrong!!! */
 #ifdef PC98
@@ -136,11 +543,10 @@
 	}
 	free (buf);
 	if (sector_size > MAX_SEC_SIZE) {
-#ifdef DEBUG
-		warn("Int_Open_Disk: could not determine sector size, "
-		     "calculated %u, max %u\n", sector_size, MAX_SEC_SIZE);
-#endif
-		return NULL; /* could not determine sector size */
+		DPRINT(("Int_Open_Disk: could not determine sector size, "
+		     "calculated %u, max %u\n", sector_size, MAX_SEC_SIZE));
+		/* could not determine sector size */
+		goto bad;
 	}
 
 #ifdef PC98
@@ -179,11 +585,7 @@
 #else
 	if (Add_Chunk(d, -offset, size, name, whole, 0, 0))
 #endif
-#ifdef DEBUG
-		warn("Failed to add 'whole' chunk");
-#else
-		{}
-#endif
+		DPRINT(("Failed to add 'whole' chunk"));
 
 #ifdef __i386__
 #ifdef PC98
@@ -201,9 +603,11 @@
 #endif /* PC98 */
 	for(i=BASE_SLICE;i<ds.dss_nslices;i++) {
 		char sname[20];
+		char pname[20];
 		chunk_e ce;

>>> TRUNCATED FOR MAIL (1000 lines) <<<
To Unsubscribe: send mail to majordomo at trustedbsd.org
with "unsubscribe trustedbsd-cvs" in the body of the message



More information about the trustedbsd-cvs mailing list