CVS commit: xsrc/external/mit/libXft/dist/src

2022-09-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Sep  9 23:18:56 UTC 2022

Modified Files:
xsrc/external/mit/libXft/dist/src: xftdpy.c xftglyphs.c

Log Message:
merge libXft 2.3.5.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/libXft/dist/src/xftdpy.c
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libXft/dist/src/xftglyphs.c

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

Modified files:

Index: xsrc/external/mit/libXft/dist/src/xftdpy.c
diff -u xsrc/external/mit/libXft/dist/src/xftdpy.c:1.5 xsrc/external/mit/libXft/dist/src/xftdpy.c:1.6
--- xsrc/external/mit/libXft/dist/src/xftdpy.c:1.5	Mon Aug 23 21:05:09 2021
+++ xsrc/external/mit/libXft/dist/src/xftdpy.c	Fri Sep  9 23:18:56 2022
@@ -22,10 +22,12 @@
 
 #include "xftint.h"
 
+#define BtoS(b) ((b) ? "true" : "false")
+
 _X_HIDDEN XftDisplayInfo	*_XftDisplayInfo;
 
 static int
-_XftCloseDisplay (Display *dpy, XExtCodes *codes)
+_XftCloseDisplay (Display *dpy, XExtCodes *codes _X_UNUSED)
 {
 XftDisplayInfo  *info, **prev;
 
@@ -51,7 +53,8 @@ _XftCloseDisplay (Display *dpy, XExtCode
 for (prev = &_XftDisplayInfo; (info = *prev); prev = &(*prev)->next)
 	if (info->display == dpy)
 	break;
-*prev = info->next;
+if (info != NULL)
+	*prev = info->next;
 
 free (info);
 return 0;
@@ -85,7 +88,7 @@ _XftDisplayInfoGet (Display *dpy, FcBool
 if (!createIfNecessary)
 	return NULL;
 
-info = (XftDisplayInfo *) malloc (sizeof (XftDisplayInfo));
+info = malloc (sizeof (XftDisplayInfo));
 if (!info)
 	goto bail0;
 info->codes = XAddExtension (dpy);
@@ -169,7 +172,7 @@ _XftDisplayInfoGet (Display *dpy, FcBool
 		   XFT_MAX_GLYPH_MEMORY, 0,
 		   XFT_DPY_MAX_GLYPH_MEMORY);
 if (XftDebug () & XFT_DBG_CACHE)
-	printf ("global max cache memory %ld\n", info->max_glyph_memory);
+	printf ("global max cache memory %lu\n", info->max_glyph_memory);
 
 
 info->num_unref_fonts = 0;
@@ -177,7 +180,14 @@ _XftDisplayInfoGet (Display *dpy, FcBool
 		  XFT_MAX_UNREF_FONTS, 0,
 		  XFT_DPY_MAX_UNREF_FONTS);
 if (XftDebug() & XFT_DBG_CACHE)
-	printf ("global max unref fonts %d\n", info->max_unref_fonts);
+	printf ("global max unref fonts  %d\n", info->max_unref_fonts);
+
+info->track_mem_usage = FcFalse;
+info->track_mem_usage = XftDefaultGetBool (dpy,
+	   XFT_TRACK_MEM_USAGE, 0,
+	   FcFalse);
+if (XftDebug() & XFT_DBG_CACHE)
+	printf ("global track mem usage  %s\n", BtoS(info->track_mem_usage));
 
 memset (info->fontHash, '\0', sizeof (XftFont *) * XFT_NUM_FONT_HASH);
 return info;
@@ -210,7 +220,7 @@ _XftDisplayValidateMemory (XftDisplayInf
 	glyph_memory += font->glyph_memory;
 }
 if (glyph_memory != info->glyph_memory)
-	printf ("Display glyph cache incorrect has %ld bytes, should have %ld\n",
+	printf ("Display glyph cache incorrect has %lu bytes, should have %lu\n",
 		info->glyph_memory, glyph_memory);
 }
 
@@ -227,7 +237,7 @@ _XftDisplayManageMemory (Display *dpy)
 if (XftDebug () & XFT_DBG_CACHE)
 {
 	if (info->glyph_memory > info->max_glyph_memory)
-	printf ("Reduce global memory from %ld to %ld\n",
+	printf ("Reduce global memory from %lu to %lu\n",
 		info->glyph_memory, info->max_glyph_memory);
 	_XftDisplayValidateMemory (info);
 }
@@ -272,16 +282,29 @@ XftDefaultSet (Display *dpy, FcPattern *
 if (info->defaults)
 	FcPatternDestroy (info->defaults);
 info->defaults = defaults;
+
 if (!info->max_glyph_memory)
 	info->max_glyph_memory = XFT_DPY_MAX_GLYPH_MEMORY;
 info->max_glyph_memory = (unsigned long)XftDefaultGetInteger (dpy,
 		   XFT_MAX_GLYPH_MEMORY, 0,
 		   (int)info->max_glyph_memory);
+if (XftDebug () & XFT_DBG_CACHE)
+	printf ("update max cache memory %lu\n", info->max_glyph_memory);
+
 if (!info->max_unref_fonts)
 	info->max_unref_fonts = XFT_DPY_MAX_UNREF_FONTS;
 info->max_unref_fonts = XftDefaultGetInteger (dpy,
 		  XFT_MAX_UNREF_FONTS, 0,
 		  info->max_unref_fonts);
+if (XftDebug() & XFT_DBG_CACHE)
+	printf ("update max unref fonts  %d\n", info->max_unref_fonts);
+
+info->track_mem_usage = XftDefaultGetBool (dpy,
+	   XFT_TRACK_MEM_USAGE, 0,
+	   info->track_mem_usage);
+if (XftDebug() & XFT_DBG_CACHE)
+	printf ("update track mem usage  %s\n", BtoS(info->track_mem_usage));
+
 return True;
 }
 

Index: xsrc/external/mit/libXft/dist/src/xftglyphs.c
diff -u xsrc/external/mit/libXft/dist/src/xftglyphs.c:1.4 xsrc/external/mit/libXft/dist/src/xftglyphs.c:1.5
--- xsrc/external/mit/libXft/dist/src/xftglyphs.c:1.4	Mon Aug 23 21:05:09 2021
+++ xsrc/external/mit/libXft/dist/src/xftglyphs.c	Fri Sep  9 23:18:56 2022
@@ -1,23 +1,24 @@
 /*
+ * Copyright © 2022 Thomas E. Dickey
  * Copyright © 2000 Keith Packard
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted 

CVS commit: xsrc/external/mit/libXft/dist/src

2022-09-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Sep  9 23:18:56 UTC 2022

Modified Files:
xsrc/external/mit/libXft/dist/src: xftdpy.c xftglyphs.c

Log Message:
merge libXft 2.3.5.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/libXft/dist/src/xftdpy.c
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libXft/dist/src/xftglyphs.c

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



CVS import: xsrc/external/mit/libXft/dist

2022-09-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Sep  9 23:17:50 UTC 2022

Update of /cvsroot/xsrc/external/mit/libXft/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv28575

Log Message:
initial import of libXft-2.3.5

Status:

Vendor Tag: xorg
Release Tags:   libXft-2-3-5

U xsrc/external/mit/libXft/dist/Makefile.in
U xsrc/external/mit/libXft/dist/README.md
U xsrc/external/mit/libXft/dist/config.guess
U xsrc/external/mit/libXft/dist/missing
U xsrc/external/mit/libXft/dist/compile
U xsrc/external/mit/libXft/dist/configure.ac
U xsrc/external/mit/libXft/dist/configure
U xsrc/external/mit/libXft/dist/config.sub
U xsrc/external/mit/libXft/dist/AUTHORS
U xsrc/external/mit/libXft/dist/COPYING
U xsrc/external/mit/libXft/dist/ChangeLog
U xsrc/external/mit/libXft/dist/NEWS
U xsrc/external/mit/libXft/dist/INSTALL
U xsrc/external/mit/libXft/dist/depcomp
U xsrc/external/mit/libXft/dist/ltmain.sh
U xsrc/external/mit/libXft/dist/aclocal.m4
U xsrc/external/mit/libXft/dist/install-sh
U xsrc/external/mit/libXft/dist/Makefile.am
U xsrc/external/mit/libXft/dist/xft.pc.in
U xsrc/external/mit/libXft/dist/config.h.in
U xsrc/external/mit/libXft/dist/include/X11/Xft/XftCompat.h
U xsrc/external/mit/libXft/dist/include/X11/Xft/Xft.h
U xsrc/external/mit/libXft/dist/include/X11/Xft/Xft.h.in
N xsrc/external/mit/libXft/dist/man/XftDrawGlyphSpec.man
U xsrc/external/mit/libXft/dist/man/Makefile.in
N xsrc/external/mit/libXft/dist/man/XftFontUnloadGlyphs.man
N xsrc/external/mit/libXft/dist/man/XftDrawCharFontSpec.man
N xsrc/external/mit/libXft/dist/man/XftNameParse.man
N xsrc/external/mit/libXft/dist/man/XftTextExtents16.man
N xsrc/external/mit/libXft/dist/man/XftFontOpenXlfd.man
N xsrc/external/mit/libXft/dist/man/XftFontOpen.man
N xsrc/external/mit/libXft/dist/man/XftFontInfoHash.man
N xsrc/external/mit/libXft/dist/man/XftColorAllocValue.man
N xsrc/external/mit/libXft/dist/man/XftDrawPicture.man
N xsrc/external/mit/libXft/dist/man/XftCharIndex.man
N xsrc/external/mit/libXft/dist/man/XftTextRenderUtf8.man
N xsrc/external/mit/libXft/dist/man/XftFontCheckGlyph.man
N xsrc/external/mit/libXft/dist/man/XftTextExtents32.man
N xsrc/external/mit/libXft/dist/man/XftTextRender32BE.man
N xsrc/external/mit/libXft/dist/man/XftDrawRect.man
N xsrc/external/mit/libXft/dist/man/XftDrawString16.man
N xsrc/external/mit/libXft/dist/man/XftTextRender16BE.man
N xsrc/external/mit/libXft/dist/man/XftFontCopy.man
N xsrc/external/mit/libXft/dist/man/XftCharSpecRender.man
N xsrc/external/mit/libXft/dist/man/XftTextRenderUtf16.man
N xsrc/external/mit/libXft/dist/man/XftTextRender32LE.man
N xsrc/external/mit/libXft/dist/man/XftDrawDestroy.man
N xsrc/external/mit/libXft/dist/man/XftTextRender8.man
N xsrc/external/mit/libXft/dist/man/XftXlfdParse.man
N xsrc/external/mit/libXft/dist/man/XftFontLoadGlyphs.man
N xsrc/external/mit/libXft/dist/man/XftDrawCreateAlpha.man
N xsrc/external/mit/libXft/dist/man/XftTextRender16LE.man
N xsrc/external/mit/libXft/dist/man/XftTextRender16.man
N xsrc/external/mit/libXft/dist/man/XftTextExtentsUtf8.man
N xsrc/external/mit/libXft/dist/man/XftDrawString8.man
N xsrc/external/mit/libXft/dist/man/XftDrawCreate.man
N xsrc/external/mit/libXft/dist/man/XftGlyphFontSpecRender.man
N xsrc/external/mit/libXft/dist/man/XftLockFace.man
N xsrc/external/mit/libXft/dist/man/XftFontOpenInfo.man
N xsrc/external/mit/libXft/dist/man/XftColorFree.man
N xsrc/external/mit/libXft/dist/man/XftUnlockFace.man
N xsrc/external/mit/libXft/dist/man/XftDrawSrcPicture.man
N xsrc/external/mit/libXft/dist/man/XftGlyphRender.man
N xsrc/external/mit/libXft/dist/man/XftDrawGlyphFontSpec.man
N xsrc/external/mit/libXft/dist/man/XftCharFontSpecRender.man
N xsrc/external/mit/libXft/dist/man/XftListFonts.man
N xsrc/external/mit/libXft/dist/man/XftDrawSetSubwindowMode.man
N xsrc/external/mit/libXft/dist/man/XftDrawDisplay.man
N xsrc/external/mit/libXft/dist/man/XftTextExtents8.man
U xsrc/external/mit/libXft/dist/man/Xft.man
N xsrc/external/mit/libXft/dist/man/XftDrawDrawable.man
N xsrc/external/mit/libXft/dist/man/XftFontOpenPattern.man
N xsrc/external/mit/libXft/dist/man/XftFontOpenName.man
N xsrc/external/mit/libXft/dist/man/XftFontInfoEqual.man
N xsrc/external/mit/libXft/dist/man/XftDrawStringUtf16.man
N xsrc/external/mit/libXft/dist/man/XftFontInfoDestroy.man
N xsrc/external/mit/libXft/dist/man/XftDrawColormap.man
N xsrc/external/mit/libXft/dist/man/XftDrawVisual.man
N xsrc/external/mit/libXft/dist/man/XftDrawCreateBitmap.man
N xsrc/external/mit/libXft/dist/man/XftGlyphExtents.man
N xsrc/external/mit/libXft/dist/man/XftDrawStringUtf8.man
N xsrc/external/mit/libXft/dist/man/XftInit.man
N xsrc/external/mit/libXft/dist/man/XftGlyphSpecRender.man
N xsrc/external/mit/libXft/dist/man/XftNameUnparse.man
N xsrc/external/mit/libXft/dist/man/XftFontInfoCreate.man
N xsrc/external/mit/libXft/dist/man/XftColorAllocName.man
N xsrc/external/mit/libXft/dist/man/XftInitFtLibrary.man
N xsrc/external/mit/libXft/dist/man/XftDrawGlyphs.man
N 

CVS import: xsrc/external/mit/libXft/dist

2022-09-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Sep  9 23:17:50 UTC 2022

Update of /cvsroot/xsrc/external/mit/libXft/dist
In directory ivanova.netbsd.org:/tmp/cvs-serv28575

Log Message:
initial import of libXft-2.3.5

Status:

Vendor Tag: xorg
Release Tags:   libXft-2-3-5

U xsrc/external/mit/libXft/dist/Makefile.in
U xsrc/external/mit/libXft/dist/README.md
U xsrc/external/mit/libXft/dist/config.guess
U xsrc/external/mit/libXft/dist/missing
U xsrc/external/mit/libXft/dist/compile
U xsrc/external/mit/libXft/dist/configure.ac
U xsrc/external/mit/libXft/dist/configure
U xsrc/external/mit/libXft/dist/config.sub
U xsrc/external/mit/libXft/dist/AUTHORS
U xsrc/external/mit/libXft/dist/COPYING
U xsrc/external/mit/libXft/dist/ChangeLog
U xsrc/external/mit/libXft/dist/NEWS
U xsrc/external/mit/libXft/dist/INSTALL
U xsrc/external/mit/libXft/dist/depcomp
U xsrc/external/mit/libXft/dist/ltmain.sh
U xsrc/external/mit/libXft/dist/aclocal.m4
U xsrc/external/mit/libXft/dist/install-sh
U xsrc/external/mit/libXft/dist/Makefile.am
U xsrc/external/mit/libXft/dist/xft.pc.in
U xsrc/external/mit/libXft/dist/config.h.in
U xsrc/external/mit/libXft/dist/include/X11/Xft/XftCompat.h
U xsrc/external/mit/libXft/dist/include/X11/Xft/Xft.h
U xsrc/external/mit/libXft/dist/include/X11/Xft/Xft.h.in
N xsrc/external/mit/libXft/dist/man/XftDrawGlyphSpec.man
U xsrc/external/mit/libXft/dist/man/Makefile.in
N xsrc/external/mit/libXft/dist/man/XftFontUnloadGlyphs.man
N xsrc/external/mit/libXft/dist/man/XftDrawCharFontSpec.man
N xsrc/external/mit/libXft/dist/man/XftNameParse.man
N xsrc/external/mit/libXft/dist/man/XftTextExtents16.man
N xsrc/external/mit/libXft/dist/man/XftFontOpenXlfd.man
N xsrc/external/mit/libXft/dist/man/XftFontOpen.man
N xsrc/external/mit/libXft/dist/man/XftFontInfoHash.man
N xsrc/external/mit/libXft/dist/man/XftColorAllocValue.man
N xsrc/external/mit/libXft/dist/man/XftDrawPicture.man
N xsrc/external/mit/libXft/dist/man/XftCharIndex.man
N xsrc/external/mit/libXft/dist/man/XftTextRenderUtf8.man
N xsrc/external/mit/libXft/dist/man/XftFontCheckGlyph.man
N xsrc/external/mit/libXft/dist/man/XftTextExtents32.man
N xsrc/external/mit/libXft/dist/man/XftTextRender32BE.man
N xsrc/external/mit/libXft/dist/man/XftDrawRect.man
N xsrc/external/mit/libXft/dist/man/XftDrawString16.man
N xsrc/external/mit/libXft/dist/man/XftTextRender16BE.man
N xsrc/external/mit/libXft/dist/man/XftFontCopy.man
N xsrc/external/mit/libXft/dist/man/XftCharSpecRender.man
N xsrc/external/mit/libXft/dist/man/XftTextRenderUtf16.man
N xsrc/external/mit/libXft/dist/man/XftTextRender32LE.man
N xsrc/external/mit/libXft/dist/man/XftDrawDestroy.man
N xsrc/external/mit/libXft/dist/man/XftTextRender8.man
N xsrc/external/mit/libXft/dist/man/XftXlfdParse.man
N xsrc/external/mit/libXft/dist/man/XftFontLoadGlyphs.man
N xsrc/external/mit/libXft/dist/man/XftDrawCreateAlpha.man
N xsrc/external/mit/libXft/dist/man/XftTextRender16LE.man
N xsrc/external/mit/libXft/dist/man/XftTextRender16.man
N xsrc/external/mit/libXft/dist/man/XftTextExtentsUtf8.man
N xsrc/external/mit/libXft/dist/man/XftDrawString8.man
N xsrc/external/mit/libXft/dist/man/XftDrawCreate.man
N xsrc/external/mit/libXft/dist/man/XftGlyphFontSpecRender.man
N xsrc/external/mit/libXft/dist/man/XftLockFace.man
N xsrc/external/mit/libXft/dist/man/XftFontOpenInfo.man
N xsrc/external/mit/libXft/dist/man/XftColorFree.man
N xsrc/external/mit/libXft/dist/man/XftUnlockFace.man
N xsrc/external/mit/libXft/dist/man/XftDrawSrcPicture.man
N xsrc/external/mit/libXft/dist/man/XftGlyphRender.man
N xsrc/external/mit/libXft/dist/man/XftDrawGlyphFontSpec.man
N xsrc/external/mit/libXft/dist/man/XftCharFontSpecRender.man
N xsrc/external/mit/libXft/dist/man/XftListFonts.man
N xsrc/external/mit/libXft/dist/man/XftDrawSetSubwindowMode.man
N xsrc/external/mit/libXft/dist/man/XftDrawDisplay.man
N xsrc/external/mit/libXft/dist/man/XftTextExtents8.man
U xsrc/external/mit/libXft/dist/man/Xft.man
N xsrc/external/mit/libXft/dist/man/XftDrawDrawable.man
N xsrc/external/mit/libXft/dist/man/XftFontOpenPattern.man
N xsrc/external/mit/libXft/dist/man/XftFontOpenName.man
N xsrc/external/mit/libXft/dist/man/XftFontInfoEqual.man
N xsrc/external/mit/libXft/dist/man/XftDrawStringUtf16.man
N xsrc/external/mit/libXft/dist/man/XftFontInfoDestroy.man
N xsrc/external/mit/libXft/dist/man/XftDrawColormap.man
N xsrc/external/mit/libXft/dist/man/XftDrawVisual.man
N xsrc/external/mit/libXft/dist/man/XftDrawCreateBitmap.man
N xsrc/external/mit/libXft/dist/man/XftGlyphExtents.man
N xsrc/external/mit/libXft/dist/man/XftDrawStringUtf8.man
N xsrc/external/mit/libXft/dist/man/XftInit.man
N xsrc/external/mit/libXft/dist/man/XftGlyphSpecRender.man
N xsrc/external/mit/libXft/dist/man/XftNameUnparse.man
N xsrc/external/mit/libXft/dist/man/XftFontInfoCreate.man
N xsrc/external/mit/libXft/dist/man/XftColorAllocName.man
N xsrc/external/mit/libXft/dist/man/XftInitFtLibrary.man
N xsrc/external/mit/libXft/dist/man/XftDrawGlyphs.man
N 

CVS commit: src/doc

2022-09-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Sep  9 22:15:14 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc: document grep -r change


To generate a diff of this commit:
cvs rdiff -u -r1.2904 -r1.2905 src/doc/CHANGES

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

Modified files:

Index: src/doc/CHANGES
diff -u src/doc/CHANGES:1.2904 src/doc/CHANGES:1.2905
--- src/doc/CHANGES:1.2904	Thu Sep  1 12:36:14 2022
+++ src/doc/CHANGES	Fri Sep  9 22:15:13 2022
@@ -1,4 +1,4 @@
-# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2904 $>
+# LIST OF CHANGES FROM LAST RELEASE:			<$Revision: 1.2905 $>
 #
 #
 # [Note: This file does not mention every change made to the NetBSD source tree.
@@ -665,3 +665,5 @@ Changes from NetBSD 9.0 to NetBSD 10.0:
 		[ryo 20220823]
 	acpi(4): Updated ACPICA to 20220331. [christos 20220827]
 	xen: Add experimental support for PVH dom0. [bouyer 20220901]
+	grep(1): with -r and no file argument, search current directory
+		[wiz 20220909]



CVS commit: src/doc

2022-09-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Sep  9 22:15:14 UTC 2022

Modified Files:
src/doc: CHANGES

Log Message:
doc: document grep -r change


To generate a diff of this commit:
cvs rdiff -u -r1.2904 -r1.2905 src/doc/CHANGES

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



CVS commit: src

2022-09-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Sep  9 22:14:29 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi
src/external/gpl2/grep/dist/doc: grep.1
src/external/gpl2/grep/dist/src: grep.c
src/tests/usr.bin/grep: Makefile t_grep.sh
Added Files:
src/tests/usr.bin/grep: d_recurse_noarg.out

Log Message:
grep: when -r is used, but no path argument provided, search the current dir

As discussed on tech-userlevel.


To generate a diff of this commit:
cvs rdiff -u -r1.1222 -r1.1223 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/grep/dist/doc/grep.1
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/grep/dist/src/grep.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/grep/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/grep/d_recurse_noarg.out
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/grep/t_grep.sh

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



CVS commit: src

2022-09-09 Thread Thomas Klausner
Module Name:src
Committed By:   wiz
Date:   Fri Sep  9 22:14:29 UTC 2022

Modified Files:
src/distrib/sets/lists/tests: mi
src/external/gpl2/grep/dist/doc: grep.1
src/external/gpl2/grep/dist/src: grep.c
src/tests/usr.bin/grep: Makefile t_grep.sh
Added Files:
src/tests/usr.bin/grep: d_recurse_noarg.out

Log Message:
grep: when -r is used, but no path argument provided, search the current dir

As discussed on tech-userlevel.


To generate a diff of this commit:
cvs rdiff -u -r1.1222 -r1.1223 src/distrib/sets/lists/tests/mi
cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/grep/dist/doc/grep.1
cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/grep/dist/src/grep.c
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/grep/Makefile
cvs rdiff -u -r0 -r1.1 src/tests/usr.bin/grep/d_recurse_noarg.out
cvs rdiff -u -r1.6 -r1.7 src/tests/usr.bin/grep/t_grep.sh

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

Modified files:

Index: src/distrib/sets/lists/tests/mi
diff -u src/distrib/sets/lists/tests/mi:1.1222 src/distrib/sets/lists/tests/mi:1.1223
--- src/distrib/sets/lists/tests/mi:1.1222	Sat Sep  3 03:33:37 2022
+++ src/distrib/sets/lists/tests/mi	Fri Sep  9 22:14:28 2022
@@ -1,4 +1,4 @@
-# $NetBSD: mi,v 1.1222 2022/09/03 03:33:37 rillig Exp $
+# $NetBSD: mi,v 1.1223 2022/09/09 22:14:28 wiz Exp $
 #
 # Note: don't delete entries from here - mark them as "obsolete" instead.
 #
@@ -4750,6 +4750,7 @@
 ./usr/tests/usr.bin/grep/d_invert.in			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/grep/d_invert.out			tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/grep/d_recurse.out			tests-usr.bin-tests	compattestfile,atf
+./usr/tests/usr.bin/grep/d_recurse_noarg.out		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/grep/d_recurse_symlink.err		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/grep/d_recurse_symlink.out		tests-usr.bin-tests	compattestfile,atf
 ./usr/tests/usr.bin/grep/d_whole_line.out		tests-usr.bin-tests	compattestfile,atf

Index: src/external/gpl2/grep/dist/doc/grep.1
diff -u src/external/gpl2/grep/dist/doc/grep.1:1.2 src/external/gpl2/grep/dist/doc/grep.1:1.3
--- src/external/gpl2/grep/dist/doc/grep.1:1.2	Sun Jan 10 22:16:40 2016
+++ src/external/gpl2/grep/dist/doc/grep.1	Fri Sep  9 22:14:29 2022
@@ -1,8 +1,8 @@
-.\"	$NetBSD: grep.1,v 1.2 2016/01/10 22:16:40 christos Exp $
+.\"	$NetBSD: grep.1,v 1.3 2022/09/09 22:14:29 wiz Exp $
 .\"
 .\" grep man page
 .\"d Id: grep.1,v 1.23 2002/01/22 13:20:04 bero Exp 
-.TH GREP 1 "June 16 2003" "GNU Project"
+.TH GREP 1 "September 3 2022" "GNU Project"
 .SH NAME
 grep, egrep, fgrep \- print lines matching a pattern
 .SH SYNOPSIS
@@ -312,6 +312,11 @@ Read all files under each directory, rec
 this is equivalent to the
 .B "\-d recurse"
 option.
+If no
+.IR FILE
+is given,
+.BR grep
+searches the current working directory.
 .TP
 .BR "\fR \fP \-\^\-include=" PATTERN
 Recurse in directories only searching file matching

Index: src/external/gpl2/grep/dist/src/grep.c
diff -u src/external/gpl2/grep/dist/src/grep.c:1.4 src/external/gpl2/grep/dist/src/grep.c:1.5
--- src/external/gpl2/grep/dist/src/grep.c:1.4	Tue Dec 28 19:22:58 2021
+++ src/external/gpl2/grep/dist/src/grep.c	Fri Sep  9 22:14:29 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: grep.c,v 1.4 2021/12/28 19:22:58 christos Exp $	*/
+/*	$NetBSD: grep.c,v 1.5 2022/09/09 22:14:29 wiz Exp $	*/
 
 /* grep.c - main driver file for grep.
Copyright 1992, 1997-1999, 2000 Free Software Foundation, Inc.
@@ -1764,10 +1764,8 @@ warranty; not even for MERCHANTABILITY o
 }
   else
 {
-  if (directories == RECURSE_DIRECTORIES) {
-	error (0, 0, _("warning: recursive search of stdin"));
-  }
-  status = grepfile ((char *) NULL, _base);
+  status = grepfile(directories == RECURSE_DIRECTORIES ? "." : (char *) NULL,
+			_base);
 }
 
   /* We register via atexit() to test stdout.  */

Index: src/tests/usr.bin/grep/Makefile
diff -u src/tests/usr.bin/grep/Makefile:1.1 src/tests/usr.bin/grep/Makefile:1.2
--- src/tests/usr.bin/grep/Makefile:1.1	Sat Mar 17 16:33:13 2012
+++ src/tests/usr.bin/grep/Makefile	Fri Sep  9 22:14:29 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.1 2012/03/17 16:33:13 jruoho Exp $
+# $NetBSD: Makefile,v 1.2 2022/09/09 22:14:29 wiz Exp $
 
 NOMAN=		# defined
 
@@ -30,6 +30,7 @@ FILES+=		d_input
 FILES+=		d_invert.in
 FILES+=		d_invert.out
 FILES+=		d_recurse.out
+FILES+=		d_recurse_noarg.out
 FILES+=		d_recurse_symlink.err
 FILES+=		d_recurse_symlink.out
 FILES+=		d_whole_line.out

Index: src/tests/usr.bin/grep/t_grep.sh
diff -u src/tests/usr.bin/grep/t_grep.sh:1.6 src/tests/usr.bin/grep/t_grep.sh:1.7
--- src/tests/usr.bin/grep/t_grep.sh:1.6	Mon Aug 30 23:14:14 2021
+++ src/tests/usr.bin/grep/t_grep.sh	Fri Sep  9 22:14:29 2022
@@ -1,4 +1,4 @@
-# $NetBSD: t_grep.sh,v 1.6 2021/08/30 23:14:14 rillig Exp $
+# $NetBSD: t_grep.sh,v 1.7 2022/09/09 22:14:29 wiz Exp $
 #
 # Copyright 

CVS commit: src/games/fortune/datfiles

2022-09-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Sep  9 19:37:15 UTC 2022

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
fortunes: add something


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/games/fortune/datfiles/fortunes

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

Modified files:

Index: src/games/fortune/datfiles/fortunes
diff -u src/games/fortune/datfiles/fortunes:1.98 src/games/fortune/datfiles/fortunes:1.99
--- src/games/fortune/datfiles/fortunes:1.98	Fri Aug 26 20:07:04 2022
+++ src/games/fortune/datfiles/fortunes	Fri Sep  9 19:37:15 2022
@@ -16311,3 +16311,5 @@ Thereisnospacebar.
 metropole, n.: The axis on which the subway turns.
 %
 Dryads are usually lucky. It's well known that fortune favors the boled.
+%
+Responsible wizards always run their scrolls past a spell-checker.



CVS commit: src/games/fortune/datfiles

2022-09-09 Thread David A. Holland
Module Name:src
Committed By:   dholland
Date:   Fri Sep  9 19:37:15 UTC 2022

Modified Files:
src/games/fortune/datfiles: fortunes

Log Message:
fortunes: add something


To generate a diff of this commit:
cvs rdiff -u -r1.98 -r1.99 src/games/fortune/datfiles/fortunes

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



CVS commit: src/external/mit/xorg/tools/mkfontscale

2022-09-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep  9 19:15:20 UTC 2022

Modified Files:
src/external/mit/xorg/tools/mkfontscale: Makefile

Log Message:
add missing reallocarray.c.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/mit/xorg/tools/mkfontscale/Makefile

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

Modified files:

Index: src/external/mit/xorg/tools/mkfontscale/Makefile
diff -u src/external/mit/xorg/tools/mkfontscale/Makefile:1.15 src/external/mit/xorg/tools/mkfontscale/Makefile:1.16
--- src/external/mit/xorg/tools/mkfontscale/Makefile:1.15	Sat Jul 20 03:54:50 2019
+++ src/external/mit/xorg/tools/mkfontscale/Makefile	Fri Sep  9 19:15:20 2022
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile,v 1.15 2019/07/20 03:54:50 mrg Exp $
+#	$NetBSD: Makefile,v 1.16 2022/09/09 19:15:20 mrg Exp $
 
 .include 
 
@@ -12,7 +12,8 @@ SRCS.mkfontscale=	mkfontscale.c hash.c i
 .PATH:	${FREETYPE}/src/base
 SRCS.freetype+=	ftbase.c ftbbox.c ftbdf.c ftdebug.c \
 		ftglyph.c ftinit.c ftmm.c ftpfr.c ftstroke.c ftsynth.c \
-		ftsystem.c fttype1.c ftwinfnt.c ftbitmap.c
+		ftsystem.c fttype1.c ftwinfnt.c ftbitmap.c \
+		reallocarray.c
 
 .PATH: ${FREETYPE}/src/autofit
 SRCS.freetype+=	autofit.c



CVS commit: src/external/mit/xorg/tools/mkfontscale

2022-09-09 Thread matthew green
Module Name:src
Committed By:   mrg
Date:   Fri Sep  9 19:15:20 UTC 2022

Modified Files:
src/external/mit/xorg/tools/mkfontscale: Makefile

Log Message:
add missing reallocarray.c.


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/external/mit/xorg/tools/mkfontscale/Makefile

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



CVS commit: src/usr.bin/make/unit-tests

2022-09-09 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Sep  9 18:36:16 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: Makefile export.mk make-exported.mk

Log Message:
Handle deprecation of egrep


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/export.mk
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/make-exported.mk

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



CVS commit: src/usr.bin/make/unit-tests

2022-09-09 Thread Simon J. Gerraty
Module Name:src
Committed By:   sjg
Date:   Fri Sep  9 18:36:16 UTC 2022

Modified Files:
src/usr.bin/make/unit-tests: Makefile export.mk make-exported.mk

Log Message:
Handle deprecation of egrep


To generate a diff of this commit:
cvs rdiff -u -r1.324 -r1.325 src/usr.bin/make/unit-tests/Makefile
cvs rdiff -u -r1.11 -r1.12 src/usr.bin/make/unit-tests/export.mk
cvs rdiff -u -r1.6 -r1.7 src/usr.bin/make/unit-tests/make-exported.mk

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

Modified files:

Index: src/usr.bin/make/unit-tests/Makefile
diff -u src/usr.bin/make/unit-tests/Makefile:1.324 src/usr.bin/make/unit-tests/Makefile:1.325
--- src/usr.bin/make/unit-tests/Makefile:1.324	Sat Sep  3 15:03:32 2022
+++ src/usr.bin/make/unit-tests/Makefile	Fri Sep  9 18:36:15 2022
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.324 2022/09/03 15:03:32 sjg Exp $
+# $NetBSD: Makefile,v 1.325 2022/09/09 18:36:15 sjg Exp $
 #
 # Unit tests for make(1)
 #
@@ -673,7 +673,15 @@ TMPDIR:=	/tmp/uid${.MAKE.UID}
 _!= mkdir -p ${TMPDIR}
 .endif
 
-MAKE_TEST_ENV=	MALLOC_OPTIONS="JA"	# for jemalloc 100
+# Some systems have deprecated egrep for grep -E
+# but not everyone supports that
+.if ${.MAKE.OS:NLinux} == ""
+EGREP= grep -E
+.endif
+EGREP?= egrep
+
+MAKE_TEST_ENV=  EGREP="${EGREP}"
+MAKE_TEST_ENV+=	MALLOC_OPTIONS="JA"	# for jemalloc 100
 MAKE_TEST_ENV+=	MALLOC_CONF="junk:true"	# for jemalloc 510
 MAKE_TEST_ENV+= TMPDIR=${TMPDIR}
 
@@ -722,6 +730,7 @@ _SED_CMDS+=	-e 's,${.CURDIR},,g'
 _SED_CMDS+=	-e 's,/,,g'
 _SED_CMDS+=	-e 's,${UNIT_TESTS:S,.,\\.,g}/,,g'
 _SED_CMDS+=	-e '/MAKE_VERSION/d'
+_SED_CMDS+=	-e '/EGREP=/d'
 
 .rawout.out:
 	@${TOOL_SED} ${_SED_CMDS} ${SED_CMDS.${.PREFIX:T}} \

Index: src/usr.bin/make/unit-tests/export.mk
diff -u src/usr.bin/make/unit-tests/export.mk:1.11 src/usr.bin/make/unit-tests/export.mk:1.12
--- src/usr.bin/make/unit-tests/export.mk:1.11	Sun Dec  5 14:57:36 2021
+++ src/usr.bin/make/unit-tests/export.mk	Fri Sep  9 18:36:15 2022
@@ -1,4 +1,4 @@
-# $NetBSD: export.mk,v 1.11 2021/12/05 14:57:36 rillig Exp $
+# $NetBSD: export.mk,v 1.12 2022/09/09 18:36:15 sjg Exp $
 
 UT_TEST=	export
 UT_FOO=		foo${BAR}
@@ -40,7 +40,7 @@ BAR=	bar is ${UT_FU}
 
 .MAKE.EXPORTED+=	UT_ZOO UT_TEST
 
-FILTER_CMD?=	egrep -v '^(MAKEFLAGS|MALLOC_.*|PATH|PWD|SHLVL|_|&)='
+FILTER_CMD?=	${EGREP} -v '^(MAKEFLAGS|MALLOC_.*|PATH|PWD|SHLVL|_|&)='
 
 all:
 	@env | ${FILTER_CMD} | sort

Index: src/usr.bin/make/unit-tests/make-exported.mk
diff -u src/usr.bin/make/unit-tests/make-exported.mk:1.6 src/usr.bin/make/unit-tests/make-exported.mk:1.7
--- src/usr.bin/make/unit-tests/make-exported.mk:1.6	Mon Oct  5 19:27:48 2020
+++ src/usr.bin/make/unit-tests/make-exported.mk	Fri Sep  9 18:36:15 2022
@@ -1,4 +1,4 @@
-# $NetBSD: make-exported.mk,v 1.6 2020/10/05 19:27:48 rillig Exp $
+# $NetBSD: make-exported.mk,v 1.7 2022/09/09 18:36:15 sjg Exp $
 #
 # As of 2020-08-09, the code in Var_Export is shared between the .export
 # directive and the .MAKE.EXPORTED variable.  This leads to non-obvious
@@ -22,4 +22,4 @@ UT_VAR=		${UNEXPANDED}
 .MAKE.EXPORTED=		-literal UT_VAR
 
 all:
-	@env | sort | grep -E '^UT_|make-exported-value' || true
+	@env | sort | ${EGREP} '^UT_|make-exported-value' || true



CVS commit: [netbsd-8] src/doc

2022-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  9 18:25:13 UTC 2022

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Ticket #1760


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.146 -r1.1.2.147 src/doc/CHANGES-8.3

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

Modified files:

Index: src/doc/CHANGES-8.3
diff -u src/doc/CHANGES-8.3:1.1.2.146 src/doc/CHANGES-8.3:1.1.2.147
--- src/doc/CHANGES-8.3:1.1.2.146	Wed Sep  7 10:10:55 2022
+++ src/doc/CHANGES-8.3	Fri Sep  9 18:25:13 2022
@@ -1,4 +1,4 @@
- $NetBSD: CHANGES-8.3,v 1.1.2.146 2022/09/07 10:10:55 martin Exp $
+ $NetBSD: CHANGES-8.3,v 1.1.2.147 2022/09/09 18:25:13 martin Exp $
 
 A complete list of changes from the NetBSD 8.2 release to the NetBSD 8.3
 release:
@@ -2774,3 +2774,8 @@ sys/dev/pci/if_wmreg.h1.126-1.127
 	  - KNF.
 	[msaitoh, ticket #1759]
 
+sys/kern/kern_core.c1.36
+
+	Fix kauth credential reference leak.
+	[christos, ticket #1760]
+



CVS commit: [netbsd-8] src/doc

2022-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  9 18:25:13 UTC 2022

Modified Files:
src/doc [netbsd-8]: CHANGES-8.3

Log Message:
Ticket #1760


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.146 -r1.1.2.147 src/doc/CHANGES-8.3

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



CVS commit: [netbsd-8] src/sys/kern

2022-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  9 18:24:20 UTC 2022

Modified Files:
src/sys/kern [netbsd-8]: kern_core.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1760):

sys/kern/kern_core.c: revision 1.36

Don't forget to free the cred we just held.
Thanks to Chris J-D (chris at accessvector dot net)

While here, de-duplicate the mutex exit sequence.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.10.1 src/sys/kern/kern_core.c

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

Modified files:

Index: src/sys/kern/kern_core.c
diff -u src/sys/kern/kern_core.c:1.24 src/sys/kern/kern_core.c:1.24.10.1
--- src/sys/kern/kern_core.c:1.24	Thu Jul  7 06:55:43 2016
+++ src/sys/kern/kern_core.c	Fri Sep  9 18:24:20 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_core.c,v 1.24 2016/07/07 06:55:43 msaitoh Exp $	*/
+/*	$NetBSD: kern_core.c,v 1.24.10.1 2022/09/09 18:24:20 martin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.24 2016/07/07 06:55:43 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.24.10.1 2022/09/09 18:24:20 martin Exp $");
 
 #include 
 #include 
@@ -95,7 +95,7 @@ coredump(struct lwp *l, const char *patt
 	struct vnode		*vp;
 	struct proc		*p;
 	struct vmspace		*vm;
-	kauth_cred_t		cred;
+	kauth_cred_t		cred = NULL;
 	struct pathbuf		*pb;
 	struct nameidata	nd;
 	struct vattr		vattr;
@@ -120,9 +120,7 @@ coredump(struct lwp *l, const char *patt
 	if (USPACE + ctob(vm->vm_dsize + vm->vm_ssize) >=
 	p->p_rlimit[RLIMIT_CORE].rlim_cur) {
 		error = EFBIG;		/* better error code? */
-		mutex_exit(p->p_lock);
-		mutex_exit(proc_lock);
-		goto done;
+		goto release;
 	}
 
 	/*
@@ -139,9 +137,7 @@ coredump(struct lwp *l, const char *patt
 	if (p->p_flag & PK_SUGID) {
 		if (!security_setidcore_dump) {
 			error = EPERM;
-			mutex_exit(p->p_lock);
-			mutex_exit(proc_lock);
-			goto done;
+			goto release;
 		}
 		pattern = security_setidcore_path;
 	}
@@ -155,11 +151,8 @@ coredump(struct lwp *l, const char *patt
 	error = coredump_buildname(p, name, pattern, MAXPATHLEN);
 	mutex_exit(>pl_lock);
 
-	if (error) {
-		mutex_exit(p->p_lock);
-		mutex_exit(proc_lock);
-		goto done;
-	}
+	if (error)
+		goto release;
 
 	/*
 	 * On a simple filename, see if the filesystem allow us to write
@@ -173,6 +166,7 @@ coredump(struct lwp *l, const char *patt
 			error = EPERM;
 	}
 
+release:
 	mutex_exit(p->p_lock);
 	mutex_exit(proc_lock);
 	if (error)
@@ -260,6 +254,8 @@ coredump(struct lwp *l, const char *patt
 	if (error == 0)
 		error = error1;
 done:
+	if (cred != NULL)
+		kauth_cred_free(cred);
 	if (name != NULL)
 		PNBUF_PUT(name);
 	return error;



CVS commit: [netbsd-8] src/sys/kern

2022-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  9 18:24:20 UTC 2022

Modified Files:
src/sys/kern [netbsd-8]: kern_core.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1760):

sys/kern/kern_core.c: revision 1.36

Don't forget to free the cred we just held.
Thanks to Chris J-D (chris at accessvector dot net)

While here, de-duplicate the mutex exit sequence.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.24.10.1 src/sys/kern/kern_core.c

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



CVS commit: [netbsd-9] src/doc

2022-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  9 18:21:47 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Ticket #1516


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/doc/CHANGES-9.4

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

Modified files:

Index: src/doc/CHANGES-9.4
diff -u src/doc/CHANGES-9.4:1.1.2.9 src/doc/CHANGES-9.4:1.1.2.10
--- src/doc/CHANGES-9.4:1.1.2.9	Wed Sep  7 10:07:43 2022
+++ src/doc/CHANGES-9.4	Fri Sep  9 18:21:47 2022
@@ -1,4 +1,4 @@
-# $NetBSD: CHANGES-9.4,v 1.1.2.9 2022/09/07 10:07:43 martin Exp $
+# $NetBSD: CHANGES-9.4,v 1.1.2.10 2022/09/09 18:21:47 martin Exp $
 
 A complete list of changes from the NetBSD 9.3 release to the NetBSD 9.4
 release:
@@ -137,3 +137,8 @@ sys/dev/pci/if_wmreg.h1.126-1.127
 	  - KNF.
 	[msaitoh, ticket #1515]
 
+sys/kern/kern_core.c1.36
+
+	Fix kauth credential reference leak.
+	[christos, ticket #1516]
+



CVS commit: [netbsd-9] src/doc

2022-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  9 18:21:47 UTC 2022

Modified Files:
src/doc [netbsd-9]: CHANGES-9.4

Log Message:
Ticket #1516


To generate a diff of this commit:
cvs rdiff -u -r1.1.2.9 -r1.1.2.10 src/doc/CHANGES-9.4

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



CVS commit: [netbsd-9] src/sys/kern

2022-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  9 18:20:51 UTC 2022

Modified Files:
src/sys/kern [netbsd-9]: kern_core.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1516):

sys/kern/kern_core.c: revision 1.36

Don't forget to free the cred we just held.
Thanks to Chris J-D (chris at accessvector dot net)

While here, de-duplicate the mutex exit sequence.


To generate a diff of this commit:
cvs rdiff -u -r1.24.22.1 -r1.24.22.2 src/sys/kern/kern_core.c

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



CVS commit: [netbsd-9] src/sys/kern

2022-09-09 Thread Martin Husemann
Module Name:src
Committed By:   martin
Date:   Fri Sep  9 18:20:51 UTC 2022

Modified Files:
src/sys/kern [netbsd-9]: kern_core.c

Log Message:
Pull up following revision(s) (requested by christos in ticket #1516):

sys/kern/kern_core.c: revision 1.36

Don't forget to free the cred we just held.
Thanks to Chris J-D (chris at accessvector dot net)

While here, de-duplicate the mutex exit sequence.


To generate a diff of this commit:
cvs rdiff -u -r1.24.22.1 -r1.24.22.2 src/sys/kern/kern_core.c

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

Modified files:

Index: src/sys/kern/kern_core.c
diff -u src/sys/kern/kern_core.c:1.24.22.1 src/sys/kern/kern_core.c:1.24.22.2
--- src/sys/kern/kern_core.c:1.24.22.1	Mon Nov 11 17:11:07 2019
+++ src/sys/kern/kern_core.c	Fri Sep  9 18:20:51 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_core.c,v 1.24.22.1 2019/11/11 17:11:07 martin Exp $	*/
+/*	$NetBSD: kern_core.c,v 1.24.22.2 2022/09/09 18:20:51 martin Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.24.22.1 2019/11/11 17:11:07 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.24.22.2 2022/09/09 18:20:51 martin Exp $");
 
 #include 
 #include 
@@ -97,7 +97,7 @@ coredump(struct lwp *l, const char *patt
 	struct vnode		*vp;
 	struct proc		*p;
 	struct vmspace		*vm;
-	kauth_cred_t		cred;
+	kauth_cred_t		cred = NULL;
 	struct pathbuf		*pb;
 	struct nameidata	nd;
 	struct vattr		vattr;
@@ -122,9 +122,7 @@ coredump(struct lwp *l, const char *patt
 	if (USPACE + ctob(vm->vm_dsize + vm->vm_ssize) >=
 	p->p_rlimit[RLIMIT_CORE].rlim_cur) {
 		error = EFBIG;		/* better error code? */
-		mutex_exit(p->p_lock);
-		mutex_exit(proc_lock);
-		goto done;
+		goto release;
 	}
 
 	/*
@@ -141,9 +139,7 @@ coredump(struct lwp *l, const char *patt
 	if (p->p_flag & PK_SUGID) {
 		if (!security_setidcore_dump) {
 			error = EPERM;
-			mutex_exit(p->p_lock);
-			mutex_exit(proc_lock);
-			goto done;
+			goto release;
 		}
 		pattern = security_setidcore_path;
 	}
@@ -157,11 +153,8 @@ coredump(struct lwp *l, const char *patt
 	error = coredump_buildname(p, name, pattern, MAXPATHLEN);
 	mutex_exit(>pl_lock);
 
-	if (error) {
-		mutex_exit(p->p_lock);
-		mutex_exit(proc_lock);
-		goto done;
-	}
+	if (error)
+		goto release;
 
 	/*
 	 * On a simple filename, see if the filesystem allow us to write
@@ -175,6 +168,7 @@ coredump(struct lwp *l, const char *patt
 			error = EPERM;
 	}
 
+release:
 	mutex_exit(p->p_lock);
 	mutex_exit(proc_lock);
 	if (error)
@@ -262,6 +256,8 @@ coredump(struct lwp *l, const char *patt
 	if (error == 0)
 		error = error1;
 done:
+	if (cred != NULL)
+		kauth_cred_free(cred);
 	if (name != NULL)
 		PNBUF_PUT(name);
 	return error;



CVS commit: src/sys/arch/powerpc/fpu

2022-09-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Sep  9 14:35:27 UTC 2022

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
G/C ``notyet''; OPC_load_st_62 == std{,u} are integer insns.
No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/powerpc/fpu/fpu_emu.c

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

Modified files:

Index: src/sys/arch/powerpc/fpu/fpu_emu.c
diff -u src/sys/arch/powerpc/fpu/fpu_emu.c:1.55 src/sys/arch/powerpc/fpu/fpu_emu.c:1.56
--- src/sys/arch/powerpc/fpu/fpu_emu.c:1.55	Wed Sep  7 06:53:03 2022
+++ src/sys/arch/powerpc/fpu/fpu_emu.c	Fri Sep  9 14:35:27 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: fpu_emu.c,v 1.55 2022/09/07 06:53:03 rin Exp $ */
+/*	$NetBSD: fpu_emu.c,v 1.56 2022/09/09 14:35:27 rin Exp $ */
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -76,7 +76,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.55 2022/09/07 06:53:03 rin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fpu_emu.c,v 1.56 2022/09/09 14:35:27 rin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_ddb.h"
@@ -452,11 +452,6 @@ fpu_execute(struct trapframe *tf, struct
 			tf->tf_fixreg[ra] = addr;
 		/* Complete. */
 		return (0);
-#ifdef notyet
-	} else if (instr.i_any.i_opcd == OPC_load_st_62) {
-		/* These are 64-bit extenstions */
-		return (NOTFPU);
-#endif
 	} else if (instr.i_any.i_opcd == OPC_sp_fp_59 ||
 		instr.i_any.i_opcd == OPC_dp_fp_63) {
 



CVS commit: src/sys/arch/powerpc/fpu

2022-09-09 Thread Rin Okuyama
Module Name:src
Committed By:   rin
Date:   Fri Sep  9 14:35:27 UTC 2022

Modified Files:
src/sys/arch/powerpc/fpu: fpu_emu.c

Log Message:
G/C ``notyet''; OPC_load_st_62 == std{,u} are integer insns.
No binary changes.


To generate a diff of this commit:
cvs rdiff -u -r1.55 -r1.56 src/sys/arch/powerpc/fpu/fpu_emu.c

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



CVS commit: src/sys/kern

2022-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  9 14:30:17 UTC 2022

Modified Files:
src/sys/kern: kern_core.c

Log Message:
Don't forget to free the cred we just held.
Thanks to Chris J-D (chris at accessvector dot net)
While here, de-duplicate the mutex exit sequence.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/kern_core.c

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

Modified files:

Index: src/sys/kern/kern_core.c
diff -u src/sys/kern/kern_core.c:1.35 src/sys/kern/kern_core.c:1.36
--- src/sys/kern/kern_core.c:1.35	Tue Jun 29 18:40:53 2021
+++ src/sys/kern/kern_core.c	Fri Sep  9 10:30:17 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: kern_core.c,v 1.35 2021/06/29 22:40:53 dholland Exp $	*/
+/*	$NetBSD: kern_core.c,v 1.36 2022/09/09 14:30:17 christos Exp $	*/
 
 /*
  * Copyright (c) 1982, 1986, 1989, 1991, 1993
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.35 2021/06/29 22:40:53 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_core.c,v 1.36 2022/09/09 14:30:17 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -121,7 +121,7 @@ coredump(struct lwp *l, const char *patt
 	struct vnode		*vp;
 	struct proc		*p;
 	struct vmspace		*vm;
-	kauth_cred_t		cred;
+	kauth_cred_t		cred = NULL;
 	struct pathbuf		*pb;
 	struct vattr		vattr;
 	struct coredump_iostate	io;
@@ -145,9 +145,7 @@ coredump(struct lwp *l, const char *patt
 	if (USPACE + ctob(vm->vm_dsize + vm->vm_ssize) >=
 	p->p_rlimit[RLIMIT_CORE].rlim_cur) {
 		error = EFBIG;		/* better error code? */
-		mutex_exit(p->p_lock);
-		mutex_exit(_lock);
-		goto done;
+		goto release;
 	}
 
 	/*
@@ -164,9 +162,7 @@ coredump(struct lwp *l, const char *patt
 	if (p->p_flag & PK_SUGID) {
 		if (!security_setidcore_dump) {
 			error = EPERM;
-			mutex_exit(p->p_lock);
-			mutex_exit(_lock);
-			goto done;
+			goto release;
 		}
 		pattern = security_setidcore_path;
 	}
@@ -180,11 +176,8 @@ coredump(struct lwp *l, const char *patt
 	error = coredump_buildname(p, name, pattern, MAXPATHLEN);
 	mutex_exit(>pl_lock);
 
-	if (error) {
-		mutex_exit(p->p_lock);
-		mutex_exit(_lock);
-		goto done;
-	}
+	if (error)
+		goto release;
 
 	/*
 	 * On a simple filename, see if the filesystem allow us to write
@@ -198,6 +191,7 @@ coredump(struct lwp *l, const char *patt
 			error = EPERM;
 	}
 
+release:
 	mutex_exit(p->p_lock);
 	mutex_exit(_lock);
 	if (error)
@@ -284,6 +278,8 @@ coredump(struct lwp *l, const char *patt
 	if (error == 0)
 		error = error1;
 done:
+	if (cred != NULL)
+		kauth_cred_free(cred);
 	if (name != NULL)
 		PNBUF_PUT(name);
 	return error;



CVS commit: src/sys/kern

2022-09-09 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Fri Sep  9 14:30:17 UTC 2022

Modified Files:
src/sys/kern: kern_core.c

Log Message:
Don't forget to free the cred we just held.
Thanks to Chris J-D (chris at accessvector dot net)
While here, de-duplicate the mutex exit sequence.


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/kern/kern_core.c

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



CVS commit: src/share/misc

2022-09-09 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Sep  9 14:16:16 UTC 2022

Modified Files:
src/share/misc: acronyms

Log Message:
Add YMMD


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/share/misc/acronyms

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

Modified files:

Index: src/share/misc/acronyms
diff -u src/share/misc/acronyms:1.312 src/share/misc/acronyms:1.313
--- src/share/misc/acronyms:1.312	Thu Sep 16 08:33:24 2021
+++ src/share/misc/acronyms	Fri Sep  9 14:16:16 2022
@@ -1,4 +1,4 @@
-$NetBSD: acronyms,v 1.312 2021/09/16 08:33:24 leot Exp $
+$NetBSD: acronyms,v 1.313 2022/09/09 14:16:16 pgoyette Exp $
 10Q	thank you
 10X	thanks
 1337	elite ("leet")
@@ -651,6 +651,7 @@ YHBT	you have been trolled
 YHL	you have lost
 YKWIM	you know what I mean
 YMMV	your mileage may vary
+YMMD	you made my day
 YOLO	you only live once
 YW	you're welcome
 YWSYLS	you win some, you lose some



CVS commit: src/share/misc

2022-09-09 Thread Paul Goyette
Module Name:src
Committed By:   pgoyette
Date:   Fri Sep  9 14:16:16 UTC 2022

Modified Files:
src/share/misc: acronyms

Log Message:
Add YMMD


To generate a diff of this commit:
cvs rdiff -u -r1.312 -r1.313 src/share/misc/acronyms

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



CVS commit: src/usr.bin/make

2022-09-09 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Sep  9 10:57:39 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): add space before the punctuation argument


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 src/usr.bin/make/make.1

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



CVS commit: src/usr.bin/make

2022-09-09 Thread Valeriy E. Ushakov
Module Name:src
Committed By:   uwe
Date:   Fri Sep  9 10:57:39 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make(1): add space before the punctuation argument


To generate a diff of this commit:
cvs rdiff -u -r1.339 -r1.340 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.339 src/usr.bin/make/make.1:1.340
--- src/usr.bin/make/make.1:1.339	Fri Sep  9 06:23:36 2022
+++ src/usr.bin/make/make.1	Fri Sep  9 10:57:39 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.339 2022/09/09 06:23:36 rillig Exp $
+.\"	$NetBSD: make.1,v 1.340 2022/09/09 10:57:39 uwe Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -237,7 +237,7 @@ Let environment variables override globa
 Specify a makefile to read instead of the default
 .Pa makefile
 or
-.Pa Makefile.
+.Pa Makefile .
 If
 .Ar makefile
 is



CVS commit: xsrc/external/mit/libXfont2/include

2022-09-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Sep  9 06:58:24 UTC 2022

Removed Files:
xsrc/external/mit/libXfont2/include: config.h

Log Message:
remove obsolete file.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 xsrc/external/mit/libXfont2/include/config.h

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



CVS commit: xsrc/external/mit/libXfont2/include

2022-09-09 Thread matthew green
Module Name:xsrc
Committed By:   mrg
Date:   Fri Sep  9 06:58:24 UTC 2022

Removed Files:
xsrc/external/mit/libXfont2/include: config.h

Log Message:
remove obsolete file.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r0 xsrc/external/mit/libXfont2/include/config.h

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



CVS commit: src/usr.bin/make

2022-09-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  9 06:23:36 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: clean up and make the description more accurate

Most changes are editorial.  Notable exceptions are:

The ':Q' in MAKE_PRINT_VAR_ON_ERROR was wrongly added in the previous
commit.  As that variable does not produce a shell command, there is no
point in quoting the characters.

Since 2012.10.07.19.17.31, make doesn't complain anymore if a shell
command in compat mode expands to an empty string, which removes the
need to "keep make happy".


To generate a diff of this commit:
cvs rdiff -u -r1.338 -r1.339 src/usr.bin/make/make.1

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

Modified files:

Index: src/usr.bin/make/make.1
diff -u src/usr.bin/make/make.1:1.338 src/usr.bin/make/make.1:1.339
--- src/usr.bin/make/make.1:1.338	Fri Sep  9 05:27:32 2022
+++ src/usr.bin/make/make.1	Fri Sep  9 06:23:36 2022
@@ -1,4 +1,4 @@
-.\"	$NetBSD: make.1,v 1.338 2022/09/09 05:27:32 rillig Exp $
+.\"	$NetBSD: make.1,v 1.339 2022/09/09 06:23:36 rillig Exp $
 .\"
 .\" Copyright (c) 1990, 1993
 .\"	The Regents of the University of California.  All rights reserved.
@@ -856,15 +856,14 @@ The name that
 .Nm
 was executed with
 .Pq Va argv[0] .
-For compatibility
+For compatibility,
 .Nm
 also sets
 .Va .MAKE
 with the same value.
 The preferred variable to use is the environment variable
 .Ev MAKE
-because it is more compatible with other versions of
-.Nm
+because it is more compatible with other make variants
 and cannot be confused with the special target with the same name.
 .It Va .MAKE.DEPENDFILE
 Names the makefile (default
@@ -920,20 +919,18 @@ Anything specified on
 .Nm Ns 's
 command line is appended to the
 .Va MAKEFLAGS
-variable which is then
-entered into the environment for all programs which
+variable, which is then added to the environment for all programs that
 .Nm
 executes.
 .It Va .MAKE.LEVEL
 The recursion depth of
 .Nm .
-The initial instance of
+The top-level instance of
 .Nm
-is 0, and an incremented value is put into the environment
-to be seen by the next generation.
+has level 0, and each child make has its parent level plus 1.
 This allows tests like:
 .Li .if ${.MAKE.LEVEL} == 0
-to protect things which should only be evaluated in the initial instance of
+to protect things which should only be evaluated in the top-level instance of
 .Nm .
 .It Va .MAKE.MAKEFILE_PREFERENCE
 The ordered list of makefile names
@@ -950,7 +947,7 @@ which is useful for tracking dependencie
 Each makefile is recorded only once, regardless of the number of times read.
 .It Va .MAKE.MODE
 Processed after reading all makefiles.
-Can affect the mode that
+Affects the mode that
 .Nm
 runs in.
 It can contain a number of keywords:
@@ -969,13 +966,13 @@ Puts
 into
 .Dq meta
 mode, where meta files are created for each target
-to capture the command run, the output generated and if
+to capture the command run, the output generated, and if
 .Xr filemon 4
 is available, the system calls which are of interest to
 .Nm .
-The captured output can be very useful when diagnosing errors.
+The captured output can be useful when diagnosing errors.
 .It Cm curdirOk= Ns Ar bf
-Normally
+By default,
 .Nm
 does not create
 .Pa .meta
@@ -1150,7 +1147,7 @@ modifier to put a newline between
 iterations of the loop rather than a space.
 For example, the printing of
 .Sq Va MAKE_PRINT_VAR_ON_ERROR
-could be done as ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v:Q}'${.newline}@}.
+could be done as ${MAKE_PRINT_VAR_ON_ERROR:@v@$v='${$v}'${.newline}@}.
 .It Va .OBJDIR
 A path to the directory where the targets are built.
 Its value is determined by trying to
@@ -1206,22 +1203,22 @@ This check can be skipped by setting the
 .Sq Ev MAKE_OBJDIR_CHECK_WRITABLE
 to "no".
 .It Va .PARSEDIR
-A path to the directory of the current makefile being parsed.
+The directory name of the current makefile being parsed.
 .It Va .PARSEFILE
 The basename of the current makefile being parsed.
 This variable and
 .Sq Va .PARSEDIR
 are both set only while the makefiles are being parsed.
-If you want to retain their current values, assign them to a variable
-using assignment with expansion
+To retain their current values,
+assign them to a variable using assignment with expansion
 .Sq Cm \&:= .
 .It Va .PATH
 The space-separated list of directories that
 .Nm
 searches for files.
-The search list should be updated using the target
+To update this search list, use the special target
 .Sq Ic .PATH
-rather than the variable.
+rather than modifying the variable directly.
 .It Va PWD
 Alternate path to the current directory.
 .Nm
@@ -1258,9 +1255,9 @@ It is read-only.
 .It Va .TARGETS
 The list of targets explicitly specified on the command line, if any.
 .It Va VPATH
-Colon-separated
+The colon-separated
 .Pq Dq \&:
-lists of directories that
+list of directories that
 .Nm
 

CVS commit: src/usr.bin/make

2022-09-09 Thread Roland Illig
Module Name:src
Committed By:   rillig
Date:   Fri Sep  9 06:23:36 UTC 2022

Modified Files:
src/usr.bin/make: make.1

Log Message:
make.1: clean up and make the description more accurate

Most changes are editorial.  Notable exceptions are:

The ':Q' in MAKE_PRINT_VAR_ON_ERROR was wrongly added in the previous
commit.  As that variable does not produce a shell command, there is no
point in quoting the characters.

Since 2012.10.07.19.17.31, make doesn't complain anymore if a shell
command in compat mode expands to an empty string, which removes the
need to "keep make happy".


To generate a diff of this commit:
cvs rdiff -u -r1.338 -r1.339 src/usr.bin/make/make.1

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