sync with OpenBSD -current

This commit is contained in:
purplerain 2023-11-24 21:31:02 +00:00
parent dde71458ae
commit 57dff5a13c
Signed by: purplerain
GPG Key ID: F42C07F07E2E35B7
30 changed files with 320 additions and 52 deletions

View File

@ -1,5 +1,5 @@
.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
.TH IP-TAG 1 "March 10, 2020"
.\" $OpenBSD: tag.in,v 1.2 2023/11/24 04:53:39 schwarze Exp $
.TH IP-TAG 1 "November 24, 2023"
.SH NAME
IP-tag \- automatic tagging of indented blocks
.SH DESCRIPTION
@ -12,6 +12,12 @@ text
text
.IP "\&\fI \-weak\fP"
text
.IP "hyphen-minus"
text
.IP "minus\-sign"
text
.IP "\-strong"
text
.IP " strong"
text
.PP

View File

@ -12,8 +12,16 @@ DDEESSCCRRIIPPTTIIOONN
_-_w_e_a_k text
hyphen-minus
text
minus-sign
text
-strong text
strong text
ENDTEST
OpenBSD March 10, 2020 IP-TAG(1)
OpenBSD November 24, 2023 IP-TAG(1)

View File

@ -5,6 +5,12 @@
<dd>text</dd>
<dt id="weak"><a class="permalink" href="#weak"><i> -weak</i></a></dt>
<dd>text</dd>
<dt id="hyphen-minus"><a class="permalink" href="#hyphen-minus">hyphen-minus</a></dt>
<dd>text</dd>
<dt id="minus-sign"><a class="permalink" href="#minus-sign">minus-sign</a></dt>
<dd>text</dd>
<dt id="strong~2"><a class="permalink" href="#strong~2">-strong</a></dt>
<dd>text</dd>
<dt> strong</dt>
<dd>text</dd>
</dl>

View File

@ -2,3 +2,6 @@ NAME tag.mandoc_ascii 3
DESCRIPTION tag.mandoc_ascii 6
strong tag.mandoc_ascii 11
weak tag.mandoc_ascii 13
hyphen-minus tag.mandoc_ascii 15
minus-sign tag.mandoc_ascii 18
strong tag.mandoc_ascii 21

View File

@ -1,5 +1,5 @@
.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:05 schwarze Exp $
.TH IP-TAG 1 "March 10, 2020"
.\" $OpenBSD: tag.in,v 1.2 2023/11/24 04:53:39 schwarze Exp $
.TH IP-TAG 1 "November 24, 2023"
.SH NAME
IP-tag \- automatic tagging of indented blocks
.SH DESCRIPTION
@ -25,6 +25,15 @@ text
\&\fI \-weak\fP
text
.TP
hyphen-minus
text
.TP
minus\-sign
text
.TP
.B \-strong
text
.TP
.B "strong "
text
.PP

View File

@ -18,8 +18,16 @@ DDEESSCCRRIIPPTTIIOONN
_-_w_e_a_k text
hyphen-minus
text
minus-sign
text
--ssttrroonngg text
ssttrroonngg text
ENDTEST
OpenBSD March 10, 2020 IP-TAG(1)
OpenBSD November 24, 2023 IP-TAG(1)

View File

@ -11,6 +11,12 @@
<dd>text</dd>
<dt id="weak"><a class="permalink" href="#weak"><i> -weak</i></a></dt>
<dd>text</dd>
<dt id="hyphen-minus"><a class="permalink" href="#hyphen-minus">hyphen-minus</a></dt>
<dd>text</dd>
<dt id="minus-sign"><a class="permalink" href="#minus-sign">minus-sign</a></dt>
<dd>text</dd>
<dt id="strong~2"><a class="permalink" href="#strong~2"><b>-strong</b></a></dt>
<dd>text</dd>
<dt><b>strong </b></dt>
<dd>text</dd>
</dl>

View File

@ -3,3 +3,6 @@ DESCRIPTION tag.mandoc_ascii 6
plain tag.mandoc_ascii 11
strong tag.mandoc_ascii 17
weak tag.mandoc_ascii 19
hyphen-minus tag.mandoc_ascii 21
minus-sign tag.mandoc_ascii 24
strong tag.mandoc_ascii 27

View File

@ -7,7 +7,7 @@
<dd>text</dd>
<dt id="hyphen"><a class="permalink" href="#hyphen"><code class="Cm">-hyphen</code></a></dt>
<dd>text</dd>
<dt id="minus"><a class="permalink" href="#minus"><code class="Cm">-minus-sign</code></a></dt>
<dt id="minus-sign"><a class="permalink" href="#minus-sign"><code class="Cm">-minus-sign</code></a></dt>
<dd>text</dd>
<dt id="backslash"><a class="permalink" href="#backslash"><code class="Cm">\backslash</code></a></dt>
<dd>text</dd>

View File

@ -4,6 +4,6 @@ one tag.mandoc_ascii 9
two tag.mandoc_ascii 9
three tag.mandoc_ascii 12
hyphen tag.mandoc_ascii 14
minus tag.mandoc_ascii 17
minus-sign tag.mandoc_ascii 17
backslash tag.mandoc_ascii 20
four tag.mandoc_ascii 22

View File

@ -1,5 +1,5 @@
.\" $OpenBSD: tag.in,v 1.2 2020/04/02 14:55:29 schwarze Exp $
.Dd $Mdocdate: April 2 2020 $
.\" $OpenBSD: tag.in,v 1.3 2023/11/24 04:53:39 schwarze Exp $
.Dd $Mdocdate: November 24 2023 $
.Dt EM-TAG 1
.Os
.Sh NAME
@ -14,6 +14,8 @@ text
.Em three-with-hyphens
.Xc
text
.It Em minus\-sign
text
.El
.Em four
.Em one

View File

@ -11,8 +11,11 @@ DDEESSCCRRIIPPTTIIOONN
_t_h_r_e_e_-_w_i_t_h_-_h_y_p_h_e_n_s
text
_m_i_n_u_s_-_s_i_g_n
text
_f_o_u_r _o_n_e _f_i_v_e
ENDTEST
OpenBSD April 2, 2020 OpenBSD
OpenBSD November 24, 2023 OpenBSD

View File

@ -4,6 +4,8 @@
<dd>text</dd>
<dt id="three-with-hyphens"><a class="permalink" href="#three-with-hyphens"><i class="Em">three-with-hyphens</i></a></dt>
<dd>text</dd>
<dt id="minus-sign"><a class="permalink" href="#minus-sign"><i class="Em">minus-sign</i></a></dt>
<dd>text</dd>
</dl>
<a class="permalink" href="#four"><i class="Em" id="four">four</i></a>
<i class="Em">one</i>

View File

@ -16,10 +16,14 @@ BEGINTEST
> text
*minus&#45;sign*
> text
*four*
*one*
*five*
ENDTEST
OpenBSD - April 2, 2020
OpenBSD - November 24, 2023

View File

@ -3,5 +3,6 @@ DESCRIPTION tag.mandoc_ascii 6
one tag.mandoc_ascii 9
two tag.mandoc_ascii 9
three-with-hyphens tag.mandoc_ascii 12
four tag.mandoc_ascii 14
explicit tag.mandoc_ascii 14
minus-sign tag.mandoc_ascii 15
four tag.mandoc_ascii 17
explicit tag.mandoc_ascii 17

View File

@ -1,5 +1,5 @@
.\" $OpenBSD: tag.in,v 1.1 2020/03/13 00:31:06 schwarze Exp $
.Dd $Mdocdate: March 13 2020 $
.\" $OpenBSD: tag.in,v 1.2 2023/11/24 04:53:39 schwarze Exp $
.Dd $Mdocdate: November 24 2023 $
.Dt SY-TAG 1
.Os
.Sh NAME
@ -11,7 +11,7 @@ BEGINTEST
.It Sy one | two
text
.It Xo
.Sy three
.Sy three-with\-hyphens
.Xc
text
.El

View File

@ -9,9 +9,10 @@ DDEESSCCRRIIPPTTIIOONN
oonnee | ttwwoo
text
tthhrreeee text
tthhrreeee--wwiitthh--hhyypphheennss
text
ffoouurr oonnee ffiivvee
ENDTEST
OpenBSD March 13, 2020 OpenBSD
OpenBSD November 24, 2023 OpenBSD

View File

@ -2,7 +2,7 @@
<dt id="one"><a class="permalink" href="#one"><b class="Sy">one</b></a> |
<a class="permalink" href="#two"><b class="Sy" id="two">two</b></a></dt>
<dd>text</dd>
<dt id="three"><a class="permalink" href="#three"><b class="Sy">three</b></a></dt>
<dt id="three-with-hyphens"><a class="permalink" href="#three-with-hyphens"><b class="Sy">three-with-hyphens</b></a></dt>
<dd>text</dd>
</dl>
<a class="permalink" href="#four"><b class="Sy" id="four">four</b></a>

View File

@ -12,7 +12,7 @@ BEGINTEST
> text
**three**
**three-with&#45;hyphens**
> text
@ -22,4 +22,4 @@ BEGINTEST
ENDTEST
OpenBSD - March 13, 2020
OpenBSD - November 24, 2023

View File

@ -2,6 +2,6 @@ NAME tag.mandoc_ascii 3
DESCRIPTION tag.mandoc_ascii 6
one tag.mandoc_ascii 9
two tag.mandoc_ascii 9
three tag.mandoc_ascii 12
four tag.mandoc_ascii 13
explicit tag.mandoc_ascii 13
three-with-hyphens tag.mandoc_ascii 12
four tag.mandoc_ascii 14
explicit tag.mandoc_ascii 14

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ikev2.c,v 1.379 2023/11/10 08:03:02 tobhe Exp $ */
/* $OpenBSD: ikev2.c,v 1.380 2023/11/24 14:43:00 tobhe Exp $ */
/*
* Copyright (c) 2019 Tobias Heider <tobias.heider@stusta.de>
@ -4034,10 +4034,10 @@ ikev2_send_ike_e(struct iked *env, struct iked_sa *sa, struct ibuf *buf,
if ((e = ibuf_static()) == NULL)
goto done;
if ((pld = ikev2_add_payload(e)) == NULL)
goto done;
if (buf) {
if ((pld = ikev2_add_payload(e)) == NULL)
goto done;
if (ibuf_add_buf(e, buf) != 0)
goto done;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: ccp_pci.c,v 1.7 2022/10/24 04:57:29 jsg Exp $ */
/* $OpenBSD: ccp_pci.c,v 1.8 2023/11/24 08:47:35 jmatthew Exp $ */
/*
* Copyright (c) 2018 David Gwynne <dlg@openbsd.org>
@ -49,6 +49,7 @@ static const struct pci_matchid ccp_pci_devices[] = {
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_17_1X_CCP },
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_17_3X_CCP },
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_17_90_CCP },
{ PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_PSP },
};
int

View File

@ -1,4 +1,4 @@
$OpenBSD: pcidevs,v 1.2055 2023/11/23 14:21:47 jsg Exp $
$OpenBSD: pcidevs,v 1.2056 2023/11/24 04:34:09 jmatthew Exp $
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
/*
@ -781,11 +781,30 @@ product AMD 17_7X_PCIE_2 0x1484 17h PCIE
product AMD 17_3X_CCP 0x1486 17h Crypto
product AMD 17_3X_HDA 0x1487 17h HD Audio
product AMD 17_7X_XHCI 0x149c 17h xHCI
product AMD 19_1X_IOMMU 0x149e 19h/1xh IOMMU
product AMD 19_1X_PCIE 0x149f 19h/1xh PCIE
product AMD 19_1X_RC 0x14a4 19h/1xh Root Complex
product AMD 19_1X_PCIE_1 0x14a5 19h/1xh PCIE
product AMD 19_1X_RCEC 0x14a6 19h/1xh RCEC
product AMD 19_1X_PCIE_2 0x14a7 19h/1xh PCIE
product AMD 19_1X_PCIE_3 0x14aa 19h/1xh PCIE
product AMD 19_1X_PCIE_4 0x14ac 19h/1xh PCIE
product AMD 19_1X_PCIE_5 0x14ab 19h/1xh PCIE
product AMD 19_1X_DF_1 0x14ad 19h/1xh Data Fabric
product AMD 19_1X_DF_2 0x14ae 19h/1xh Data Fabric
product AMD 19_1X_DF_3 0x14af 19h/1xh Data Fabric
product AMD 19_1X_DF_4 0x14b0 19h/1xh Data Fabric
product AMD 19_1X_DF_5 0x14b1 19h/1xh Data Fabric
product AMD 19_1X_DF_6 0x14b2 19h/1xh Data Fabric
product AMD 19_1X_DF_7 0x14b3 19h/1xh Data Fabric
product AMD 19_1X_DF_8 0x14b4 19h/1xh Data Fabric
product AMD 19_4X_RC 0x14b5 19h/4xh Root Complex
product AMD 19_4X_IOMMU 0x14b6 19h/4xh IOMMU
product AMD 19_4X_HB_1 0x14b7 19h/4xh Host
product AMD 19_4X_PCIE_1 0x14b9 19h/4xh PCIE
product AMD 19_4X_PCIE_2 0x14ba 19h/4xh PCIE
product AMD 19_1X_XHCI 0x14c9 19h/1xh xHCI
product AMD 19_1X_PSP 0x14ca 19h/1xh PSP
product AMD 19_6X_RC 0x14d8 19h/6xh Root Complex
product AMD 19_6X_IOMMU 0x14d9 19h/6xh IOMMU
product AMD 19_6X_HB 0x14da 19h/6xh Host

View File

@ -2,7 +2,7 @@
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
*
* generated from:
* OpenBSD: pcidevs,v 1.2055 2023/11/23 14:21:47 jsg Exp
* OpenBSD: pcidevs,v 1.2056 2023/11/24 04:34:09 jmatthew Exp
*/
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
@ -786,11 +786,30 @@
#define PCI_PRODUCT_AMD_17_3X_CCP 0x1486 /* 17h Crypto */
#define PCI_PRODUCT_AMD_17_3X_HDA 0x1487 /* 17h HD Audio */
#define PCI_PRODUCT_AMD_17_7X_XHCI 0x149c /* 17h xHCI */
#define PCI_PRODUCT_AMD_19_1X_IOMMU 0x149e /* 19h/1xh IOMMU */
#define PCI_PRODUCT_AMD_19_1X_PCIE 0x149f /* 19h/1xh PCIE */
#define PCI_PRODUCT_AMD_19_1X_RC 0x14a4 /* 19h/1xh Root Complex */
#define PCI_PRODUCT_AMD_19_1X_PCIE_1 0x14a5 /* 19h/1xh PCIE */
#define PCI_PRODUCT_AMD_19_1X_RCEC 0x14a6 /* 19h/1xh RCEC */
#define PCI_PRODUCT_AMD_19_1X_PCIE_2 0x14a7 /* 19h/1xh PCIE */
#define PCI_PRODUCT_AMD_19_1X_PCIE_3 0x14aa /* 19h/1xh PCIE */
#define PCI_PRODUCT_AMD_19_1X_PCIE_4 0x14ac /* 19h/1xh PCIE */
#define PCI_PRODUCT_AMD_19_1X_PCIE_5 0x14ab /* 19h/1xh PCIE */
#define PCI_PRODUCT_AMD_19_1X_DF_1 0x14ad /* 19h/1xh Data Fabric */
#define PCI_PRODUCT_AMD_19_1X_DF_2 0x14ae /* 19h/1xh Data Fabric */
#define PCI_PRODUCT_AMD_19_1X_DF_3 0x14af /* 19h/1xh Data Fabric */
#define PCI_PRODUCT_AMD_19_1X_DF_4 0x14b0 /* 19h/1xh Data Fabric */
#define PCI_PRODUCT_AMD_19_1X_DF_5 0x14b1 /* 19h/1xh Data Fabric */
#define PCI_PRODUCT_AMD_19_1X_DF_6 0x14b2 /* 19h/1xh Data Fabric */
#define PCI_PRODUCT_AMD_19_1X_DF_7 0x14b3 /* 19h/1xh Data Fabric */
#define PCI_PRODUCT_AMD_19_1X_DF_8 0x14b4 /* 19h/1xh Data Fabric */
#define PCI_PRODUCT_AMD_19_4X_RC 0x14b5 /* 19h/4xh Root Complex */
#define PCI_PRODUCT_AMD_19_4X_IOMMU 0x14b6 /* 19h/4xh IOMMU */
#define PCI_PRODUCT_AMD_19_4X_HB_1 0x14b7 /* 19h/4xh Host */
#define PCI_PRODUCT_AMD_19_4X_PCIE_1 0x14b9 /* 19h/4xh PCIE */
#define PCI_PRODUCT_AMD_19_4X_PCIE_2 0x14ba /* 19h/4xh PCIE */
#define PCI_PRODUCT_AMD_19_1X_XHCI 0x14c9 /* 19h/1xh xHCI */
#define PCI_PRODUCT_AMD_19_1X_PSP 0x14ca /* 19h/1xh PSP */
#define PCI_PRODUCT_AMD_19_6X_RC 0x14d8 /* 19h/6xh Root Complex */
#define PCI_PRODUCT_AMD_19_6X_IOMMU 0x14d9 /* 19h/6xh IOMMU */
#define PCI_PRODUCT_AMD_19_6X_HB 0x14da /* 19h/6xh Host */

View File

@ -2,7 +2,7 @@
* THIS FILE AUTOMATICALLY GENERATED. DO NOT EDIT.
*
* generated from:
* OpenBSD: pcidevs,v 1.2055 2023/11/23 14:21:47 jsg Exp
* OpenBSD: pcidevs,v 1.2056 2023/11/24 04:34:09 jmatthew Exp
*/
/* $NetBSD: pcidevs,v 1.30 1997/06/24 06:20:24 thorpej Exp $ */
@ -1387,6 +1387,74 @@ static const struct pci_known_product pci_known_products[] = {
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_17_7X_XHCI,
"17h xHCI",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_IOMMU,
"19h/1xh IOMMU",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_PCIE,
"19h/1xh PCIE",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_RC,
"19h/1xh Root Complex",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_PCIE_1,
"19h/1xh PCIE",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_RCEC,
"19h/1xh RCEC",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_PCIE_2,
"19h/1xh PCIE",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_PCIE_3,
"19h/1xh PCIE",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_PCIE_4,
"19h/1xh PCIE",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_PCIE_5,
"19h/1xh PCIE",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_DF_1,
"19h/1xh Data Fabric",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_DF_2,
"19h/1xh Data Fabric",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_DF_3,
"19h/1xh Data Fabric",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_DF_4,
"19h/1xh Data Fabric",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_DF_5,
"19h/1xh Data Fabric",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_DF_6,
"19h/1xh Data Fabric",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_DF_7,
"19h/1xh Data Fabric",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_DF_8,
"19h/1xh Data Fabric",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_4X_RC,
"19h/4xh Root Complex",
@ -1407,6 +1475,14 @@ static const struct pci_known_product pci_known_products[] = {
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_4X_PCIE_2,
"19h/4xh PCIE",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_XHCI,
"19h/1xh xHCI",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_1X_PSP,
"19h/1xh PSP",
},
{
PCI_VENDOR_AMD, PCI_PRODUCT_AMD_19_6X_RC,
"19h/6xh Root Complex",

View File

@ -1,6 +1,6 @@
/* $OpenBSD: tag.c,v 1.37 2022/04/26 11:28:35 schwarze Exp $ */
/* $OpenBSD: tag.c,v 1.38 2023/11/24 04:48:02 schwarze Exp $ */
/*
* Copyright (c) 2015, 2016, 2018, 2019, 2020, 2022
* Copyright (c) 2015, 2016, 2018, 2019, 2020, 2022, 2023
* Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
@ -24,11 +24,13 @@
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mandoc_aux.h"
#include "mandoc_ohash.h"
#include "mandoc.h"
#include "roff.h"
#include "mdoc.h"
#include "roff_int.h"
@ -86,9 +88,11 @@ tag_put(const char *s, int prio, struct roff_node *n)
{
struct tag_entry *entry;
struct roff_node *nold;
const char *se;
const char *se, *src;
char *cpy;
size_t len;
unsigned int slot;
int changed;
assert(prio <= TAG_FALLBACK);
@ -104,6 +108,7 @@ tag_put(const char *s, int prio, struct roff_node *n)
/* Determine the implicit tag. */
changed = 1;
if (s == NULL) {
if (n->child == NULL || n->child->type != ROFFT_TEXT)
return;
@ -120,27 +125,53 @@ tag_put(const char *s, int prio, struct roff_node *n)
s += 2;
break;
default:
break;
return;
}
break;
default:
changed = 0;
break;
}
}
/*
* Translate \- and ASCII_HYPH to plain '-'.
* Skip whitespace and escapes and whatever follows,
* and if there is any, downgrade the priority.
*/
len = strcspn(s, " \t\\");
cpy = mandoc_malloc(strlen(s) + 1);
for (src = s, len = 0; *src != '\0'; src++, len++) {
switch (*src) {
case '\t':
case ' ':
changed = 1;
break;
case ASCII_HYPH:
cpy[len] = '-';
changed = 1;
continue;
case '\\':
if (src[1] != '-')
break;
src++;
changed = 1;
/* FALLTHROUGH */
default:
cpy[len] = *src;
continue;
}
break;
}
if (len == 0)
return;
goto out;
cpy[len] = '\0';
se = s + len;
if (*se != '\0' && prio < TAG_WEAK)
if (*src != '\0' && prio < TAG_WEAK)
prio = TAG_WEAK;
s = cpy;
se = cpy + len;
slot = ohash_qlookupi(&tag_data, s, &se);
entry = ohash_find(&tag_data, slot);
@ -148,8 +179,7 @@ tag_put(const char *s, int prio, struct roff_node *n)
if (entry == NULL) {
entry = mandoc_malloc(sizeof(*entry) + len + 1);
memcpy(entry->s, s, len);
entry->s[len] = '\0';
memcpy(entry->s, s, len + 1);
entry->nodes = NULL;
entry->maxnodes = entry->nnodes = 0;
ohash_insert(&tag_data, slot, entry);
@ -161,7 +191,7 @@ tag_put(const char *s, int prio, struct roff_node *n)
*/
else if (entry->prio < prio)
return;
goto out;
/*
* If the existing entry is worse, clear it.
@ -178,7 +208,7 @@ tag_put(const char *s, int prio, struct roff_node *n)
}
if (prio == TAG_FALLBACK) {
entry->prio = TAG_DELETE;
return;
goto out;
}
}
@ -192,10 +222,13 @@ tag_put(const char *s, int prio, struct roff_node *n)
entry->nodes[entry->nnodes++] = n;
entry->prio = prio;
n->flags |= NODE_ID;
if (n->child == NULL || n->child->string != s || *se != '\0') {
if (changed) {
assert(n->tag == NULL);
n->tag = mandoc_strndup(s, len);
}
out:
free(cpy);
}
int

View File

@ -1,5 +1,5 @@
# ex:ts=8 sw=4:
# $OpenBSD: State.pm,v 1.74 2023/06/13 09:07:17 espie Exp $
# $OpenBSD: State.pm,v 1.75 2023/11/24 18:19:25 espie Exp $
#
# Copyright (c) 2007-2014 Marc Espie <espie@openbsd.org>
#
@ -191,6 +191,47 @@ sub do_options($state, $sub)
};
}
sub validate_usage($state, $string, @usage)
{
my $h = {};
my $h2 = {};
my $previous;
for my $letter (split //, $string) {
if ($letter eq ':') {
$h->{$previous} = 1;
} else {
$previous = $letter;
$h->{$previous} = 0;
}
}
for my $u (@usage) {
while ($u =~ s/\[\-(.*?)\]//) {
my $opts = $1;
if ($opts =~ m/^[A-Za-z]+$/) {
for my $o (split //, $opts) {
$h2->{$o} = 0;
}
} else {
$opts =~ m/./;
$h2->{$&} = 1;
}
}
}
for my $k (keys %$h) {
if (!exists $h2->{$k}) {
$state->errsay("Option #1 #2is not in usage", $k,
$h->{$k} ? "(with params) " : "");
} elsif ($h2->{$k} != $h->{$k}) {
$state->errsay("Discrepancy for option #1", $k);
}
}
for my $k (keys %$h2) {
if (!exists $h->{$k}) {
$state->errsay("Option #1 does not exist", $k);
}
}
}
sub handle_options($state, $opt_string, @usage)
{
require OpenBSD::Getopt;
@ -218,6 +259,9 @@ sub handle_options($state, $opt_string, @usage)
$state->{signature_style} //= 'new';
}
if ($state->defines('VALIDATE_USAGE')) {
$state->validate_usage($opt_string.'vD:', @usage);
}
return if $state->{no_exports};
# TODO make sure nothing uses this
no strict "refs";

View File

@ -1,4 +1,4 @@
/* $OpenBSD: extern.h,v 1.194 2023/11/16 11:10:59 tb Exp $ */
/* $OpenBSD: extern.h,v 1.195 2023/11/24 14:05:47 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@ -930,7 +930,8 @@ int mkpathat(int, const char *);
/* Maximum acceptable URI length */
#define MAX_URI_LENGTH 2048
/* Maximum acceptable file size */
/* Min/Max acceptable file size */
#define MIN_FILE_SIZE 100
#define MAX_FILE_SIZE 4000000
/* Maximum number of FileNameAndHash entries per RSC checklist. */

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rrdp_util.c,v 1.1 2021/11/24 15:24:16 claudio Exp $ */
/* $OpenBSD: rrdp_util.c,v 1.2 2023/11/24 14:05:47 job Exp $ */
/*
* Copyright (c) 2020 Nils Fisher <nils_fisher@hotmail.com>
* Copyright (c) 2021 Claudio Jeker <claudio@openbsd.org>
@ -107,10 +107,22 @@ publish_done(struct rrdp *s, struct publish_xml *pxml)
unsigned char *data = NULL;
size_t datasz = 0;
if (pxml->data_length > 0)
switch (pxml->type) {
case PUB_ADD:
case PUB_UPD:
if (base64_decode_len(pxml->data_length, &datasz) == -1)
return -1;
if (datasz < MIN_FILE_SIZE)
return -1;
if ((base64_decode(pxml->data, pxml->data_length,
&data, &datasz)) == -1)
return -1;
break;
case PUB_DEL:
if (pxml->data_length != 0)
return -1;
break;
}
rrdp_publish_file(s, pxml, data, datasz);

View File

@ -1,4 +1,4 @@
/* $OpenBSD: rsync.c,v 1.47 2023/11/23 13:01:15 job Exp $ */
/* $OpenBSD: rsync.c,v 1.48 2023/11/24 14:05:47 job Exp $ */
/*
* Copyright (c) 2019 Kristaps Dzonsons <kristaps@bsd.lv>
*
@ -147,6 +147,7 @@ exec_rsync(const char *prog, const char *bind_addr, char *uri, char *dst,
args[i++] = (char *)prog;
args[i++] = "-rtO";
args[i++] = "--no-motd";
args[i++] = "--min-size=" STRINGIFY(MIN_FILE_SIZE);
args[i++] = "--max-size=" STRINGIFY(MAX_FILE_SIZE);
args[i++] = "--contimeout=" STRINGIFY(MAX_CONN_TIMEOUT);
args[i++] = "--timeout=" STRINGIFY(MAX_IO_TIMEOUT);