CVS commit: src/lib/libc/string
Module Name:src Committed By: wiz Date: Sun Aug 13 04:20:08 UTC 2023 Modified Files: src/lib/libc/string: memcpy.3 Log Message: memcpy: consistency in prototype and fix sentence To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/libc/string/memcpy.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/string/memcpy.3 diff -u src/lib/libc/string/memcpy.3:1.14 src/lib/libc/string/memcpy.3:1.15 --- src/lib/libc/string/memcpy.3:1.14 Tue Aug 1 17:51:25 2023 +++ src/lib/libc/string/memcpy.3 Sun Aug 13 04:20:07 2023 @@ -30,7 +30,7 @@ .\" SUCH DAMAGE. .\" .\" from: @(#)memcpy.3 8.1 (Berkeley) 6/4/93 -.\" $NetBSD: memcpy.3,v 1.14 2023/08/01 17:51:25 christos Exp $ +.\" $NetBSD: memcpy.3,v 1.15 2023/08/13 04:20:07 wiz Exp $ .\" .Dd August 1, 2023 .Dt MEMCPY 3 @@ -45,7 +45,7 @@ .Ft void * .Fn memcpy "void * restrict dst" "const void * restrict src" "size_t len" .Ft void * -.Fn mempcpy "void *restrict dst" "const void * restrict src" "size_t len" +.Fn mempcpy "void * restrict dst" "const void * restrict src" "size_t len" .Sh DESCRIPTION The .Fn memcpy @@ -67,11 +67,11 @@ The .Fn memcpy function returns the original value of +.Fa dst . .Pp The .Fn mempcpy function returns a pointer to the byte after the last written byte. -.Fa dst . .Sh SEE ALSO .Xr bcopy 3 , .Xr memccpy 3 ,
CVS commit: src/lib/libc/string
Module Name:src Committed By: wiz Date: Sun Aug 13 04:20:08 UTC 2023 Modified Files: src/lib/libc/string: memcpy.3 Log Message: memcpy: consistency in prototype and fix sentence To generate a diff of this commit: cvs rdiff -u -r1.14 -r1.15 src/lib/libc/string/memcpy.3 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Sat Aug 12 23:22:49 UTC 2023 Modified Files: src/sys/kern: sys_memfd.c Log Message: F_GETPATH guarantees that data points to a MAXPATHLEN pointer, so go back to using MAXPATHLEN. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/kern/sys_memfd.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/sys_memfd.c diff -u src/sys/kern/sys_memfd.c:1.10 src/sys/kern/sys_memfd.c:1.11 --- src/sys/kern/sys_memfd.c:1.10 Sat Aug 12 19:09:12 2023 +++ src/sys/kern/sys_memfd.c Sat Aug 12 19:22:49 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_memfd.c,v 1.10 2023/08/12 23:09:12 christos Exp $ */ +/* $NetBSD: sys_memfd.c,v 1.11 2023/08/12 23:22:49 christos Exp $ */ /*- * Copyright (c) 2023 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_memfd.c,v 1.10 2023/08/12 23:09:12 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_memfd.c,v 1.11 2023/08/12 23:22:49 christos Exp $"); #include #include @@ -243,7 +243,7 @@ memfd_fcntl(file_t *fp, u_int cmd, void switch (cmd) { case F_GETPATH: - strncpy(data, mfd->mfd_name, sizeof(mfd->name)); + strncpy(data, mfd->mfd_name, MAXPATHLEN); return 0; case F_ADD_SEALS:
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Sat Aug 12 23:22:49 UTC 2023 Modified Files: src/sys/kern: sys_memfd.c Log Message: F_GETPATH guarantees that data points to a MAXPATHLEN pointer, so go back to using MAXPATHLEN. To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/sys/kern/sys_memfd.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
Module Name:src Committed By: christos Date: Sat Aug 12 23:09:12 UTC 2023 Modified Files: src/sys/kern: sys_memfd.c Log Message: mfd_name should be already NUL terminated. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/kern/sys_memfd.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/sys_memfd.c diff -u src/sys/kern/sys_memfd.c:1.9 src/sys/kern/sys_memfd.c:1.10 --- src/sys/kern/sys_memfd.c:1.9 Sat Aug 12 19:07:46 2023 +++ src/sys/kern/sys_memfd.c Sat Aug 12 19:09:12 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_memfd.c,v 1.9 2023/08/12 23:07:46 christos Exp $ */ +/* $NetBSD: sys_memfd.c,v 1.10 2023/08/12 23:09:12 christos Exp $ */ /*- * Copyright (c) 2023 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_memfd.c,v 1.9 2023/08/12 23:07:46 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_memfd.c,v 1.10 2023/08/12 23:09:12 christos Exp $"); #include #include @@ -243,7 +243,7 @@ memfd_fcntl(file_t *fp, u_int cmd, void switch (cmd) { case F_GETPATH: - strncpy(data, mfd->mfd_name, sizeof(mfd->name) - 1); + strncpy(data, mfd->mfd_name, sizeof(mfd->name)); return 0; case F_ADD_SEALS:
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Sat Aug 12 23:09:12 UTC 2023 Modified Files: src/sys/kern: sys_memfd.c Log Message: mfd_name should be already NUL terminated. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/kern/sys_memfd.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
Module Name:src Committed By: christos Date: Sat Aug 12 23:07:46 UTC 2023 Modified Files: src/sys/kern: sys_memfd.c Log Message: Add missing F_GETPATH (from Theodore Preduta) To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/kern/sys_memfd.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/sys_memfd.c diff -u src/sys/kern/sys_memfd.c:1.8 src/sys/kern/sys_memfd.c:1.9 --- src/sys/kern/sys_memfd.c:1.8 Sat Jul 29 19:59:59 2023 +++ src/sys/kern/sys_memfd.c Sat Aug 12 19:07:46 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_memfd.c,v 1.8 2023/07/29 23:59:59 rin Exp $ */ +/* $NetBSD: sys_memfd.c,v 1.9 2023/08/12 23:07:46 christos Exp $ */ /*- * Copyright (c) 2023 The NetBSD Foundation, Inc. @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: sys_memfd.c,v 1.8 2023/07/29 23:59:59 rin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_memfd.c,v 1.9 2023/08/12 23:07:46 christos Exp $"); #include #include @@ -242,6 +242,10 @@ memfd_fcntl(file_t *fp, u_int cmd, void int error = 0; switch (cmd) { + case F_GETPATH: + strncpy(data, mfd->mfd_name, sizeof(mfd->name) - 1); + return 0; + case F_ADD_SEALS: mutex_enter(>f_lock);
CVS commit: src/sys/kern
Module Name:src Committed By: christos Date: Sat Aug 12 23:07:46 UTC 2023 Modified Files: src/sys/kern: sys_memfd.c Log Message: Add missing F_GETPATH (from Theodore Preduta) To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/kern/sys_memfd.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 12 21:32:16 UTC 2023 Modified Files: src/usr.bin/xlint/lint1: emit1.c src/usr.bin/xlint/lint2: emit2.c Log Message: lint: clean up comments There's no output buffer anymore. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/lint2/emit2.c 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/xlint/lint1/emit1.c diff -u src/usr.bin/xlint/lint1/emit1.c:1.75 src/usr.bin/xlint/lint1/emit1.c:1.76 --- src/usr.bin/xlint/lint1/emit1.c:1.75 Sat Aug 12 21:08:37 2023 +++ src/usr.bin/xlint/lint1/emit1.c Sat Aug 12 21:32:16 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: emit1.c,v 1.75 2023/08/12 21:08:37 rillig Exp $ */ +/* $NetBSD: emit1.c,v 1.76 2023/08/12 21:32:16 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: emit1.c,v 1.75 2023/08/12 21:08:37 rillig Exp $"); +__RCSID("$NetBSD: emit1.c,v 1.76 2023/08/12 21:32:16 rillig Exp $"); #endif #include "lint1.h" @@ -288,7 +288,6 @@ outfdef(const sym_t *fsym, const pos_t * if (fsym->s_scl == STATIC) outchar('s'); - /* name of function */ outname(fsym->s_name); if (fsym->s_rename != NULL) { @@ -396,7 +395,7 @@ outcall(const tnode_t *tn, bool retval_u outchar('\n'); } -/* write a character to the output buffer, quoted if necessary */ +/* write a character to the output file, quoted if necessary */ static void outqchar(char c) { @@ -448,7 +447,7 @@ outqchar(char c) /* * extracts potential format specifiers for printf() and scanf() and - * writes them, enclosed in "" and quoted if necessary, to the output buffer + * writes them, enclosed in "" and quoted if necessary, to the output file */ static void outfstrg(strg_t *strg) @@ -546,9 +545,7 @@ outfstrg(strg_t *strg) outchar('"'); } -/* - * writes a record if sym was used - */ +/* writes a record if sym was used */ void outusg(const sym_t *sym) { Index: src/usr.bin/xlint/lint2/emit2.c diff -u src/usr.bin/xlint/lint2/emit2.c:1.35 src/usr.bin/xlint/lint2/emit2.c:1.36 --- src/usr.bin/xlint/lint2/emit2.c:1.35 Sat Aug 12 21:08:37 2023 +++ src/usr.bin/xlint/lint2/emit2.c Sat Aug 12 21:32:16 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: emit2.c,v 1.35 2023/08/12 21:08:37 rillig Exp $ */ +/* $NetBSD: emit2.c,v 1.36 2023/08/12 21:32:16 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -34,7 +34,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: emit2.c,v 1.35 2023/08/12 21:08:37 rillig Exp $"); +__RCSID("$NetBSD: emit2.c,v 1.36 2023/08/12 21:32:16 rillig Exp $"); #endif #include "lint2.h" @@ -44,9 +44,7 @@ static void outdef(hte_t *, sym_t *); static void dumpname(hte_t *); static void outfiles(void); -/* - * Write type into the output buffer. - */ +/* Write type into the output file. */ static void outtype(type_t *tp) { @@ -109,9 +107,7 @@ outtype(type_t *tp) } } -/* - * Write a definition. - */ +/* Write a definition. */ static void outdef(hte_t *hte, sym_t *sym) { @@ -149,9 +145,7 @@ outdef(hte_t *hte, sym_t *sym) outchar('\n'); } -/* - * Write the first definition of a name into the lint library. - */ +/* Write the first definition of a name into the lint library. */ static void dumpname(hte_t *hte) { @@ -181,9 +175,7 @@ dumpname(hte_t *hte) outdef(hte, def); } -/* - * Write a new lint library. - */ +/* Write a new lint library. */ void outlib(const char *name) { @@ -206,9 +198,7 @@ outlib(const char *name) outclose(); } -/* - * Write out the name of a file referenced by a type. - */ +/* Write out the name of a file referenced by a type. */ struct outflist { short ofl_num; struct outflist *ofl_next;
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 12 21:32:16 UTC 2023 Modified Files: src/usr.bin/xlint/lint1: emit1.c src/usr.bin/xlint/lint2: emit2.c Log Message: lint: clean up comments There's no output buffer anymore. To generate a diff of this commit: cvs rdiff -u -r1.75 -r1.76 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/lint2/emit2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 12 21:08:38 UTC 2023 Modified Files: src/usr.bin/xlint/lint1: emit1.c src/usr.bin/xlint/lint2: emit2.c Log Message: lint: remove redundant comments To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.34 -r1.35 src/usr.bin/xlint/lint2/emit2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 12 21:08:38 UTC 2023 Modified Files: src/usr.bin/xlint/lint1: emit1.c src/usr.bin/xlint/lint2: emit2.c Log Message: lint: remove redundant comments To generate a diff of this commit: cvs rdiff -u -r1.74 -r1.75 src/usr.bin/xlint/lint1/emit1.c cvs rdiff -u -r1.34 -r1.35 src/usr.bin/xlint/lint2/emit2.c 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/xlint/lint1/emit1.c diff -u src/usr.bin/xlint/lint1/emit1.c:1.74 src/usr.bin/xlint/lint1/emit1.c:1.75 --- src/usr.bin/xlint/lint1/emit1.c:1.74 Sat Aug 12 20:48:24 2023 +++ src/usr.bin/xlint/lint1/emit1.c Sat Aug 12 21:08:37 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: emit1.c,v 1.74 2023/08/12 20:48:24 rillig Exp $ */ +/* $NetBSD: emit1.c,v 1.75 2023/08/12 21:08:37 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: emit1.c,v 1.74 2023/08/12 20:48:24 rillig Exp $"); +__RCSID("$NetBSD: emit1.c,v 1.75 2023/08/12 21:08:37 rillig Exp $"); #endif #include "lint1.h" @@ -47,10 +47,9 @@ static void outtt(sym_t *, sym_t *); static void outfstrg(strg_t *); /* - * Write type into the output buffer. - * The type is written as a sequence of substrings, each of which describes a - * node of type type_t - * a node is encoded as follows: + * Write type into the output file, encoded as follows: + * const c + * volatile v * _Bool B * _Complex float s X * _Complex double X @@ -84,10 +83,6 @@ static void outfstrg(strg_t *); *1 n tag tagged type *2 n typename only typedef name *3 line.file.uniq anonymous types - * - * spaces are only for better readability - * additionally it is possible to prepend the characters 'c' (for const) - * and 'v' (for volatile) */ void outtype(const type_t *tp) @@ -219,16 +214,13 @@ outsym(const sym_t *sym, scl_t sc, def_t if (sc == STATIC) outchar('s'); - /* name of the symbol */ outname(sym->s_name); - /* renamed name of symbol, if necessary */ if (sym->s_rename != NULL) { outchar('r'); outname(sym->s_rename); } - /* type of the symbol */ outtype(sym->s_type); outchar('\n'); } @@ -254,8 +246,6 @@ outfdef(const sym_t *fsym, const pos_t * outchar('.'); outint(posp->p_line); - /* flags */ - /* both SCANFLIKE and PRINTFLIKE imply VARARGS */ if (printflike_argnum != -1) { nvararg = printflike_argnum; @@ -301,7 +291,6 @@ outfdef(const sym_t *fsym, const pos_t * /* name of function */ outname(fsym->s_name); - /* renamed name of function, if necessary */ if (fsym->s_rename != NULL) { outchar('r'); outname(fsym->s_rename); @@ -388,8 +377,7 @@ outcall(const tnode_t *tn, bool retval_u } } - /* return value discarded/used/ignored */ - outchar((char)(retval_discarded ? 'd' : (retval_used ? 'u' : 'i'))); + outchar((char)(retval_discarded ? 'd' : retval_used ? 'u' : 'i')); /* name of the called function */ outname(tn->tn_left->tn_left->tn_sym->s_name); @@ -572,10 +560,7 @@ outusg(const sym_t *sym) outint(get_filename_id(curr_pos.p_file)); outchar('.'); outint(curr_pos.p_line); - - /* necessary to delimit both numbers */ - outchar('x'); - + outchar('x'); /* separate the two numbers */ outname(sym->s_name); outchar('\n'); } Index: src/usr.bin/xlint/lint2/emit2.c diff -u src/usr.bin/xlint/lint2/emit2.c:1.34 src/usr.bin/xlint/lint2/emit2.c:1.35 --- src/usr.bin/xlint/lint2/emit2.c:1.34 Sat Aug 12 20:48:24 2023 +++ src/usr.bin/xlint/lint2/emit2.c Sat Aug 12 21:08:37 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: emit2.c,v 1.34 2023/08/12 20:48:24 rillig Exp $ */ +/* $NetBSD: emit2.c,v 1.35 2023/08/12 21:08:37 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -34,7 +34,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: emit2.c,v 1.34 2023/08/12 20:48:24 rillig Exp $"); +__RCSID("$NetBSD: emit2.c,v 1.35 2023/08/12 21:08:37 rillig Exp $"); #endif #include "lint2.h" @@ -116,16 +116,11 @@ static void outdef(hte_t *hte, sym_t *sym) { - /* line number in C source file */ - outint(0); - - /* this is a definition */ - outchar('d'); - - /* index of file where symbol was defined and line number of def. */ - outint(0); + outint(0); /* line number in C source file */ + outchar('d'); /* definition */ + outint(0); /* index of file where symbol was defined */ outchar('.'); - outint(0); + outint(0); /* line number of definition */ /* flags */ if (sym->s_check_only_first_args) { @@ -148,12 +143,8 @@ outdef(hte_t *hte, sym_t *sym) if (sym->s_old_style_function) outchar('o'); } - outchar('u'); /* used (no warning if not used) */ - - /* name */ + outchar('u'); /* used (no warning if not used) */ outname(hte->h_name); - - /* type */ outtype(TP(sym->s_type)); outchar('\n'); } @@ -196,28 +187,22 @@
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 12 20:48:24 UTC 2023 Modified Files: src/usr.bin/xlint/common: emit.c externs.h src/usr.bin/xlint/lint1: emit1.c mem1.c src/usr.bin/xlint/lint2: emit2.c Log Message: lint: for each record in the output file, write the newline immediately There's no point delaying the '\n' until the next line is written. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/common/emit.c cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/common/externs.h cvs rdiff -u -r1.73 -r1.74 src/usr.bin/xlint/lint1/emit1.c \ src/usr.bin/xlint/lint1/mem1.c cvs rdiff -u -r1.33 -r1.34 src/usr.bin/xlint/lint2/emit2.c 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/xlint/common/emit.c diff -u src/usr.bin/xlint/common/emit.c:1.23 src/usr.bin/xlint/common/emit.c:1.24 --- src/usr.bin/xlint/common/emit.c:1.23 Sat Aug 12 17:13:27 2023 +++ src/usr.bin/xlint/common/emit.c Sat Aug 12 20:48:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: emit.c,v 1.23 2023/08/12 17:13:27 rillig Exp $ */ +/* $NetBSD: emit.c,v 1.24 2023/08/12 20:48:24 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: emit.c,v 1.23 2023/08/12 17:13:27 rillig Exp $"); +__RCSID("$NetBSD: emit.c,v 1.24 2023/08/12 20:48:24 rillig Exp $"); #endif #include @@ -47,7 +47,6 @@ __RCSID("$NetBSD: emit.c,v 1.23 2023/08/ static const char *output_name; static FILE *output_file; -static bool in_line; void outopen(const char *name) @@ -62,25 +61,15 @@ void outclose(void) { - outclr(); if (fclose(output_file) == EOF) err(1, "cannot close '%s'", output_name); } void -outclr(void) -{ - - if (in_line) - outchar('\n'); -} - -void outchar(char c) { fputc(c, output_file); - in_line = c != '\n'; } /* @@ -119,7 +108,7 @@ void outsrc(const char *name) { - outclr(); outchar('S'); outstrg(name); + outchar('\n'); } Index: src/usr.bin/xlint/common/externs.h diff -u src/usr.bin/xlint/common/externs.h:1.29 src/usr.bin/xlint/common/externs.h:1.30 --- src/usr.bin/xlint/common/externs.h:1.29 Thu Jul 13 08:40:38 2023 +++ src/usr.bin/xlint/common/externs.h Sat Aug 12 20:48:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: externs.h,v 1.29 2023/07/13 08:40:38 rillig Exp $ */ +/* $NetBSD: externs.h,v 1.30 2023/08/12 20:48:24 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -54,7 +54,6 @@ char *xasprintf(const char *, ...) __pri #if defined(IS_LINT1) || defined(IS_LINT2) void outopen(const char *); void outclose(void); -void outclr(void); void outchar(char); void outstrg(const char *); void outint(int); Index: src/usr.bin/xlint/lint1/emit1.c diff -u src/usr.bin/xlint/lint1/emit1.c:1.73 src/usr.bin/xlint/lint1/emit1.c:1.74 --- src/usr.bin/xlint/lint1/emit1.c:1.73 Wed Aug 2 18:51:25 2023 +++ src/usr.bin/xlint/lint1/emit1.c Sat Aug 12 20:48:24 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: emit1.c,v 1.73 2023/08/02 18:51:25 rillig Exp $ */ +/* $NetBSD: emit1.c,v 1.74 2023/08/12 20:48:24 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: emit1.c,v 1.73 2023/08/02 18:51:25 rillig Exp $"); +__RCSID("$NetBSD: emit1.c,v 1.74 2023/08/12 20:48:24 rillig Exp $"); #endif #include "lint1.h" @@ -191,9 +191,6 @@ outsym(const sym_t *sym, scl_t sc, def_t if (ch_isdigit(sym->s_name[0])) /* _tmp */ return; - /* reset buffer */ - outclr(); - outint(csrc_pos.p_line); outchar('d'); /* declaration */ outint(get_filename_id(sym->s_def_pos.p_file)); @@ -233,6 +230,7 @@ outsym(const sym_t *sym, scl_t sc, def_t /* type of the symbol */ outtype(sym->s_type); + outchar('\n'); } /* @@ -246,9 +244,6 @@ outfdef(const sym_t *fsym, const pos_t * int narg; const sym_t *arg; - /* reset the buffer */ - outclr(); - if (posp->p_file == csrc_pos.p_file) { outint(posp->p_line); } else { @@ -325,6 +320,7 @@ outfdef(const sym_t *fsym, const pos_t * } else { outtype(fsym->s_type); } + outchar('\n'); } /* @@ -342,9 +338,6 @@ outcall(const tnode_t *tn, bool retval_u int narg, n, i; tspec_t t; - /* reset buffer */ - outclr(); - outint(csrc_pos.p_line); outchar('c'); /* function call */ outint(get_filename_id(curr_pos.p_file)); @@ -412,6 +405,7 @@ outcall(const tnode_t *tn, bool retval_u } /* expected type of return value */ outtype(tn->tn_type); + outchar('\n'); } /* write a character to the output buffer, quoted if necessary */ @@ -573,9 +567,6 @@ outusg(const sym_t *sym) if (ch_isdigit(sym->s_name[0])) /* _tmp, from mktempsym */ return; - /* reset buffer */ - outclr(); - outint(csrc_pos.p_line); outchar('u'); /* used */ outint(get_filename_id(curr_pos.p_file)); @@ -586,4 +577,5 @@ outusg(const sym_t *sym)
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 12 20:48:24 UTC 2023 Modified Files: src/usr.bin/xlint/common: emit.c externs.h src/usr.bin/xlint/lint1: emit1.c mem1.c src/usr.bin/xlint/lint2: emit2.c Log Message: lint: for each record in the output file, write the newline immediately There's no point delaying the '\n' until the next line is written. To generate a diff of this commit: cvs rdiff -u -r1.23 -r1.24 src/usr.bin/xlint/common/emit.c cvs rdiff -u -r1.29 -r1.30 src/usr.bin/xlint/common/externs.h cvs rdiff -u -r1.73 -r1.74 src/usr.bin/xlint/lint1/emit1.c \ src/usr.bin/xlint/lint1/mem1.c cvs rdiff -u -r1.33 -r1.34 src/usr.bin/xlint/lint2/emit2.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 12 18:05:52 UTC 2023 Modified Files: src/usr.bin/xlint/common: lint.h src/usr.bin/xlint/lint1: cgram.y check-msgs.lua Log Message: lint: clean up To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/common/lint.h cvs rdiff -u -r1.470 -r1.471 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint1/check-msgs.lua 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/xlint/common/lint.h diff -u src/usr.bin/xlint/common/lint.h:1.42 src/usr.bin/xlint/common/lint.h:1.43 --- src/usr.bin/xlint/common/lint.h:1.42 Thu Jul 13 08:40:38 2023 +++ src/usr.bin/xlint/common/lint.h Sat Aug 12 18:05:51 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: lint.h,v 1.42 2023/07/13 08:40:38 rillig Exp $ */ +/* $NetBSD: lint.h,v 1.43 2023/08/12 18:05:51 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -142,14 +142,6 @@ typedef enum { DEF /* defined */ } def_t; -/* Some data used for the output buffer. */ -typedef struct ob { - char *o_buf; /* buffer */ - char *o_end; /* first byte after buffer */ - size_t o_len; /* length of buffer */ - char *o_next; /* next free byte in buffer */ -} ob_t; - #if defined(IS_LINT1) typedef struct lint1_type type_t; #else Index: src/usr.bin/xlint/lint1/cgram.y diff -u src/usr.bin/xlint/lint1/cgram.y:1.470 src/usr.bin/xlint/lint1/cgram.y:1.471 --- src/usr.bin/xlint/lint1/cgram.y:1.470 Thu Aug 3 18:48:42 2023 +++ src/usr.bin/xlint/lint1/cgram.y Sat Aug 12 18:05:51 2023 @@ -1,5 +1,5 @@ %{ -/* $NetBSD: cgram.y,v 1.470 2023/08/03 18:48:42 rillig Exp $ */ +/* $NetBSD: cgram.y,v 1.471 2023/08/12 18:05:51 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -35,7 +35,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: cgram.y,v 1.470 2023/08/03 18:48:42 rillig Exp $"); +__RCSID("$NetBSD: cgram.y,v 1.471 2023/08/12 18:05:51 rillig Exp $"); #endif #include @@ -358,7 +358,6 @@ is_either(const char *s, const char *a, %type direct_notype_param_declarator %type param_list /* No type for id_list_lparen. */ -/* No type for abstract_decl_lparen. */ %type array_size_opt %type array_size %type identifier_list Index: src/usr.bin/xlint/lint1/check-msgs.lua diff -u src/usr.bin/xlint/lint1/check-msgs.lua:1.19 src/usr.bin/xlint/lint1/check-msgs.lua:1.20 --- src/usr.bin/xlint/lint1/check-msgs.lua:1.19 Mon Jul 10 11:46:14 2023 +++ src/usr.bin/xlint/lint1/check-msgs.lua Sat Aug 12 18:05:51 2023 @@ -1,5 +1,5 @@ #! /usr/bin/lua --- $NetBSD: check-msgs.lua,v 1.19 2023/07/10 11:46:14 rillig Exp $ +-- $NetBSD: check-msgs.lua,v 1.20 2023/08/12 18:05:51 rillig Exp $ --[[ @@ -130,6 +130,8 @@ end local function check_yacc_file(filename) local decl = {} + local decl_list = {} + local decl_list_index = 1 local f = assert(io.open(filename, "r")) local lineno = 0 for line in f:lines() do @@ -137,7 +139,12 @@ local function check_yacc_file(filename) local type = line:match("^%%type%s+<[%w_]+>%s+(%S+)$") or line:match("^/%* No type for ([%w_]+)%. %*/$") if type then + if decl[type] then +print_error("%s:%d: duplicate type declaration for rule %q", + filename, lineno, type) + end decl[type] = lineno + table.insert(decl_list, { lineno = lineno, rule = type }) end local rule = line:match("^([%w_]+):") if rule then @@ -147,6 +154,16 @@ local function check_yacc_file(filename) print_error("%s:%d: missing type declaration for rule %q", filename, lineno, rule) end + if decl_list_index > 0 then +local expected = decl_list[decl_list_index] +if expected.rule == rule then + decl_list_index = decl_list_index + 1 +else + print_error("%s:%d: expecting rule %q (from line %d), got %q", + filename, lineno, expected.rule, expected.lineno, rule) + decl_list_index = 0 +end + end end end for rule, decl_lineno in pairs(decl) do
CVS commit: src/usr.bin/xlint
Module Name:src Committed By: rillig Date: Sat Aug 12 18:05:52 UTC 2023 Modified Files: src/usr.bin/xlint/common: lint.h src/usr.bin/xlint/lint1: cgram.y check-msgs.lua Log Message: lint: clean up To generate a diff of this commit: cvs rdiff -u -r1.42 -r1.43 src/usr.bin/xlint/common/lint.h cvs rdiff -u -r1.470 -r1.471 src/usr.bin/xlint/lint1/cgram.y cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint1/check-msgs.lua Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/common
Module Name:src Committed By: rillig Date: Sat Aug 12 17:13:28 UTC 2023 Modified Files: src/usr.bin/xlint/common: emit.c Log Message: lint: remove unnecessary double-buffering for output files To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/common/emit.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/common
Module Name:src Committed By: rillig Date: Sat Aug 12 17:13:28 UTC 2023 Modified Files: src/usr.bin/xlint/common: emit.c Log Message: lint: remove unnecessary double-buffering for output files To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.bin/xlint/common/emit.c 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/xlint/common/emit.c diff -u src/usr.bin/xlint/common/emit.c:1.22 src/usr.bin/xlint/common/emit.c:1.23 --- src/usr.bin/xlint/common/emit.c:1.22 Thu Jul 13 08:40:38 2023 +++ src/usr.bin/xlint/common/emit.c Sat Aug 12 17:13:27 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: emit.c,v 1.22 2023/07/13 08:40:38 rillig Exp $ */ +/* $NetBSD: emit.c,v 1.23 2023/08/12 17:13:27 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: emit.c,v 1.22 2023/07/13 08:40:38 rillig Exp $"); +__RCSID("$NetBSD: emit.c,v 1.23 2023/08/12 17:13:27 rillig Exp $"); #endif #include @@ -45,121 +45,71 @@ __RCSID("$NetBSD: emit.c,v 1.22 2023/07/ #include "lint.h" -/* name and handle of output file */ -static const char *loname; -static FILE *lout; +static const char *output_name; +static FILE *output_file; +static bool in_line; -/* output buffer data */ -static ob_t ob; - -static void outxbuf(void); - - -/* - * initialize output - */ void outopen(const char *name) { - loname = name; - - /* Open output file */ - if ((lout = fopen(name, "w")) == NULL) + output_name = name; + if ((output_file = fopen(name, "w")) == NULL) err(1, "cannot open '%s'", name); - - /* Create output buffer */ - ob.o_len = 1024; - ob.o_end = (ob.o_buf = ob.o_next = xmalloc(ob.o_len)) + ob.o_len; } -/* - * flush output buffer and close file - */ void outclose(void) { outclr(); - if (fclose(lout) == EOF) - err(1, "cannot close '%s'", loname); -} - -/* - * resize output buffer - */ -static void -outxbuf(void) -{ - - size_t next = (size_t)(ob.o_next - ob.o_buf); - ob.o_len *= 2; - ob.o_buf = xrealloc(ob.o_buf, ob.o_len); - ob.o_end = ob.o_buf + ob.o_len; - ob.o_next = ob.o_buf + next; + if (fclose(output_file) == EOF) + err(1, "cannot close '%s'", output_name); } -/* - * reset output buffer - * if it is not empty, it is flushed - */ void outclr(void) { - if (ob.o_buf != ob.o_next) { + if (in_line) outchar('\n'); - size_t sz = (size_t)(ob.o_next - ob.o_buf); - if (sz > ob.o_len) - errx(1, "internal error: outclr"); - if (fwrite(ob.o_buf, sz, 1, lout) != 1) - err(1, "cannot write to %s", loname); - ob.o_next = ob.o_buf; - } } -/* - * write a character to the output buffer - */ void outchar(char c) { - if (ob.o_next == ob.o_end) - outxbuf(); - *ob.o_next++ = c; + fputc(c, output_file); + in_line = c != '\n'; } /* - * write a string to the output buffer - * the string must not contain any characters which - * should be quoted + * write a string to the output file + * the string must not contain any characters which should be quoted */ void outstrg(const char *s) { - while (*s != '\0') { - if (ob.o_next == ob.o_end) - outxbuf(); - *ob.o_next++ = *s++; - } + while (*s != '\0') + outchar(*s++); } -/* write an integer value to the output buffer */ +/* write an integer value to the output file */ void outint(int i) { + char buf[1 + 3 * sizeof(int)]; - if ((size_t)(ob.o_end - ob.o_next) < 3 * sizeof(int)) - outxbuf(); - ob.o_next += snprintf(ob.o_next, ob.o_end - ob.o_next, "%d", i); + snprintf(buf, sizeof(buf), "%d", i); + outstrg(buf); } -/* write a name to the output buffer, preceded by its length */ +/* write a name to the output file, preceded by its length */ void outname(const char *name) { + outint((int)strlen(name)); outstrg(name); }
CVS commit: src/distrib/sets/lists/base
Module Name:src Committed By: riastradh Date: Sat Aug 12 16:44:15 UTC 2023 Modified Files: src/distrib/sets/lists/base: shl.mi Log Message: base/shl.mi: Tag libasan.so and libubsan.so with gcc like before. Not in clang builds. This tag got dropped in the gcc12 update. To generate a diff of this commit: cvs rdiff -u -r1.960 -r1.961 src/distrib/sets/lists/base/shl.mi 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/base/shl.mi diff -u src/distrib/sets/lists/base/shl.mi:1.960 src/distrib/sets/lists/base/shl.mi:1.961 --- src/distrib/sets/lists/base/shl.mi:1.960 Fri Aug 11 23:04:29 2023 +++ src/distrib/sets/lists/base/shl.mi Sat Aug 12 16:44:15 2023 @@ -1,4 +1,4 @@ -# $NetBSD: shl.mi,v 1.960 2023/08/11 23:04:29 christos Exp $ +# $NetBSD: shl.mi,v 1.961 2023/08/12 16:44:15 riastradh Exp $ # # Note: Don't delete entries from here - mark them as "obsolete" instead, # unless otherwise stated below. @@ -210,7 +210,7 @@ ./usr/lib/libarchive.sobase-sys-shlib compatfile ./usr/lib/libarchive.so.4 base-sys-shlib compatfile ./usr/lib/libarchive.so.4.0 base-sys-shlib compatfile -./usr/lib/libasan.sobase-sys-shlib compatfile,cxx +./usr/lib/libasan.sobase-sys-shlib compatfile,cxx,gcc ./usr/lib/libasan.so.5base-sys-shlib compatfile,cxx,gcc=10 ./usr/lib/libasan.so.5.0 base-sys-shlib compatfile,cxx,gcc=10 ./usr/lib/libasan.so.5base-sys-shlib compatfile,cxx,obsolete,gcc=12 @@ -937,7 +937,7 @@ ./usr/lib/libtspi.sobase-sys-shlib compatfile,tpm ./usr/lib/libtspi.so.3base-sys-shlib compatfile,tpm ./usr/lib/libtspi.so.3.0 base-sys-shlib compatfile,tpm -./usr/lib/libubsan.sobase-sys-shlib compatfile,cxx +./usr/lib/libubsan.sobase-sys-shlib compatfile,cxx,gcc ./usr/lib/libubsan.so.4base-sys-shlib compatfile,cxx,gcc=10 ./usr/lib/libubsan.so.4.0 base-sys-shlib compatfile,cxx,gcc=10 ./usr/lib/libubsan.so.4base-sys-shlib compatfile,cxx,obsolete,gcc=12
CVS commit: src/distrib/sets/lists/base
Module Name:src Committed By: riastradh Date: Sat Aug 12 16:44:15 UTC 2023 Modified Files: src/distrib/sets/lists/base: shl.mi Log Message: base/shl.mi: Tag libasan.so and libubsan.so with gcc like before. Not in clang builds. This tag got dropped in the gcc12 update. To generate a diff of this commit: cvs rdiff -u -r1.960 -r1.961 src/distrib/sets/lists/base/shl.mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Re: CVS commit: src
Hi, Sorry, didn't notice the email until today. To answer your question why it is not enabled in GENERIC by default, I am not sure (Taylor(?)), it was commented since the day one both on i386 and amd64. However, I have some doubts if it is very relevant driver to enable it. From the context perspective, viadrmums is also a legacy driver, Linux have already removed it in the latest kernel source code, and new https://cgit.freedesktop.org/openchrome/drm-openchrome/ was developed, but haven't made it to official kernel yet (and hard to tell when and if it will happen at all)). VIA integrated graphics drivers development was a always a bit of a sad story: lack of interest, manpower/skills, lack of VIA participation, the hardware is pretty obscure and under-performing, and likely more suitable for non graphics related tasks. Myself I used it mainly for NAS and testing platform, thus I need only basic graphics support. Nevertheless, if it doesn't affect the development much and it does seem to be work in the machines I own, I can enable it. That also reminds me that I wanted to finish unichromefb driver in our code base, which is unfinished and limited to VX900 support now if I am not mistaken... Maybe it is time to spend some effort on that... Regards, Andrius V On Thu, Aug 10, 2023 at 12:42 AM matthew green wrote: > > > Log Message: > > viadrmums(4): build legacy VIA DRM UMS driver module for amd64. > > > > This driver is not built-in by default, thus loadable module can help > > (un)lucky > > if it works, why isn't it in GENERIC as well as a module? > > thanks. > > > .mrg.
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Sat Aug 12 12:56:34 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Tickets #324 and #325 To generate a diff of this commit: cvs rdiff -u -r1.1.2.105 -r1.1.2.106 src/doc/CHANGES-10.0 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-10.0 diff -u src/doc/CHANGES-10.0:1.1.2.105 src/doc/CHANGES-10.0:1.1.2.106 --- src/doc/CHANGES-10.0:1.1.2.105 Sat Aug 12 12:41:58 2023 +++ src/doc/CHANGES-10.0 Sat Aug 12 12:56:34 2023 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-10.0,v 1.1.2.105 2023/08/12 12:41:58 martin Exp $ +# $NetBSD: CHANGES-10.0,v 1.1.2.106 2023/08/12 12:56:34 martin Exp $ A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16 until the 10.0 release: @@ -11144,3 +11144,27 @@ doc/CHANGES (manualy edited) Import lua 5.4.6 [nikita, ticket #313] +external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd 1.4,1.5 +external/mit/xorg/etc/etc.dreamcast/xorg.conf.uskbd 1.4,1.5 +external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-jp 1.4,1.5 +external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-us 1.4,1.5 +external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-jp 1.4,1.5 +external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-us 1.4,1.5 +external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-jp 1.4,1.5 +external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-us 1.4,1.5 +external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws003sh 1.4,1.5 +external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws007sh 1.4,1.5 +external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws011sh 1.4,1.5 +external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws020sh 1.4,1.5 +external/mit/xorg/etc/etc.zaurus/xorg.conf.C3x00 1.3,1.4 +external/mit/xorg/etc/etc.zaurus/xorg.conf.C7x0 1.3,1.4 + + PR 57346: specify options "AutoAddDevices" to prefer xorg.conf + keyboard options. + [tsutsui, ticket #324] + +share/man/man7/signal.71.27,1.28 + + signal(7): PR 57527: clarify quirky SysV-inspired SIGCHLD semantics. + [riastradh, ticket #325] +
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Sat Aug 12 12:56:34 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Tickets #324 and #325 To generate a diff of this commit: cvs rdiff -u -r1.1.2.105 -r1.1.2.106 src/doc/CHANGES-10.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/share/man/man7
Module Name:src Committed By: martin Date: Sat Aug 12 12:53:18 UTC 2023 Modified Files: src/share/man/man7 [netbsd-10]: signal.7 Log Message: Pull up following revision(s) (requested by riastradh in ticket #325): share/man/man7/signal.7: revision 1.27 share/man/man7/signal.7: revision 1.28 signal(7): Clarify quirky SysV-inspired SIGCHLD semantics. Suggest a portable alternative approach for detaching subprocesses. Break wall of text into paragraphs while here. signal(7): Clarify semantics of SIGCHLD with SIG_IGN or SA_NOCLDWAIT. The semantics is not just a nonportable hack for SysV compatibility; it is enshrined in POSIX. Related: PR 57527 To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.26.4.1 src/share/man/man7/signal.7 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/share/man/man7/signal.7 diff -u src/share/man/man7/signal.7:1.26 src/share/man/man7/signal.7:1.26.4.1 --- src/share/man/man7/signal.7:1.26 Sun May 30 07:17:01 2021 +++ src/share/man/man7/signal.7 Sat Aug 12 12:53:17 2023 @@ -1,4 +1,4 @@ -.\" $NetBSD: signal.7,v 1.26 2021/05/30 07:17:01 dholland Exp $ +.\" $NetBSD: signal.7,v 1.26.4.1 2023/08/12 12:53:17 martin Exp $ .\" .\" Copyright (c) 1999, 2016 The NetBSD Foundation, Inc. .\" All rights reserved. @@ -401,18 +401,25 @@ immediate children exits and can be wait .Xr wait 2 family of functions. The default action is to do nothing. -As a special case hack, if +.Pp +As a special case, if a child exits when its parent process has .Dv SIGCHLD -is ignored (not merely blocked) when a process is -.Em created , -it is detached from its parent immediately so it need not be waited -for. -This behavior is a System V historic wart, implemented in -.Nx -only for compatibility. -It is not portable, not recommended, and should not be used by new -code. -.\" XXX should refer to something that can be used by new code... +ignored +.Pq not merely blocked +by having its signal handler set to +.Dv SIG_IGN , +or if the signal action has the +.Dv SA_NOCLDWAIT +flag set +.Pq Xr sigaction 2 , +then the child is detached so that +.Xr wait 2 +in the parent will wait for +.Em all +children to exit and then fail with +.Er ECHILD +without returning any information about any specific child processes. +.Pp The number for .Dv SIGCHLD is\~20.
CVS commit: [netbsd-10] src/share/man/man7
Module Name:src Committed By: martin Date: Sat Aug 12 12:53:18 UTC 2023 Modified Files: src/share/man/man7 [netbsd-10]: signal.7 Log Message: Pull up following revision(s) (requested by riastradh in ticket #325): share/man/man7/signal.7: revision 1.27 share/man/man7/signal.7: revision 1.28 signal(7): Clarify quirky SysV-inspired SIGCHLD semantics. Suggest a portable alternative approach for detaching subprocesses. Break wall of text into paragraphs while here. signal(7): Clarify semantics of SIGCHLD with SIG_IGN or SA_NOCLDWAIT. The semantics is not just a nonportable hack for SysV compatibility; it is enshrined in POSIX. Related: PR 57527 To generate a diff of this commit: cvs rdiff -u -r1.26 -r1.26.4.1 src/share/man/man7/signal.7 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:48:53 UTC 2023 Modified Files: src/lib/libc/gen: vis.c src/tests/lib/libc/gen: t_vis.c Log Message: vis(3): Fix one more buffer overrun in an edge case. PR lib/57573 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/lib/libc/gen/vis.c cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.82 src/lib/libc/gen/vis.c:1.83 --- src/lib/libc/gen/vis.c:1.82 Sat Aug 12 12:48:37 2023 +++ src/lib/libc/gen/vis.c Sat Aug 12 12:48:52 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.82 2023/08/12 12:48:37 riastradh Exp $ */ +/* $NetBSD: vis.c,v 1.83 2023/08/12 12:48:52 riastradh Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.82 2023/08/12 12:48:37 riastradh Exp $"); +__RCSID("$NetBSD: vis.c,v 1.83 2023/08/12 12:48:52 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -570,6 +570,10 @@ istrsenvisx(char **mbdstp, size_t *dlen, len = wcslen(start); if (dlen) { maxolen = *dlen; + if (maxolen == 0) { + errno = ENOSPC; + goto out; + } } else { if (len > (SIZE_MAX - 1)/MB_LEN_MAX) { errno = ENOSPC; @@ -651,6 +655,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, } /* Terminate the output string. */ + assert(olen < maxolen); *mbdst = '\0'; if (flags & VIS_NOLOCALE) { Index: src/tests/lib/libc/gen/t_vis.c diff -u src/tests/lib/libc/gen/t_vis.c:1.13 src/tests/lib/libc/gen/t_vis.c:1.14 --- src/tests/lib/libc/gen/t_vis.c:1.13 Sat Aug 12 12:48:37 2023 +++ src/tests/lib/libc/gen/t_vis.c Sat Aug 12 12:48:53 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.13 2023/08/12 12:48:37 riastradh Exp $ */ +/* $NetBSD: t_vis.c,v 1.14 2023/08/12 12:48:53 riastradh Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -128,8 +128,6 @@ ATF_TC_BODY(strnvis_empty_empty, tc) char dst[] = "fail"; int n; - atf_tc_expect_fail("PR lib/57573: Overflow possibilities in vis(3)"); - n = strnvis(dst, 0, "", VIS_SAFE); ATF_CHECK(memcmp(dst, "fail", sizeof(dst)) == 0); ATF_CHECK_EQ_MSG(n, -1, "n=%d", n);
CVS commit: src
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:48:53 UTC 2023 Modified Files: src/lib/libc/gen: vis.c src/tests/lib/libc/gen: t_vis.c Log Message: vis(3): Fix one more buffer overrun in an edge case. PR lib/57573 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.82 -r1.83 src/lib/libc/gen/vis.c cvs rdiff -u -r1.13 -r1.14 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:48:37 UTC 2023 Modified Files: src/lib/libc/gen: vis.c src/tests/lib/libc/gen: t_vis.c Log Message: vis(3): Fix main part of PR lib/57573. >From Kyle Evans . XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.81 -r1.82 src/lib/libc/gen/vis.c cvs rdiff -u -r1.12 -r1.13 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.81 src/lib/libc/gen/vis.c:1.82 --- src/lib/libc/gen/vis.c:1.81 Sat Aug 12 12:48:17 2023 +++ src/lib/libc/gen/vis.c Sat Aug 12 12:48:37 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.81 2023/08/12 12:48:17 riastradh Exp $ */ +/* $NetBSD: vis.c,v 1.82 2023/08/12 12:48:37 riastradh Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.81 2023/08/12 12:48:17 riastradh Exp $"); +__RCSID("$NetBSD: vis.c,v 1.82 2023/08/12 12:48:37 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -396,13 +396,14 @@ static int istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength, int flags, const char *mbextra, int *cerr_ptr) { + char mbbuf[MB_LEN_MAX]; wchar_t *dst, *src, *pdst, *psrc, *start, *extra; size_t len, olen; uint64_t bmsk, wmsk; wint_t c; visfun_t f; int clen = 0, cerr, error = -1, i, shft; - char *mbdst, *mdst; + char *mbdst, *mbwrite, *mdst; size_t mbslength; size_t maxolen; mbstate_t mbstate; @@ -579,8 +580,33 @@ istrsenvisx(char **mbdstp, size_t *dlen, olen = 0; memset(, 0, sizeof(mbstate)); for (dst = start; len > 0; len--) { - if (!cerr) - clen = wcrtomb(mbdst, *dst, ); + if (!cerr) { + /* + * If we have at least MB_CUR_MAX bytes in the buffer, + * we'll just do the conversion in-place into mbdst. We + * need to be a little more conservative when we get to + * the end of the buffer, as we may not have MB_CUR_MAX + * bytes but we may not need it. + */ + if (maxolen - olen > MB_CUR_MAX) +mbwrite = mbdst; + else +mbwrite = mbbuf; + clen = wcrtomb(mbwrite, *dst, ); + if (clen > 0 && mbwrite != mbdst) { +/* + * Don't break past our output limit, noting + * that maxolen includes the nul terminator so + * we can't write past maxolen - 1 here. + */ +if (olen + clen >= maxolen) { + errno = ENOSPC; + goto out; +} + +memcpy(mbdst, mbwrite, clen); + } + } if (cerr || clen < 0) { /* * Conversion error, process as a byte(s) instead. @@ -595,16 +621,27 @@ istrsenvisx(char **mbdstp, size_t *dlen, shft = i * NBBY; bmsk = (uint64_t)0xffLL << shft; wmsk |= bmsk; -if ((*dst & wmsk) || i == 0) +if ((*dst & wmsk) || i == 0) { + if (olen + clen + 1 >= maxolen) { + errno = ENOSPC; + goto out; + } + mbdst[clen++] = (char)( (uint64_t)(*dst & bmsk) >> shft); +} } cerr = 1; } - /* If this character would exceed our output limit, stop. */ - if (olen + clen > maxolen) - break; + + /* + * We'll be dereferencing mbdst[clen] after this to write the + * nul terminator; the above paths should have checked for a + * possible overflow already. + */ + assert(olen + clen < maxolen); + /* Advance output pointer by number of bytes written. */ mbdst += clen; /* Advance buffer character pointer. */ Index: src/tests/lib/libc/gen/t_vis.c diff -u src/tests/lib/libc/gen/t_vis.c:1.12 src/tests/lib/libc/gen/t_vis.c:1.13 --- src/tests/lib/libc/gen/t_vis.c:1.12 Sat Aug 12 12:46:16 2023 +++ src/tests/lib/libc/gen/t_vis.c Sat Aug 12 12:48:37 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.12 2023/08/12 12:46:16 riastradh Exp $ */ +/* $NetBSD: t_vis.c,v 1.13 2023/08/12 12:48:37 riastradh Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -211,8 +211,6 @@ ATF_TC_BODY(strvis_overflow_mb, tc) unsigned i; int n; - atf_tc_expect_fail("PR lib/57573: Overflow possibilities in vis(3)"); - setlocale(LC_CTYPE, "en_US.UTF-8"); for (i = 0; i < sizeof(dst) - 1; i++) { @@ -251,8 +249,6 @@ ATF_TC_BODY(strvis_overflow_c, tc) unsigned i; int n; - atf_tc_expect_fail("PR lib/57573: Overflow possibilities in vis(3)"); - for (i = 0; i < sizeof(dst) - 1; i++) { memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); n = strnvis(dst, i, src, VIS_SAFE | VIS_NOLOCALE);
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:48:17 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Avoid potential arithmetic overflow in maxolen. Can't easily prove that this overflow is impossible, so let's add a check. Prompted by PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.80 -r1.81 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.80 src/lib/libc/gen/vis.c:1.81 --- src/lib/libc/gen/vis.c:1.80 Sat Aug 12 12:48:01 2023 +++ src/lib/libc/gen/vis.c Sat Aug 12 12:48:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.80 2023/08/12 12:48:01 riastradh Exp $ */ +/* $NetBSD: vis.c,v 1.81 2023/08/12 12:48:17 riastradh Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.80 2023/08/12 12:48:01 riastradh Exp $"); +__RCSID("$NetBSD: vis.c,v 1.81 2023/08/12 12:48:17 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -567,7 +567,15 @@ istrsenvisx(char **mbdstp, size_t *dlen, * output byte-by-byte here. Else use wctomb(). */ len = wcslen(start); - maxolen = dlen ? *dlen : (len * MB_LEN_MAX + 1); + if (dlen) { + maxolen = *dlen; + } else { + if (len > (SIZE_MAX - 1)/MB_LEN_MAX) { + errno = ENOSPC; + goto out; + } + maxolen = len*MB_LEN_MAX + 1; + } olen = 0; memset(, 0, sizeof(mbstate)); for (dst = start; len > 0; len--) {
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:48:01 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Call wcslen(start) only once. It had better not change between these two times! Prompted by PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.79 src/lib/libc/gen/vis.c:1.80 --- src/lib/libc/gen/vis.c:1.79 Sat Aug 12 12:47:17 2023 +++ src/lib/libc/gen/vis.c Sat Aug 12 12:48:01 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.79 2023/08/12 12:47:17 riastradh Exp $ */ +/* $NetBSD: vis.c,v 1.80 2023/08/12 12:48:01 riastradh Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.79 2023/08/12 12:47:17 riastradh Exp $"); +__RCSID("$NetBSD: vis.c,v 1.80 2023/08/12 12:48:01 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -567,7 +567,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, * output byte-by-byte here. Else use wctomb(). */ len = wcslen(start); - maxolen = dlen ? *dlen : (wcslen(start) * MB_LEN_MAX + 1); + maxolen = dlen ? *dlen : (len * MB_LEN_MAX + 1); olen = 0; memset(, 0, sizeof(mbstate)); for (dst = start; len > 0; len--) {
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:48:01 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Call wcslen(start) only once. It had better not change between these two times! Prompted by PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.79 -r1.80 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/external/mit/xorg/etc
Module Name:src Committed By: martin Date: Sat Aug 12 12:47:48 UTC 2023 Modified Files: src/external/mit/xorg/etc/etc.dreamcast [netbsd-10]: xorg.conf.jpkbd xorg.conf.uskbd src/external/mit/xorg/etc/etc.hpc [netbsd-10]: xorg.conf.640x240-jp xorg.conf.640x240-us xorg.conf.640x480-jp xorg.conf.640x480-us xorg.conf.800x600-jp xorg.conf.800x600-us src/external/mit/xorg/etc/etc.hpcarm [netbsd-10]: xorg.conf.ws003sh xorg.conf.ws007sh xorg.conf.ws011sh xorg.conf.ws020sh src/external/mit/xorg/etc/etc.zaurus [netbsd-10]: xorg.conf.C3x00 xorg.conf.C7x0 Log Message: Pull up following revision(s) (requested by tsutsui in ticket #324): external/mit/xorg/etc/etc.zaurus/xorg.conf.C7x0: revision 1.3 external/mit/xorg/etc/etc.zaurus/xorg.conf.C7x0: revision 1.4 external/mit/xorg/etc/etc.dreamcast/xorg.conf.uskbd: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-jp: revision 1.4 external/mit/xorg/etc/etc.dreamcast/xorg.conf.uskbd: revision 1.5 external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-jp: revision 1.5 external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd: revision 1.4 external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd: revision 1.5 external/mit/xorg/etc/etc.zaurus/xorg.conf.C3x00: revision 1.3 external/mit/xorg/etc/etc.zaurus/xorg.conf.C3x00: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-us: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-us: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-us: revision 1.5 external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-us: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws007sh: revision 1.4 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws007sh: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws020sh: revision 1.4 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws011sh: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-us: revision 1.4 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws020sh: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws011sh: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws003sh: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-us: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws003sh: revision 1.5 external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-jp: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-jp: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-jp: revision 1.5 external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-jp: revision 1.5 Specify options "AutoAddDevices" to prefer xorg.conf keyboard options. Fixes PR/57346. Remove trailing tabs. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.34.1 \ src/external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd \ src/external/mit/xorg/etc/etc.dreamcast/xorg.conf.uskbd cvs rdiff -u -r1.3 -r1.3.34.1 \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-jp \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-us \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-jp \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-us \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-jp \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-us cvs rdiff -u -r1.3 -r1.3.34.1 \ src/external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws003sh \ src/external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws007sh \ src/external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws011sh \ src/external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws020sh cvs rdiff -u -r1.2 -r1.2.34.1 \ src/external/mit/xorg/etc/etc.zaurus/xorg.conf.C3x00 \ src/external/mit/xorg/etc/etc.zaurus/xorg.conf.C7x0 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/etc/etc.dreamcast/xorg.conf.jpkbd diff -u src/external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd:1.3 src/external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd:1.3.34.1 --- src/external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd:1.3 Fri Jun 20 08:08:58 2014 +++ src/external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd Sat Aug 12 12:47:47 2023 @@ -1,4 +1,4 @@ -# $NetBSD: xorg.conf.jpkbd,v 1.3 2014/06/20 08:08:58 wiz Exp $ +# $NetBSD: xorg.conf.jpkbd,v 1.3.34.1 2023/08/12 12:47:47 martin Exp $ Section "ServerLayout" Identifier "wsfb" @@ -6,11 +6,16 @@ Section "ServerLayout" InputDevice "Mouse0" "CorePointer" InputDevice "Keyboard0" "CoreKeyboard" EndSection - + Section "Files" FontPath "/usr/pkg/share/fonts/X11/TTF/" EndSection +Section "ServerFlags" + # Explicitly prefer keyboard options defined in xorg.conf + Option "AutoAddDevices" "false" +EndSection + Section "InputDevice" Identifier "Keyboard0" Driver
CVS commit: [netbsd-10] src/external/mit/xorg/etc
Module Name:src Committed By: martin Date: Sat Aug 12 12:47:48 UTC 2023 Modified Files: src/external/mit/xorg/etc/etc.dreamcast [netbsd-10]: xorg.conf.jpkbd xorg.conf.uskbd src/external/mit/xorg/etc/etc.hpc [netbsd-10]: xorg.conf.640x240-jp xorg.conf.640x240-us xorg.conf.640x480-jp xorg.conf.640x480-us xorg.conf.800x600-jp xorg.conf.800x600-us src/external/mit/xorg/etc/etc.hpcarm [netbsd-10]: xorg.conf.ws003sh xorg.conf.ws007sh xorg.conf.ws011sh xorg.conf.ws020sh src/external/mit/xorg/etc/etc.zaurus [netbsd-10]: xorg.conf.C3x00 xorg.conf.C7x0 Log Message: Pull up following revision(s) (requested by tsutsui in ticket #324): external/mit/xorg/etc/etc.zaurus/xorg.conf.C7x0: revision 1.3 external/mit/xorg/etc/etc.zaurus/xorg.conf.C7x0: revision 1.4 external/mit/xorg/etc/etc.dreamcast/xorg.conf.uskbd: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-jp: revision 1.4 external/mit/xorg/etc/etc.dreamcast/xorg.conf.uskbd: revision 1.5 external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-jp: revision 1.5 external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd: revision 1.4 external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd: revision 1.5 external/mit/xorg/etc/etc.zaurus/xorg.conf.C3x00: revision 1.3 external/mit/xorg/etc/etc.zaurus/xorg.conf.C3x00: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-us: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-us: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-us: revision 1.5 external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-us: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws007sh: revision 1.4 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws007sh: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws020sh: revision 1.4 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws011sh: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-us: revision 1.4 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws020sh: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws011sh: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws003sh: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-us: revision 1.5 external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws003sh: revision 1.5 external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-jp: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-jp: revision 1.4 external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-jp: revision 1.5 external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-jp: revision 1.5 Specify options "AutoAddDevices" to prefer xorg.conf keyboard options. Fixes PR/57346. Remove trailing tabs. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.34.1 \ src/external/mit/xorg/etc/etc.dreamcast/xorg.conf.jpkbd \ src/external/mit/xorg/etc/etc.dreamcast/xorg.conf.uskbd cvs rdiff -u -r1.3 -r1.3.34.1 \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-jp \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.640x240-us \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-jp \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.640x480-us \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-jp \ src/external/mit/xorg/etc/etc.hpc/xorg.conf.800x600-us cvs rdiff -u -r1.3 -r1.3.34.1 \ src/external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws003sh \ src/external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws007sh \ src/external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws011sh \ src/external/mit/xorg/etc/etc.hpcarm/xorg.conf.ws020sh cvs rdiff -u -r1.2 -r1.2.34.1 \ src/external/mit/xorg/etc/etc.zaurus/xorg.conf.C3x00 \ src/external/mit/xorg/etc/etc.zaurus/xorg.conf.C7x0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:47:17 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Avoid arithmetic overflow before calloc(3). Prompted by PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.78 src/lib/libc/gen/vis.c:1.79 --- src/lib/libc/gen/vis.c:1.78 Sat Aug 12 12:46:50 2023 +++ src/lib/libc/gen/vis.c Sat Aug 12 12:47:17 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.78 2023/08/12 12:46:50 riastradh Exp $ */ +/* $NetBSD: vis.c,v 1.79 2023/08/12 12:47:17 riastradh Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.78 2023/08/12 12:46:50 riastradh Exp $"); +__RCSID("$NetBSD: vis.c,v 1.79 2023/08/12 12:47:17 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -432,6 +432,14 @@ istrsenvisx(char **mbdstp, size_t *dlen, * return to the caller. */ + /* + * Guarantee the arithmetic on input to calloc won't overflow. + */ + if (mbslength > (SIZE_MAX - 1)/16) { + errno = ENOMEM; + return -1; + } + /* Allocate space for the wide char strings */ psrc = pdst = extra = NULL; mdst = NULL;
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:47:17 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Avoid arithmetic overflow before calloc(3). Prompted by PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.78 -r1.79 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:46:50 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Make mbslength unsigned. Sprinkle assertions and comments justifying the proposition that it would never go negative if signed. Obviates need to worry about mblength > SSIZE_MAX. Prompted by PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.77 src/lib/libc/gen/vis.c:1.78 --- src/lib/libc/gen/vis.c:1.77 Sat Aug 12 12:46:33 2023 +++ src/lib/libc/gen/vis.c Sat Aug 12 12:46:50 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.77 2023/08/12 12:46:33 riastradh Exp $ */ +/* $NetBSD: vis.c,v 1.78 2023/08/12 12:46:50 riastradh Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.77 2023/08/12 12:46:33 riastradh Exp $"); +__RCSID("$NetBSD: vis.c,v 1.78 2023/08/12 12:46:50 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -403,7 +403,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, visfun_t f; int clen = 0, cerr, error = -1, i, shft; char *mbdst, *mdst; - ssize_t mbslength; + size_t mbslength; size_t maxolen; mbstate_t mbstate; @@ -411,7 +411,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, _DIAGASSERT(mbsrc != NULL || mblength == 0); _DIAGASSERT(mbextra != NULL); - mbslength = (ssize_t)mblength; + mbslength = mblength; /* * When inputing a single character, must also read in the * next character for nextc, the look-ahead character. @@ -466,12 +466,15 @@ istrsenvisx(char **mbdstp, size_t *dlen, memset(, 0, sizeof(mbstate)); while (mbslength > 0) { /* Convert one multibyte character to wchar_t. */ - if (!cerr) + if (!cerr) { clen = mbrtowc(src, mbsrc, (mbslength < MB_LEN_MAX ? mbslength : MB_LEN_MAX), ); + assert(clen < 0 || (size_t)clen <= mbslength); + assert(clen <= MB_LEN_MAX); + } if (cerr || clen < 0) { /* Conversion error, process as a byte instead. */ *src = (wint_t)(u_char)*mbsrc; @@ -485,6 +488,20 @@ istrsenvisx(char **mbdstp, size_t *dlen, */ clen = 1; } + /* + * Let n := MIN(mbslength, MB_LEN_MAX). We have: + * + * mbslength >= 1 + * mbrtowc(..., n, ) <= n, + * by the contract of mbrtowc + * + * clen is either + * (a) mbrtowc(..., n, ), in which case + * clen <= n <= mbslength; or + * (b) 1, in which case clen = 1 <= mbslength. + */ + assert(clen > 0); + assert((size_t)clen <= mbslength); /* Advance buffer character pointer. */ src++; /* Advance input pointer by number of bytes read. */
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:46:50 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Make mbslength unsigned. Sprinkle assertions and comments justifying the proposition that it would never go negative if signed. Obviates need to worry about mblength > SSIZE_MAX. Prompted by PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.77 -r1.78 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:46:33 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Make maxolen unsigned size_t, not ssize_t. It is initialized once either to *dlen, which is unsigned size_t, or to wcslen(start) * MB_MAX_LEN + 1, and wcslen returns unsigned size_t too. So there appears to have never been any reason for this to be signed. Part of PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/lib/libc/gen/vis.c diff -u src/lib/libc/gen/vis.c:1.76 src/lib/libc/gen/vis.c:1.77 --- src/lib/libc/gen/vis.c:1.76 Thu Jun 29 16:11:31 2023 +++ src/lib/libc/gen/vis.c Sat Aug 12 12:46:33 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vis.c,v 1.76 2023/06/29 16:11:31 riastradh Exp $ */ +/* $NetBSD: vis.c,v 1.77 2023/08/12 12:46:33 riastradh Exp $ */ /*- * Copyright (c) 1989, 1993 @@ -57,7 +57,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: vis.c,v 1.76 2023/06/29 16:11:31 riastradh Exp $"); +__RCSID("$NetBSD: vis.c,v 1.77 2023/08/12 12:46:33 riastradh Exp $"); #endif /* LIBC_SCCS and not lint */ #ifdef __FBSDID __FBSDID("$FreeBSD$"); @@ -403,7 +403,8 @@ istrsenvisx(char **mbdstp, size_t *dlen, visfun_t f; int clen = 0, cerr, error = -1, i, shft; char *mbdst, *mdst; - ssize_t mbslength, maxolen; + ssize_t mbslength; + size_t maxolen; mbstate_t mbstate; _DIAGASSERT(mbdstp != NULL); @@ -569,7 +570,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, cerr = 1; } /* If this character would exceed our output limit, stop. */ - if (olen + clen > (size_t)maxolen) + if (olen + clen > maxolen) break; /* Advance output pointer by number of bytes written. */ mbdst += clen;
CVS commit: src/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:46:33 UTC 2023 Modified Files: src/lib/libc/gen: vis.c Log Message: vis(3): Make maxolen unsigned size_t, not ssize_t. It is initialized once either to *dlen, which is unsigned size_t, or to wcslen(start) * MB_MAX_LEN + 1, and wcslen returns unsigned size_t too. So there appears to have never been any reason for this to be signed. Part of PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.76 -r1.77 src/lib/libc/gen/vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:46:16 UTC 2023 Modified Files: src/tests/lib/libc/gen: t_vis.c Log Message: vis(3) tests: Test another overflow edge case. Related to PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/gen/t_vis.c diff -u src/tests/lib/libc/gen/t_vis.c:1.11 src/tests/lib/libc/gen/t_vis.c:1.12 --- src/tests/lib/libc/gen/t_vis.c:1.11 Sat Aug 12 12:45:03 2023 +++ src/tests/lib/libc/gen/t_vis.c Sat Aug 12 12:46:16 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.11 2023/08/12 12:45:03 riastradh Exp $ */ +/* $NetBSD: t_vis.c,v 1.12 2023/08/12 12:46:16 riastradh Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -116,6 +116,25 @@ ATF_TC_BODY(strvis_empty, tc) ATF_REQUIRE(dst[0] == '\0' && dst[1] == 'a'); } +ATF_TC(strnvis_empty_empty); +ATF_TC_HEAD(strnvis_empty_empty, tc) +{ + atf_tc_set_md_var(tc, "descr", + "Test strnvis(3) with empty source and destination"); +} + +ATF_TC_BODY(strnvis_empty_empty, tc) +{ + char dst[] = "fail"; + int n; + + atf_tc_expect_fail("PR lib/57573: Overflow possibilities in vis(3)"); + + n = strnvis(dst, 0, "", VIS_SAFE); + ATF_CHECK(memcmp(dst, "fail", sizeof(dst)) == 0); + ATF_CHECK_EQ_MSG(n, -1, "n=%d", n); +} + ATF_TC(strunvis_hex); ATF_TC_HEAD(strunvis_hex, tc) { @@ -261,6 +280,7 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strvis_basic); ATF_TP_ADD_TC(tp, strvis_null); ATF_TP_ADD_TC(tp, strvis_empty); + ATF_TP_ADD_TC(tp, strnvis_empty_empty); ATF_TP_ADD_TC(tp, strunvis_hex); #ifdef VIS_NOLOCALE ATF_TP_ADD_TC(tp, strvis_locale);
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:46:16 UTC 2023 Modified Files: src/tests/lib/libc/gen: t_vis.c Log Message: vis(3) tests: Test another overflow edge case. Related to PR lib/57573. XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:45:03 UTC 2023 Modified Files: src/tests/lib/libc/gen: t_vis.c Log Message: vis(3) tests: Expand tests and diagnostic outputs on failure. PR lib/57573 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/gen/t_vis.c diff -u src/tests/lib/libc/gen/t_vis.c:1.10 src/tests/lib/libc/gen/t_vis.c:1.11 --- src/tests/lib/libc/gen/t_vis.c:1.10 Sat Aug 12 12:43:26 2023 +++ src/tests/lib/libc/gen/t_vis.c Sat Aug 12 12:45:03 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.10 2023/08/12 12:43:26 riastradh Exp $ */ +/* $NetBSD: t_vis.c,v 1.11 2023/08/12 12:45:03 riastradh Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -175,7 +175,7 @@ ATF_TC_BODY(strvis_locale, tc) } #endif /* VIS_NOLOCALE */ -#define STRVIS_OVERFLOW_MARKER 0xff /* Arbitrary */ +#define STRVIS_OVERFLOW_MARKER ((char)0xff) /* Arbitrary */ #ifdef VIS_NOLOCALE ATF_TC(strvis_overflow_mb); @@ -189,25 +189,32 @@ ATF_TC_BODY(strvis_overflow_mb, tc) const char src[] = "\xf0\x9f\xa5\x91"; /* Extra byte to detect overflow */ char dst[sizeof(src) + 1]; + unsigned i; int n; atf_tc_expect_fail("PR lib/57573: Overflow possibilities in vis(3)"); setlocale(LC_CTYPE, "en_US.UTF-8"); - /* Arbitrary */ - memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); - - /* - * If we only provide four bytes of buffer, we shouldn't be able encode - * a full 4-byte sequence. - */ - n = strnvis(dst, 4, src, VIS_SAFE); - ATF_REQUIRE(dst[4] == STRVIS_OVERFLOW_MARKER); - ATF_REQUIRE(n == -1); + for (i = 0; i < sizeof(dst) - 1; i++) { + memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); + n = strnvis(dst, i, src, VIS_SAFE); + ATF_CHECK_EQ_MSG(dst[i], STRVIS_OVERFLOW_MARKER, + "[%u] dst=[%02hhx %02hhx %02hhx %02hhx %02hhx]" + " STRVIS_OVERFLOW_MARKER=%02hhx", + i, dst[0], dst[1], dst[2], dst[3], dst[4], + STRVIS_OVERFLOW_MARKER); + ATF_CHECK_EQ_MSG(n, -1, "[%u] n=%d", i, n); + } - n = strnvis(dst, sizeof(src), src, VIS_SAFE); - ATF_REQUIRE(n == sizeof(src) - 1); + memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); + n = strnvis(dst, sizeof(dst) - 1, src, VIS_SAFE); + ATF_CHECK_EQ_MSG(dst[sizeof(dst) - 1], STRVIS_OVERFLOW_MARKER, + "[%u] dst=[%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx]" + " STRVIS_OVERFLOW_MARKER=%02hhx", + i, dst[0], dst[1], dst[2], dst[3], dst[4], dst[5], + STRVIS_OVERFLOW_MARKER); + ATF_CHECK_EQ_MSG(n, (int)sizeof(dst) - 2, "n=%d", n); } #endif @@ -222,23 +229,30 @@ ATF_TC_BODY(strvis_overflow_c, tc) const char src[] = ""; /* Extra byte to detect overflow */ char dst[sizeof(src) + 1]; + unsigned i; int n; atf_tc_expect_fail("PR lib/57573: Overflow possibilities in vis(3)"); - /* Arbitrary */ - memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); - - /* - * If we only provide four bytes of buffer, we shouldn't be able encode - * 4 bytes of input. - */ - n = strnvis(dst, 4, src, VIS_SAFE | VIS_NOLOCALE); - ATF_REQUIRE(dst[4] == STRVIS_OVERFLOW_MARKER); - ATF_REQUIRE(n == -1); + for (i = 0; i < sizeof(dst) - 1; i++) { + memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); + n = strnvis(dst, i, src, VIS_SAFE | VIS_NOLOCALE); + ATF_CHECK_EQ_MSG(dst[i], STRVIS_OVERFLOW_MARKER, + "[%u] dst=[%02hhx %02hhx %02hhx %02hhx %02hhx]" + " STRVIS_OVERFLOW_MARKER=%02hhx", + i, dst[0], dst[1], dst[2], dst[3], dst[4], + STRVIS_OVERFLOW_MARKER); + ATF_CHECK_EQ_MSG(n, -1, "[%u] n=%d", i, n); + } - n = strnvis(dst, sizeof(src), src, VIS_SAFE | VIS_NOLOCALE); - ATF_REQUIRE(n == sizeof(src) - 1); + memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); + n = strnvis(dst, sizeof(dst) - 1, src, VIS_SAFE | VIS_NOLOCALE); + ATF_CHECK_EQ_MSG(dst[sizeof(dst) - 1], STRVIS_OVERFLOW_MARKER, + "[%u] dst=[%02hhx %02hhx %02hhx %02hhx %02hhx %02hhx]" + " STRVIS_OVERFLOW_MARKER=%02hhx", + i, dst[0], dst[1], dst[2], dst[3], dst[4], dst[5], + STRVIS_OVERFLOW_MARKER); + ATF_CHECK_EQ_MSG(n, (int)sizeof(dst) - 2, "n=%d", n); } ATF_TP_ADD_TCS(tp)
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:45:03 UTC 2023 Modified Files: src/tests/lib/libc/gen: t_vis.c Log Message: vis(3) tests: Expand tests and diagnostic outputs on failure. PR lib/57573 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:43:26 UTC 2023 Modified Files: src/tests/lib/libc/gen: t_vis.c Log Message: vis(3) tests: Add xfail test for encoding overflow. >From Kyle Evans . PR lib/57573 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/tests/lib/libc/gen/t_vis.c diff -u src/tests/lib/libc/gen/t_vis.c:1.9 src/tests/lib/libc/gen/t_vis.c:1.10 --- src/tests/lib/libc/gen/t_vis.c:1.9 Tue Jan 10 15:16:57 2017 +++ src/tests/lib/libc/gen/t_vis.c Sat Aug 12 12:43:26 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: t_vis.c,v 1.9 2017/01/10 15:16:57 christos Exp $ */ +/* $NetBSD: t_vis.c,v 1.10 2023/08/12 12:43:26 riastradh Exp $ */ /*- * Copyright (c) 2002 The NetBSD Foundation, Inc. @@ -175,6 +175,72 @@ ATF_TC_BODY(strvis_locale, tc) } #endif /* VIS_NOLOCALE */ +#define STRVIS_OVERFLOW_MARKER 0xff /* Arbitrary */ + +#ifdef VIS_NOLOCALE +ATF_TC(strvis_overflow_mb); +ATF_TC_HEAD(strvis_overflow_mb, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test strvis(3) multi-byte overflow"); +} + +ATF_TC_BODY(strvis_overflow_mb, tc) +{ + const char src[] = "\xf0\x9f\xa5\x91"; + /* Extra byte to detect overflow */ + char dst[sizeof(src) + 1]; + int n; + + atf_tc_expect_fail("PR lib/57573: Overflow possibilities in vis(3)"); + + setlocale(LC_CTYPE, "en_US.UTF-8"); + + /* Arbitrary */ + memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); + + /* + * If we only provide four bytes of buffer, we shouldn't be able encode + * a full 4-byte sequence. + */ + n = strnvis(dst, 4, src, VIS_SAFE); + ATF_REQUIRE(dst[4] == STRVIS_OVERFLOW_MARKER); + ATF_REQUIRE(n == -1); + + n = strnvis(dst, sizeof(src), src, VIS_SAFE); + ATF_REQUIRE(n == sizeof(src) - 1); +} +#endif + +ATF_TC(strvis_overflow_c); +ATF_TC_HEAD(strvis_overflow_c, tc) +{ + atf_tc_set_md_var(tc, "descr", "Test strvis(3) C locale overflow"); +} + +ATF_TC_BODY(strvis_overflow_c, tc) +{ + const char src[] = ""; + /* Extra byte to detect overflow */ + char dst[sizeof(src) + 1]; + int n; + + atf_tc_expect_fail("PR lib/57573: Overflow possibilities in vis(3)"); + + /* Arbitrary */ + memset(dst, STRVIS_OVERFLOW_MARKER, sizeof(dst)); + + /* + * If we only provide four bytes of buffer, we shouldn't be able encode + * 4 bytes of input. + */ + n = strnvis(dst, 4, src, VIS_SAFE | VIS_NOLOCALE); + ATF_REQUIRE(dst[4] == STRVIS_OVERFLOW_MARKER); + ATF_REQUIRE(n == -1); + + n = strnvis(dst, sizeof(src), src, VIS_SAFE | VIS_NOLOCALE); + ATF_REQUIRE(n == sizeof(src) - 1); +} + ATF_TP_ADD_TCS(tp) { @@ -184,7 +250,9 @@ ATF_TP_ADD_TCS(tp) ATF_TP_ADD_TC(tp, strunvis_hex); #ifdef VIS_NOLOCALE ATF_TP_ADD_TC(tp, strvis_locale); + ATF_TP_ADD_TC(tp, strvis_overflow_mb); #endif /* VIS_NOLOCALE */ + ATF_TP_ADD_TC(tp, strvis_overflow_c); return atf_no_error(); }
CVS commit: src/tests/lib/libc/gen
Module Name:src Committed By: riastradh Date: Sat Aug 12 12:43:26 UTC 2023 Modified Files: src/tests/lib/libc/gen: t_vis.c Log Message: vis(3) tests: Add xfail test for encoding overflow. >From Kyle Evans . PR lib/57573 XXX pullup-10 XXX pullup-9 XXX pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/tests/lib/libc/gen/t_vis.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Sat Aug 12 12:41:58 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Ammend ticket #317 for more pullups To generate a diff of this commit: cvs rdiff -u -r1.1.2.104 -r1.1.2.105 src/doc/CHANGES-10.0 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-10.0 diff -u src/doc/CHANGES-10.0:1.1.2.104 src/doc/CHANGES-10.0:1.1.2.105 --- src/doc/CHANGES-10.0:1.1.2.104 Sat Aug 12 12:00:19 2023 +++ src/doc/CHANGES-10.0 Sat Aug 12 12:41:58 2023 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-10.0,v 1.1.2.104 2023/08/12 12:00:19 martin Exp $ +# $NetBSD: CHANGES-10.0,v 1.1.2.105 2023/08/12 12:41:58 martin Exp $ A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16 until the 10.0 release: @@ -10824,6 +10824,10 @@ external/bsd/libfido2/bin/fido2-token/Ma external/bsd/libfido2/dist/src/assert.c 1.2 external/bsd/libfido2/dist/src/cred.c 1.2 external/bsd/libfido2/lib/Makefile 1.9 +external/bsd/nsd/lib/libnsd/Makefile 1.4,1.5 +external/bsd/nsd/sbin/nsd-checkzone/Makefile 1.2 +external/bsd/nsd/sbin/nsd-control/Makefile 1.2 +external/bsd/nsd/sbin/nsd/Makefile 1.2 external/bsd/ntp/bin/ntp-keygen/Makefile 1.8 external/bsd/ntp/bin/ntpd/Makefile 1.29 external/bsd/ntp/bin/sntp/Makefile 1.10
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Sat Aug 12 12:41:58 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Ammend ticket #317 for more pullups To generate a diff of this commit: cvs rdiff -u -r1.1.2.104 -r1.1.2.105 src/doc/CHANGES-10.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: christos Date: Sat Aug 12 12:40:41 UTC 2023 Modified Files: src/distrib/sets/lists/comp: mi Log Message: off-by-one To generate a diff of this commit: cvs rdiff -u -r1.2447 -r1.2448 src/distrib/sets/lists/comp/mi 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/comp/mi diff -u src/distrib/sets/lists/comp/mi:1.2447 src/distrib/sets/lists/comp/mi:1.2448 --- src/distrib/sets/lists/comp/mi:1.2447 Fri Aug 11 19:04:29 2023 +++ src/distrib/sets/lists/comp/mi Sat Aug 12 08:40:41 2023 @@ -1,4 +1,4 @@ -# $NetBSD: mi,v 1.2447 2023/08/11 23:04:29 christos Exp $ +# $NetBSD: mi,v 1.2448 2023/08/12 12:40:41 christos Exp $ # # Note: don't delete entries from here - mark them as "obsolete" instead. ./etc/mtree/set.compcomp-sys-root @@ -958,9 +958,9 @@ ./usr/include/fido/eddsa.h comp-c-include ./usr/include/fido/err.h comp-c-include ./usr/include/fido/es256.h comp-c-include +./usr/include/fido/es384.h comp-c-include ./usr/include/fido/param.h comp-c-include ./usr/include/fido/rs256.h comp-c-include -./usr/include/fido/rs384.h comp-c-include ./usr/include/fido/types.h comp-c-include ./usr/include/filecorefs/filecore_mount.h comp-c-include ./usr/include/float.hcomp-c-include
CVS commit: src/distrib/sets/lists/comp
Module Name:src Committed By: christos Date: Sat Aug 12 12:40:41 UTC 2023 Modified Files: src/distrib/sets/lists/comp: mi Log Message: off-by-one To generate a diff of this commit: cvs rdiff -u -r1.2447 -r1.2448 src/distrib/sets/lists/comp/mi Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/external/bsd/nsd
Module Name:src Committed By: martin Date: Sat Aug 12 12:39:52 UTC 2023 Modified Files: src/external/bsd/nsd/lib/libnsd [netbsd-10]: Makefile src/external/bsd/nsd/sbin/nsd [netbsd-10]: Makefile src/external/bsd/nsd/sbin/nsd-checkzone [netbsd-10]: Makefile src/external/bsd/nsd/sbin/nsd-control [netbsd-10]: Makefile Log Message: Additionaly pull up following revision(s) (requested by riastradh in ticket #317): external/bsd/nsd/sbin/nsd/Makefile: revision 1.2 external/bsd/nsd/sbin/nsd-control/Makefile: revision 1.2 external/bsd/nsd/sbin/nsd-checkzone/Makefile: revision 1.2 external/bsd/nsd/lib/libnsd/Makefile: revision 1.4 external/bsd/nsd/lib/libnsd/Makefile: revision 1.5 Handle OpenSSL-3.x To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.2.1 src/external/bsd/nsd/lib/libnsd/Makefile cvs rdiff -u -r1.1 -r1.1.26.1 src/external/bsd/nsd/sbin/nsd/Makefile cvs rdiff -u -r1.1 -r1.1.26.1 \ src/external/bsd/nsd/sbin/nsd-checkzone/Makefile cvs rdiff -u -r1.1 -r1.1.26.1 src/external/bsd/nsd/sbin/nsd-control/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/bsd/nsd/lib/libnsd/Makefile diff -u src/external/bsd/nsd/lib/libnsd/Makefile:1.3 src/external/bsd/nsd/lib/libnsd/Makefile:1.3.2.1 --- src/external/bsd/nsd/lib/libnsd/Makefile:1.3 Sat Sep 24 17:38:18 2022 +++ src/external/bsd/nsd/lib/libnsd/Makefile Sat Aug 12 12:39:52 2023 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.3 2022/09/24 17:38:18 christos Exp $ +# $NetBSD: Makefile,v 1.3.2.1 2023/08/12 12:39:52 martin Exp $ LIBISPRIVATE=yes .include @@ -51,5 +51,9 @@ LIBDPLIBS+= ${DPLIBS} .include +COPTS.tsig-openssl.c+= -Wno-error=deprecated-declarations +COPTS.iterated_hash.c+= -Wno-error=deprecated-declarations + + # Use the generated files .y.c: Index: src/external/bsd/nsd/sbin/nsd/Makefile diff -u src/external/bsd/nsd/sbin/nsd/Makefile:1.1 src/external/bsd/nsd/sbin/nsd/Makefile:1.1.26.1 --- src/external/bsd/nsd/sbin/nsd/Makefile:1.1 Sat Jan 7 19:51:22 2017 +++ src/external/bsd/nsd/sbin/nsd/Makefile Sat Aug 12 12:39:52 2023 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2017/01/07 19:51:22 christos Exp $ +# $NetBSD: Makefile,v 1.1.26.1 2023/08/12 12:39:52 martin Exp $ PROG=nsd @@ -18,4 +18,6 @@ zparser.c MAN+=${PROG}.conf.5 ${PROG}.conf.5: ${PROG}.conf.5.in __subst +COPTS.server.c+= -Wno-error=deprecated-declarations + .include Index: src/external/bsd/nsd/sbin/nsd-checkzone/Makefile diff -u src/external/bsd/nsd/sbin/nsd-checkzone/Makefile:1.1 src/external/bsd/nsd/sbin/nsd-checkzone/Makefile:1.1.26.1 --- src/external/bsd/nsd/sbin/nsd-checkzone/Makefile:1.1 Sat Jan 7 19:51:22 2017 +++ src/external/bsd/nsd/sbin/nsd-checkzone/Makefile Sat Aug 12 12:39:52 2023 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.1 2017/01/07 19:51:22 christos Exp $ +# $NetBSD: Makefile,v 1.1.26.1 2023/08/12 12:39:52 martin Exp $ PROG=nsd-checkzone @@ -15,4 +15,6 @@ zlexer.c \ zonec.c \ zparser.c +COPTS.server.c+= -Wno-error=deprecated-declarations + .include Index: src/external/bsd/nsd/sbin/nsd-control/Makefile diff -u src/external/bsd/nsd/sbin/nsd-control/Makefile:1.1 src/external/bsd/nsd/sbin/nsd-control/Makefile:1.1.26.1 --- src/external/bsd/nsd/sbin/nsd-control/Makefile:1.1 Sat Jan 7 19:51:22 2017 +++ src/external/bsd/nsd/sbin/nsd-control/Makefile Sat Aug 12 12:39:52 2023 @@ -1,5 +1,7 @@ -# $NetBSD: Makefile,v 1.1 2017/01/07 19:51:22 christos Exp $ +# $NetBSD: Makefile,v 1.1.26.1 2023/08/12 12:39:52 martin Exp $ PROG=nsd-control +COPTS.nsd-control.c+= -Wno-error=deprecated-declarations + .include
CVS commit: [netbsd-10] src/external/bsd/nsd
Module Name:src Committed By: martin Date: Sat Aug 12 12:39:52 UTC 2023 Modified Files: src/external/bsd/nsd/lib/libnsd [netbsd-10]: Makefile src/external/bsd/nsd/sbin/nsd [netbsd-10]: Makefile src/external/bsd/nsd/sbin/nsd-checkzone [netbsd-10]: Makefile src/external/bsd/nsd/sbin/nsd-control [netbsd-10]: Makefile Log Message: Additionaly pull up following revision(s) (requested by riastradh in ticket #317): external/bsd/nsd/sbin/nsd/Makefile: revision 1.2 external/bsd/nsd/sbin/nsd-control/Makefile: revision 1.2 external/bsd/nsd/sbin/nsd-checkzone/Makefile: revision 1.2 external/bsd/nsd/lib/libnsd/Makefile: revision 1.4 external/bsd/nsd/lib/libnsd/Makefile: revision 1.5 Handle OpenSSL-3.x To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.3.2.1 src/external/bsd/nsd/lib/libnsd/Makefile cvs rdiff -u -r1.1 -r1.1.26.1 src/external/bsd/nsd/sbin/nsd/Makefile cvs rdiff -u -r1.1 -r1.1.26.1 \ src/external/bsd/nsd/sbin/nsd-checkzone/Makefile cvs rdiff -u -r1.1 -r1.1.26.1 src/external/bsd/nsd/sbin/nsd-control/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Sat Aug 12 12:00:19 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Entry for ticket #317 adjusted for additional pullups To generate a diff of this commit: cvs rdiff -u -r1.1.2.103 -r1.1.2.104 src/doc/CHANGES-10.0 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/doc
Module Name:src Committed By: martin Date: Sat Aug 12 12:00:19 UTC 2023 Modified Files: src/doc [netbsd-10]: CHANGES-10.0 Log Message: Entry for ticket #317 adjusted for additional pullups To generate a diff of this commit: cvs rdiff -u -r1.1.2.103 -r1.1.2.104 src/doc/CHANGES-10.0 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-10.0 diff -u src/doc/CHANGES-10.0:1.1.2.103 src/doc/CHANGES-10.0:1.1.2.104 --- src/doc/CHANGES-10.0:1.1.2.103 Fri Aug 11 18:12:57 2023 +++ src/doc/CHANGES-10.0 Sat Aug 12 12:00:19 2023 @@ -1,4 +1,4 @@ -# $NetBSD: CHANGES-10.0,v 1.1.2.103 2023/08/11 18:12:57 martin Exp $ +# $NetBSD: CHANGES-10.0,v 1.1.2.104 2023/08/12 12:00:19 martin Exp $ A complete list of changes from the initial NetBSD 10.0 branch on 2022-12-16 until the 10.0 release: @@ -10795,7 +10795,7 @@ crypto/external/bsd/openssh/lib/Makefile crypto/external/bsd/openssh/libexec/ssh-sk-helper/Makefile 1.4 distrib/sets/deps1.23 distrib/sets/lists/base/ad.aarch64 1.38-1.43 (patch) -distrib/sets/lists/base/ad.mips 1.84,1.87,1.88,1.90 (patch) +distrib/sets/lists/base/ad.mips 1.84,1.87,1.88-1.90 (patch) distrib/sets/lists/base/ad.powerpc 1.41,1.42,1.45-1.47 (patch) distrib/sets/lists/base/ad.riscv 1.24,1.25,1.28,1.29,1.30 (patch) distrib/sets/lists/base/md.amd64 1.288,1.291-1.293,1.295 (patch)
CVS commit: [netbsd-10] src/distrib/sets/lists/base
Module Name:src Committed By: martin Date: Sat Aug 12 11:50:28 UTC 2023 Modified Files: src/distrib/sets/lists/base [netbsd-10]: ad.mips Log Message: Additionally pull up following revision(s) (requested by riastradh in ticket #317): distrib/sets/lists/base/ad.mips: revision 1.89 openssl: Fix typo in mips set list. To generate a diff of this commit: cvs rdiff -u -r1.83.6.1 -r1.83.6.2 src/distrib/sets/lists/base/ad.mips Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: [netbsd-10] src/distrib/sets/lists/base
Module Name:src Committed By: martin Date: Sat Aug 12 11:50:28 UTC 2023 Modified Files: src/distrib/sets/lists/base [netbsd-10]: ad.mips Log Message: Additionally pull up following revision(s) (requested by riastradh in ticket #317): distrib/sets/lists/base/ad.mips: revision 1.89 openssl: Fix typo in mips set list. To generate a diff of this commit: cvs rdiff -u -r1.83.6.1 -r1.83.6.2 src/distrib/sets/lists/base/ad.mips 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/base/ad.mips diff -u src/distrib/sets/lists/base/ad.mips:1.83.6.1 src/distrib/sets/lists/base/ad.mips:1.83.6.2 --- src/distrib/sets/lists/base/ad.mips:1.83.6.1 Fri Aug 11 13:42:53 2023 +++ src/distrib/sets/lists/base/ad.mips Sat Aug 12 11:50:28 2023 @@ -1,4 +1,4 @@ -# $NetBSD: ad.mips,v 1.83.6.1 2023/08/11 13:42:53 martin Exp $ +# $NetBSD: ad.mips,v 1.83.6.2 2023/08/12 11:50:28 martin Exp $ ./lib/libc_fp.sobase-sys-shlib dynamicroot,softfloat,arch64 ./lib/libc_fp.so.0base-sys-shlib dynamicroot,softfloat,arch64 ./lib/libc_fp.so.0.0base-sys-shlib dynamicroot,softfloat,arch64 @@ -11,8 +11,8 @@ ./usr/lib/64/openssl base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb ./usr/lib/64/openssl/engines base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb ./usr/lib/64/openssl/engines/dasync.so base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb,openssl=30 -./usr/lib/64/openssl/engines/devcryptoapi.so base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb,openssl=30 -./usr/lib/64/openssl/engines/loader_atticapi.so base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb,openssl=30 +./usr/lib/64/openssl/engines/devcrypto.so base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb,openssl=30 +./usr/lib/64/openssl/engines/loader_attic.so base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb,openssl=30 ./usr/lib/64/openssl/engines/ossltest.so base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb,openssl=30 ./usr/lib/64/openssl/modules base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb ./usr/lib/64/openssl/modules/legacy.so base-compat-shlib compat,pic,arch64,!machine_arch=mipsn64el,!machine_arch=mipsn64eb
CVS commit: src/sys/arch/riscv/include
Module Name:src Committed By: skrll Date: Sat Aug 12 07:48:12 UTC 2023 Modified Files: src/sys/arch/riscv/include: pmap.h Log Message: risc-v: Use 'onproc' for 2nd arg of pmap_md_page_syncicache Match other definitions of pmap_md_page_syncicache argument naming by renaming the 2nd arg to 'onproc' To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/riscv/include/pmap.h 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/riscv/include/pmap.h diff -u src/sys/arch/riscv/include/pmap.h:1.19 src/sys/arch/riscv/include/pmap.h:1.20 --- src/sys/arch/riscv/include/pmap.h:1.19 Wed Jul 26 06:58:34 2023 +++ src/sys/arch/riscv/include/pmap.h Sat Aug 12 07:48:11 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: pmap.h,v 1.19 2023/07/26 06:58:34 skrll Exp $ */ +/* $NetBSD: pmap.h,v 1.20 2023/08/12 07:48:11 skrll Exp $ */ /* * Copyright (c) 2014, 2019, 2021 The NetBSD Foundation, Inc. @@ -191,7 +191,7 @@ pmap_md_tlb_check_entry(void *ctx, vaddr } static inline void -pmap_md_page_syncicache(struct vm_page_md *mdpg, const kcpuset_t *kc) +pmap_md_page_syncicache(struct vm_page_md *mdpg, const kcpuset_t *onproc) { __asm __volatile("fence\trw,rw; fence.i" ::: "memory"); }
CVS commit: src/sys/arch/riscv/include
Module Name:src Committed By: skrll Date: Sat Aug 12 07:48:12 UTC 2023 Modified Files: src/sys/arch/riscv/include: pmap.h Log Message: risc-v: Use 'onproc' for 2nd arg of pmap_md_page_syncicache Match other definitions of pmap_md_page_syncicache argument naming by renaming the 2nd arg to 'onproc' To generate a diff of this commit: cvs rdiff -u -r1.19 -r1.20 src/sys/arch/riscv/include/pmap.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/ftp
Module Name:src Committed By: mlelstv Date: Sat Aug 12 07:40:13 UTC 2023 Modified Files: src/usr.bin/ftp: fetch.c Log Message: Don't finish downloading an empty file with 'already done' before it is created locally. To generate a diff of this commit: cvs rdiff -u -r1.237 -r1.238 src/usr.bin/ftp/fetch.c 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/ftp/fetch.c diff -u src/usr.bin/ftp/fetch.c:1.237 src/usr.bin/ftp/fetch.c:1.238 --- src/usr.bin/ftp/fetch.c:1.237 Sun Jul 2 10:02:09 2023 +++ src/usr.bin/ftp/fetch.c Sat Aug 12 07:40:13 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: fetch.c,v 1.237 2023/07/02 10:02:09 mlelstv Exp $ */ +/* $NetBSD: fetch.c,v 1.238 2023/08/12 07:40:13 mlelstv Exp $ */ /*- * Copyright (c) 1997-2015 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #include #ifndef lint -__RCSID("$NetBSD: fetch.c,v 1.237 2023/07/02 10:02:09 mlelstv Exp $"); +__RCSID("$NetBSD: fetch.c,v 1.238 2023/08/12 07:40:13 mlelstv Exp $"); #endif /* not lint */ /* @@ -1652,9 +1652,10 @@ fetch_url(const char *url, const char *p } } if (fout == NULL) { - if ((pi.rangeend != -1 && pi.rangeend <= restart_point) || + if (restart_point && ( + (pi.rangeend != -1 && pi.rangeend <= restart_point) || (pi.rangestart == -1 && - filesize != -1 && filesize <= restart_point)) { + filesize != -1 && filesize <= restart_point))) { /* already done */ if (verbose) fprintf(ttyout, "already done\n");
CVS commit: src/usr.bin/ftp
Module Name:src Committed By: mlelstv Date: Sat Aug 12 07:40:13 UTC 2023 Modified Files: src/usr.bin/ftp: fetch.c Log Message: Don't finish downloading an empty file with 'already done' before it is created locally. To generate a diff of this commit: cvs rdiff -u -r1.237 -r1.238 src/usr.bin/ftp/fetch.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sat Aug 12 06:43:16 UTC 2023 Modified Files: src/usr.bin/xlint/lint1: lex.c Log Message: lint: clean up lexing of preprocessing lines The relation between 'c' and 'cp' was tricky to follow. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.190 -r1.191 src/usr.bin/xlint/lint1/lex.c 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/xlint/lint1/lex.c diff -u src/usr.bin/xlint/lint1/lex.c:1.190 src/usr.bin/xlint/lint1/lex.c:1.191 --- src/usr.bin/xlint/lint1/lex.c:1.190 Tue Aug 1 16:08:58 2023 +++ src/usr.bin/xlint/lint1/lex.c Sat Aug 12 06:43:16 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: lex.c,v 1.190 2023/08/01 16:08:58 rillig Exp $ */ +/* $NetBSD: lex.c,v 1.191 2023/08/12 06:43:16 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include #if defined(__RCSID) -__RCSID("$NetBSD: lex.c,v 1.190 2023/08/01 16:08:58 rillig Exp $"); +__RCSID("$NetBSD: lex.c,v 1.191 2023/08/12 06:43:16 rillig Exp $"); #endif #include @@ -991,71 +991,72 @@ parse_line_directive_flags(const char *p } /* + * The first directive of the preprocessed translation unit provides the name + * of the C source file as specified at the command line. + */ +static void +set_csrc_pos(void) +{ + static bool done; + + if (done) + return; + done = true; + csrc_pos.p_file = curr_pos.p_file; + outsrc(transform_filename(curr_pos.p_file, strlen(curr_pos.p_file))); +} + +/* * Called for preprocessor directives. Currently implemented are: * # pragma [argument...] * # lineno - * # lineno "filename" - * # lineno "filename" GCC-flag... + * # lineno "filename" [GCC-flag...] */ void lex_directive(const char *yytext) { - const char *cp, *fn; - char c, *eptr; - size_t fnl; - long ln; - bool is_begin, is_end, is_system; + const char *p = yytext + 1; /* skip '#' */ - static bool first = true; + while (*p == ' ' || *p == '\t') + p++; - /* Go to first non-whitespace after # */ - for (cp = yytext + 1; (c = *cp) == ' ' || c == '\t'; cp++) - continue; - - if (!ch_isdigit(c)) { - if (strncmp(cp, "pragma", 6) == 0 && ch_isspace(cp[6])) + if (!ch_isdigit(*p)) { + if (strncmp(p, "pragma", 6) == 0 && ch_isspace(p[6])) return; - error: - /* undefined or invalid '#' directive */ - warning(255); - return; + goto error; } - ln = strtol(--cp, , 10); - if (eptr == cp) + + char *end; + long ln = strtol(--p, , 10); + if (end == p) goto error; - if ((c = *(cp = eptr)) != ' ' && c != '\t' && c != '\0') + p = end; + + if (*p != ' ' && *p != '\t' && *p != '\0') goto error; - while ((c = *cp++) == ' ' || c == '\t') - continue; - if (c != '\0') { - if (c != '"') + while (*p == ' ' || *p == '\t') + p++; + + if (*p != '\0') { + if (*p != '"') goto error; - fn = cp; - while ((c = *cp) != '"' && c != '\0') - cp++; - if (c != '"') + const char *fn = ++p; + while (*p != '"' && *p != '\0') + p++; + if (*p != '"') goto error; - if ((fnl = cp++ - fn) > PATH_MAX) + size_t fn_len = p++ - fn; + if (fn_len > PATH_MAX) goto error; - /* empty string means stdin */ - if (fnl == 0) { + if (fn_len == 0) { fn = "{standard input}"; - fnl = 16; /* strlen (fn) */ - } - curr_pos.p_file = record_filename(fn, fnl); - /* - * If this is the first directive, the name is the name - * of the C source file as specified at the command line. - * It is written to the output file. - */ - if (first) { - csrc_pos.p_file = curr_pos.p_file; - outsrc(transform_filename(curr_pos.p_file, - strlen(curr_pos.p_file))); - first = false; + fn_len = strlen(fn); } + curr_pos.p_file = record_filename(fn, fn_len); + set_csrc_pos(); - parse_line_directive_flags(cp, _begin, _end, _system); + bool is_begin, is_end, is_system; + parse_line_directive_flags(p, _begin, _end, _system); update_location(curr_pos.p_file, (int)ln, is_begin, is_end); in_system_header = is_system; } @@ -1065,6 +1066,11 @@ lex_directive(const char *yytext) csrc_pos.p_line = (int)ln - 1; csrc_pos.p_uniq = 0; } + return; + +error: + /* undefined or invalid '#' directive */ + warning(255); } /* Handle lint comments such as ARGSUSED. */
CVS commit: src/usr.bin/xlint/lint1
Module Name:src Committed By: rillig Date: Sat Aug 12 06:43:16 UTC 2023 Modified Files: src/usr.bin/xlint/lint1: lex.c Log Message: lint: clean up lexing of preprocessing lines The relation between 'c' and 'cp' was tricky to follow. No functional change. To generate a diff of this commit: cvs rdiff -u -r1.190 -r1.191 src/usr.bin/xlint/lint1/lex.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.