sync with OpenBSD -current

This commit is contained in:
purplerain 2024-05-05 11:03:21 +00:00
parent 22b3fbc138
commit f05839c6d3
Signed by: purplerain
GPG Key ID: F42C07F07E2E35B7
14 changed files with 86 additions and 77 deletions

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: options.4,v 1.270 2023/12/14 13:34:23 claudio Exp $ .\" $OpenBSD: options.4,v 1.271 2024/05/05 07:26:58 jsg Exp $
.\" $NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $ .\" $NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $
.\" .\"
.\" Copyright (c) 1998 Theo de Raadt .\" Copyright (c) 1998 Theo de Raadt
@ -34,7 +34,7 @@
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\" .\"
.\" .\"
.Dd $Mdocdate: December 14 2023 $ .Dd $Mdocdate: May 5 2024 $
.Dt OPTIONS 4 .Dt OPTIONS 4
.Os .Os
.Sh NAME .Sh NAME
@ -253,18 +253,6 @@ With this option, only the superuser can set them, and they can't be cleared
if the securelevel is greater than 0. if the securelevel is greater than 0.
See also See also
.Xr chflags 1 . .Xr chflags 1 .
.It Cd option FFS_SOFTUPDATES
Enables a scheme that uses partial ordering of buffer cache operations
to allow metadata updates in FFS to happen asynchronously, increasing write
performance significantly.
Normally, the FFS filesystem writes metadata updates synchronously which exacts
a performance penalty in favor of filesystem integrity.
With soft updates, the performance of asynchronous writes is gained while
retaining the safety of synchronous metadata updates.
.Pp
Soft updates must be enabled on a per-filesystem basis.
See
.Xr mount 8 .
.It Cd option FIFO .It Cd option FIFO
Adds support for Adds support for
.At V .At V

View File

@ -1,4 +1,4 @@
# $OpenBSD: GENERIC,v 1.295 2024/03/13 14:43:31 bluhm Exp $ # $OpenBSD: GENERIC,v 1.296 2024/05/05 07:26:58 jsg Exp $
# #
# Machine-independent option; used by all architectures for their # Machine-independent option; used by all architectures for their
# GENERIC kernel # GENERIC kernel
@ -29,7 +29,6 @@ option UVM_SWAP_ENCRYPT# support encryption of pages going to swap
option FFS # UFS option FFS # UFS
option FFS2 # UFS2 option FFS2 # UFS2
option FFS_SOFTUPDATES # Soft updates
option UFS_DIRHASH # hash large directories option UFS_DIRHASH # hash large directories
option QUOTA # UFS quotas option QUOTA # UFS quotas
option EXT2FS # Second Extended Filesystem option EXT2FS # Second Extended Filesystem

View File

@ -1,4 +1,4 @@
/* $OpenBSD: param.c,v 1.49 2023/07/04 09:47:51 jsg Exp $ */ /* $OpenBSD: param.c,v 1.50 2024/05/05 06:14:37 jsg Exp $ */
/* $NetBSD: param.c,v 1.16 1996/03/12 03:08:40 mrg Exp $ */ /* $NetBSD: param.c,v 1.16 1996/03/12 03:08:40 mrg Exp $ */
/* /*
@ -39,13 +39,6 @@
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
#include <sys/socket.h>
#include <sys/proc.h>
#include <sys/vnode.h>
#include <sys/file.h>
#include <sys/timeout.h>
#include <sys/mbuf.h>
#include <ufs/ufs/quota.h>
#include <sys/kernel.h> #include <sys/kernel.h>
#include <sys/utsname.h> #include <sys/utsname.h>
#ifdef SYSVSHM #ifdef SYSVSHM
@ -55,9 +48,6 @@
#ifdef SYSVSEM #ifdef SYSVSEM
#include <sys/sem.h> #include <sys/sem.h>
#endif #endif
#ifdef SYSVMSG
#include <sys/msg.h>
#endif
/* /*
* System parameter formulae. * System parameter formulae.

View File

@ -1,4 +1,4 @@
/* $OpenBSD: sd.c,v 1.335 2023/11/10 17:43:39 krw Exp $ */ /* $OpenBSD: sd.c,v 1.336 2024/05/04 16:40:38 kn Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*- /*-
@ -1771,7 +1771,7 @@ validate:
} }
if (dp.disksize == 0) if (dp.disksize == 0)
goto die; return -1;
/* /*
* Restrict secsize values to powers of two between 512 and 64k. * Restrict secsize values to powers of two between 512 and 64k.

View File

View File

@ -25,15 +25,23 @@ THIS SOFTWARE.
This file lists all bug fixes, changes, etc., made since the This file lists all bug fixes, changes, etc., made since the
second edition of the AWK book was published in September 2023. second edition of the AWK book was published in September 2023.
May 4, 2024
Fixed a use-after-free bug with ARGV for "delete ARGV".
Also ENVtab is no longer global. Thanks to Benjamin Sturz
for spotting the ARGV issue and Todd Miller for the fix.
May 3, 2024:
Remove warnings when compiling with g++. Thanks to Arnold Robbins.
Apr 22, 2024: Apr 22, 2024:
fixed regex engine gototab reallocation issue that was Fixed regex engine gototab reallocation issue that was
introduced during the Nov 24 rewrite. Thanks to Arnold Robbins. Introduced during the Nov 24 rewrite. Thanks to Arnold Robbins.
Fixed a scan bug in split in the case the separator is a single Fixed a scan bug in split in the case the separator is a single
character. thanks to Oguz Ismail for spotting the issue. character. Thanks to Oguz Ismail for spotting the issue.
Mar 10, 2024: Mar 10, 2024:
fixed use-after-free bug in fnematch due to adjbuf invalidating Fixed use-after-free bug in fnematch due to adjbuf invalidating
the pointers to buf. thanks to github user caffe3 for spotting the pointers to buf. Thanks to github user caffe3 for spotting
the issue and providing a fix, and to Miguel Pineiro Jr. the issue and providing a fix, and to Miguel Pineiro Jr.
for the alternative fix. for the alternative fix.
MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max. MAX_UTF_BYTES in fnematch has been replaced with awk_mb_cur_max.

View File

@ -1,4 +1,4 @@
/* $OpenBSD: b.c,v 1.51 2024/04/25 18:33:53 millert Exp $ */ /* $OpenBSD: b.c,v 1.52 2024/05/04 22:59:21 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -651,7 +651,7 @@ static int set_gototab(fa *f, int state, int ch, int val) /* hide gototab implem
f->gototab[state].entries[0].state = val; f->gototab[state].entries[0].state = val;
f->gototab[state].inuse++; f->gototab[state].inuse++;
return val; return val;
} else if (ch > f->gototab[state].entries[f->gototab[state].inuse-1].ch) { } else if ((unsigned)ch > f->gototab[state].entries[f->gototab[state].inuse-1].ch) {
// not seen yet, insert and return // not seen yet, insert and return
gtt *tab = & f->gototab[state]; gtt *tab = & f->gototab[state];
if (tab->inuse + 1 >= tab->allocated) if (tab->inuse + 1 >= tab->allocated)
@ -875,7 +875,7 @@ bool fnematch(fa *pfa, FILE *f, char **pbuf, int *pbufsize, int quantum)
* Call u8_rune with at least awk_mb_cur_max ahead in * Call u8_rune with at least awk_mb_cur_max ahead in
* the buffer until EOF interferes. * the buffer until EOF interferes.
*/ */
if (k - j < awk_mb_cur_max) { if (k - j < (int)awk_mb_cur_max) {
if (k + awk_mb_cur_max > buf + bufsize) { if (k + awk_mb_cur_max > buf + bufsize) {
char *obuf = buf; char *obuf = buf;
adjbuf(&buf, &bufsize, adjbuf(&buf, &bufsize,

View File

@ -1,4 +1,4 @@
/* $OpenBSD: lib.c,v 1.55 2023/11/28 20:54:38 millert Exp $ */ /* $OpenBSD: lib.c,v 1.57 2024/05/05 02:55:34 jsg Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -332,14 +332,16 @@ int readcsvrec(char **pbuf, int *pbufsize, FILE *inf, bool newflag) /* csv can h
char *getargv(int n) /* get ARGV[n] */ char *getargv(int n) /* get ARGV[n] */
{ {
Array *ap;
Cell *x; Cell *x;
char *s, temp[50]; char *s, temp[50];
extern Array *ARGVtab; extern Cell *ARGVcell;
ap = (Array *)ARGVcell->sval;
snprintf(temp, sizeof(temp), "%d", n); snprintf(temp, sizeof(temp), "%d", n);
if (lookup(temp, ARGVtab) == NULL) if (lookup(temp, ap) == NULL)
return NULL; return NULL;
x = setsymtab(temp, "", 0.0, STR, ARGVtab); x = setsymtab(temp, "", 0.0, STR, ap);
s = getsval(x); s = getsval(x);
DPRINTF("getargv(%d) returns |%s|\n", n, s); DPRINTF("getargv(%d) returns |%s|\n", n, s);
return s; return s;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: main.c,v 1.69 2024/04/25 18:33:53 millert Exp $ */ /* $OpenBSD: main.c,v 1.70 2024/05/04 22:59:21 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -23,7 +23,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
THIS SOFTWARE. THIS SOFTWARE.
****************************************************************/ ****************************************************************/
const char *version = "version 20240422"; const char *version = "version 20240504";
#define DEBUG #define DEBUG
#include <stdio.h> #include <stdio.h>
@ -66,22 +66,42 @@ static noreturn void fpecatch(int n
{ {
extern Node *curnode; extern Node *curnode;
#ifdef SA_SIGINFO #ifdef SA_SIGINFO
static const char *emsg[] = { const char *mesg = NULL;
[0] = "Unknown error",
[FPE_INTDIV] = "Integer divide by zero", switch (si->si_code) {
[FPE_INTOVF] = "Integer overflow", case FPE_INTDIV:
[FPE_FLTDIV] = "Floating point divide by zero", mesg = "Integer divide by zero";
[FPE_FLTOVF] = "Floating point overflow", break;
[FPE_FLTUND] = "Floating point underflow", case FPE_INTOVF:
[FPE_FLTRES] = "Floating point inexact result", mesg = "Integer overflow";
[FPE_FLTINV] = "Invalid Floating point operation", break;
[FPE_FLTSUB] = "Subscript out of range", case FPE_FLTDIV:
}; mesg = "Floating point divide by zero";
break;
case FPE_FLTOVF:
mesg = "Floating point overflow";
break;
case FPE_FLTUND:
mesg = "Floating point underflow";
break;
case FPE_FLTRES:
mesg = "Floating point inexact result";
break;
case FPE_FLTINV:
mesg = "Invalid Floating point operation";
break;
case FPE_FLTSUB:
mesg = "Subscript out of range";
break;
case 0:
default:
mesg = "Unknown error";
break;
}
#endif #endif
dprintf(STDERR_FILENO, "floating point exception%s%s\n", dprintf(STDERR_FILENO, "floating point exception%s%s\n",
#ifdef SA_SIGINFO #ifdef SA_SIGINFO
": ", (size_t)si->si_code < sizeof(emsg) / sizeof(emsg[0]) && ": ", mesg
emsg[si->si_code] ? emsg[si->si_code] : emsg[0]
#else #else
"", "" "", ""
#endif #endif

View File

@ -1,4 +1,4 @@
/* $OpenBSD: run.c,v 1.85 2024/04/25 18:33:53 millert Exp $ */ /* $OpenBSD: run.c,v 1.86 2024/05/04 22:59:21 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -725,7 +725,7 @@ int u8_byte2char(const char *s, int bytenum)
return charnum; return charnum;
} }
/* runetochar() adapted from rune.c in the Plan 9 distributione */ /* runetochar() adapted from rune.c in the Plan 9 distribution */
enum enum
{ {
@ -2063,7 +2063,7 @@ static char *nawk_tolower(const char *s)
Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg list */ Cell *bltin(Node **a, int n) /* builtin functions. a[0] is type, a[1] is arg list */
{ {
Cell *x, *y; Cell *x, *y;
Awkfloat u; Awkfloat u = 0;
int t, sz; int t, sz;
Awkfloat tmp; Awkfloat tmp;
char *buf, *fmt; char *buf, *fmt;
@ -2539,7 +2539,7 @@ Cell *dosub(Node **a, int subop) /* sub and gsub */
const char *start; const char *start;
const char *noempty = NULL; /* empty match disallowed here */ const char *noempty = NULL; /* empty match disallowed here */
size_t m = 0; /* match count */ size_t m = 0; /* match count */
size_t whichm; /* which match to select, 0 = global */ size_t whichm = 0; /* which match to select, 0 = global */
int mtype; /* match type */ int mtype; /* match type */
if (a[0] == NULL) { /* 0 => a[1] is already-compiled regexpr */ if (a[0] == NULL) { /* 0 => a[1] is already-compiled regexpr */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: tran.c,v 1.38 2023/10/30 17:52:54 millert Exp $ */ /* $OpenBSD: tran.c,v 1.39 2024/05/04 22:59:21 millert Exp $ */
/**************************************************************** /****************************************************************
Copyright (C) Lucent Technologies 1997 Copyright (C) Lucent Technologies 1997
All Rights Reserved All Rights Reserved
@ -58,8 +58,7 @@ Cell *fnrloc; /* FNR */
Cell *ofsloc; /* OFS */ Cell *ofsloc; /* OFS */
Cell *orsloc; /* ORS */ Cell *orsloc; /* ORS */
Cell *rsloc; /* RS */ Cell *rsloc; /* RS */
Array *ARGVtab; /* symbol table containing ARGV[...] */ Cell *ARGVcell; /* cell with symbol table containing ARGV[...] */
Array *ENVtab; /* symbol table containing ENVIRON[...] */
Cell *rstartloc; /* RSTART */ Cell *rstartloc; /* RSTART */
Cell *rlengthloc; /* RLENGTH */ Cell *rlengthloc; /* RLENGTH */
Cell *subseploc; /* SUBSEP */ Cell *subseploc; /* SUBSEP */
@ -108,36 +107,39 @@ void syminit(void) /* initialize symbol table with builtin vars */
void arginit(int ac, char **av) /* set up ARGV and ARGC */ void arginit(int ac, char **av) /* set up ARGV and ARGC */
{ {
Array *ap;
Cell *cp; Cell *cp;
int i; int i;
char temp[50]; char temp[50];
ARGC = &setsymtab("ARGC", "", (Awkfloat) ac, NUM, symtab)->fval; ARGC = &setsymtab("ARGC", "", (Awkfloat) ac, NUM, symtab)->fval;
cp = setsymtab("ARGV", "", 0.0, ARR, symtab); cp = setsymtab("ARGV", "", 0.0, ARR, symtab);
ARGVtab = makesymtab(NSYMTAB); /* could be (int) ARGC as well */ ap = makesymtab(NSYMTAB); /* could be (int) ARGC as well */
free(cp->sval); free(cp->sval);
cp->sval = (char *) ARGVtab; cp->sval = (char *) ap;
for (i = 0; i < ac; i++) { for (i = 0; i < ac; i++) {
double result; double result;
snprintf(temp, sizeof(temp), "%d", i); snprintf(temp, sizeof(temp), "%d", i);
if (is_number(*av, & result)) if (is_number(*av, & result))
setsymtab(temp, *av, result, STR|NUM, ARGVtab); setsymtab(temp, *av, result, STR|NUM, ap);
else else
setsymtab(temp, *av, 0.0, STR, ARGVtab); setsymtab(temp, *av, 0.0, STR, ap);
av++; av++;
} }
ARGVcell = cp;
} }
void envinit(char **envp) /* set up ENVIRON variable */ void envinit(char **envp) /* set up ENVIRON variable */
{ {
Array *ap;
Cell *cp; Cell *cp;
char *p; char *p;
cp = setsymtab("ENVIRON", "", 0.0, ARR, symtab); cp = setsymtab("ENVIRON", "", 0.0, ARR, symtab);
ENVtab = makesymtab(NSYMTAB); ap = makesymtab(NSYMTAB);
free(cp->sval); free(cp->sval);
cp->sval = (char *) ENVtab; cp->sval = (char *) ap;
for ( ; *envp; envp++) { for ( ; *envp; envp++) {
double result; double result;
@ -147,9 +149,9 @@ void envinit(char **envp) /* set up ENVIRON variable */
continue; continue;
*p++ = 0; /* split into two strings at = */ *p++ = 0; /* split into two strings at = */
if (is_number(p, & result)) if (is_number(p, & result))
setsymtab(*envp, p, result, STR|NUM, ENVtab); setsymtab(*envp, p, result, STR|NUM, ap);
else else
setsymtab(*envp, p, 0.0, STR, ENVtab); setsymtab(*envp, p, 0.0, STR, ap);
p[-1] = '='; /* restore in case env is passed down to a shell */ p[-1] = '='; /* restore in case env is passed down to a shell */
} }
} }

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: rcctl.8,v 1.44 2023/03/01 17:27:45 ajacoutot Exp $ .\" $OpenBSD: rcctl.8,v 1.45 2024/05/05 08:16:45 ajacoutot Exp $
.\" .\"
.\" Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org> .\" Copyright (c) 2014 Antoine Jacoutot <ajacoutot@openbsd.org>
.\" .\"
@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\" .\"
.Dd $Mdocdate: March 1 2023 $ .Dd $Mdocdate: May 5 2024 $
.Dt RCCTL 8 .Dt RCCTL 8
.Os .Os
.Sh NAME .Sh NAME
@ -187,8 +187,8 @@ exits with 0 if the daemon or service is enabled and 1 if it is not.
.Nm Cm getdef Ar daemon | service Op Cm status .Nm Cm getdef Ar daemon | service Op Cm status
exits with 0 if the daemon or service is enabled by default exits with 0 if the daemon or service is enabled by default
and 1 if it is not. and 1 if it is not.
.Nm Cm ls failed .Nm Cm ls failed | rogue
exits with 1 if an enabled daemon is not running. exits with 1 if an enabled daemon is not running or vice versa.
Otherwise, the Otherwise, the
.Nm .Nm
utility exits with 0 on success, and >0 if an error occurs utility exits with 0 on success, and >0 if an error occurs