aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/diff/CVS/Entries12
-rw-r--r--usr.bin/diff/diff.17
-rw-r--r--usr.bin/diff/diff.h4
-rw-r--r--usr.bin/doas/CVS/Entries14
-rw-r--r--usr.bin/doas/doas.112
-rw-r--r--usr.bin/doas/doas.c25
-rw-r--r--usr.bin/doas/doas.conf.510
-rw-r--r--usr.bin/doas/doas.h5
-rw-r--r--usr.bin/doas/parse.c146
-rw-r--r--usr.bin/doas/parse.tab.h9
-rw-r--r--usr.bin/doas/parse.y25
-rw-r--r--usr.bin/m4/CVS/Entries20
-rw-r--r--usr.bin/m4/PSD.doc/CVS/Entries4
-rw-r--r--usr.bin/m4/TEST/CVS/Entries12
-rw-r--r--usr.bin/m4/m4.115
-rw-r--r--usr.bin/mandoc/CVS/Entries184
-rw-r--r--usr.bin/mandoc/CVS/Entries.Log4
-rw-r--r--usr.bin/mandoc/apropos.18
-rw-r--r--usr.bin/mandoc/arch.c4
-rw-r--r--usr.bin/mandoc/cgi.c7
-rw-r--r--usr.bin/mandoc/html.c7
-rw-r--r--usr.bin/mandoc/libmandoc.h4
-rw-r--r--usr.bin/mandoc/main.c44
-rw-r--r--usr.bin/mandoc/man_html.c16
-rw-r--r--usr.bin/mandoc/man_term.c10
-rw-r--r--usr.bin/mandoc/man_validate.c4
-rw-r--r--usr.bin/mandoc/mandoc.170
-rw-r--r--usr.bin/mandoc/mandoc.c25
-rw-r--r--usr.bin/mandoc/mandoc.css7
-rw-r--r--usr.bin/mandoc/mandoc.h9
-rw-r--r--usr.bin/mandoc/mandoc_msg.c9
-rw-r--r--usr.bin/mandoc/mdoc_html.c18
-rw-r--r--usr.bin/mandoc/mdoc_man.c34
-rw-r--r--usr.bin/mandoc/mdoc_validate.c4
-rw-r--r--usr.bin/mandoc/read.c7
-rw-r--r--usr.bin/mandoc/roff.c12
-rw-r--r--usr.bin/mandoc/tbl_data.c21
-rw-r--r--usr.bin/mandoc/tbl_html.c16
-rw-r--r--usr.bin/mandoc/tbl_term.c13
-rw-r--r--usr.bin/mandoc/term_tag.c11
-rw-r--r--usr.bin/mandoc/term_tag.h4
-rw-r--r--usr.bin/nc/CVS/Entries12
-rw-r--r--usr.bin/nc/CVS/Entries.Log4
-rw-r--r--usr.bin/nc/nc.111
-rw-r--r--usr.bin/nc/netcat.c18
-rw-r--r--usr.bin/patch/CVS/Entries28
-rw-r--r--usr.bin/patch/backupfile.c28
-rw-r--r--usr.bin/signify/CVS/Entries24
48 files changed, 577 insertions, 420 deletions
diff --git a/usr.bin/diff/CVS/Entries b/usr.bin/diff/CVS/Entries
index 912da0e..80cc5ce 100644
--- a/usr.bin/diff/CVS/Entries
+++ b/usr.bin/diff/CVS/Entries
@@ -1,9 +1,9 @@
-/Makefile/1.3/Tue May 29 18:24:56 2007//
-/diff.1/1.49/Sat Feb 8 01:09:58 2020//
/diff.c/1.67/Fri Jun 28 13:35:00 2019//
-/diff.h/1.33/Mon Oct 5 20:15:00 2015//
-/diffdir.c/1.47/Fri Jan 25 00:19:26 2019//
/diffreg.c/1.93/Fri Jun 28 13:35:00 2019//
-/xmalloc.c/1.10/Fri Jun 28 05:44:09 2019//
-/xmalloc.h/1.4/Thu Nov 12 16:30:30 2015//
+/Makefile/1.3/Mon Oct 19 10:36:43 2020//
+/diff.1/1.50/Wed Jul 14 10:52:37 2021//
+/diff.h/1.34/Wed Jul 14 10:52:37 2021//
+/diffdir.c/1.47/Mon Oct 19 10:36:43 2020//
+/xmalloc.c/1.10/Mon Oct 19 10:36:43 2020//
+/xmalloc.h/1.4/Mon Oct 19 10:36:43 2020//
D
diff --git a/usr.bin/diff/diff.1 b/usr.bin/diff/diff.1
index 353c770..85a168d 100644
--- a/usr.bin/diff/diff.1
+++ b/usr.bin/diff/diff.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: diff.1,v 1.49 2020/02/08 01:09:58 jsg Exp $
+.\" $OpenBSD: diff.1,v 1.50 2021/03/08 02:47:27 jsg Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)diff.1 8.1 (Berkeley) 6/30/93
.\"
-.Dd $Mdocdate: February 8 2020 $
+.Dd $Mdocdate: March 8 2021 $
.Dt DIFF 1
.Os
.Sh NAME
@@ -453,8 +453,9 @@ An error occurred.
.%A James W. Hunt
.%A M. Douglas McIlroy
.%T "An Algorithm for Differential File Comparison"
+.%I AT&T Bell Laboratories
.%J Computing Science Technical Report
-.%Q Bell Laboratories 41
+.%N 41
.%D June 1976
.Re
.Sh STANDARDS
diff --git a/usr.bin/diff/diff.h b/usr.bin/diff/diff.h
index 3a36222..c032350 100644
--- a/usr.bin/diff/diff.h
+++ b/usr.bin/diff/diff.h
@@ -1,6 +1,6 @@
+/* $OpenBSD: diff.h,v 1.34 2020/11/01 18:16:08 jcs Exp $ */
-
-/*ROR
+/*
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
diff --git a/usr.bin/doas/CVS/Entries b/usr.bin/doas/CVS/Entries
index 0b2860e..bda4789 100644
--- a/usr.bin/doas/CVS/Entries
+++ b/usr.bin/doas/CVS/Entries
@@ -1,8 +1,8 @@
-/Makefile/1.3/Mon Jul 3 22:21:47 2017//
-/doas.1/1.23/Thu Jul 4 19:04:17 2019//
-/doas.c/1.82/Fri Oct 18 17:15:45 2019//
-/doas.conf.5/1.43/Sat May 16 16:58:11 2020//
-/doas.h/1.15/Mon Jun 17 19:51:23 2019//
-/env.c/1.10/Sun Jul 7 19:21:28 2019//
-/parse.y/1.27/Wed Jul 11 07:39:22 2018//
+/Makefile/1.3/Mon Oct 19 10:36:43 2020//
+/doas.1/1.25/Result of merge//
+/doas.c/1.90/Result of merge+Wed Jul 14 11:14:15 2021//
+/doas.conf.5/1.45/Wed Jul 14 11:14:15 2021//
+/doas.h/1.17/Result of merge//
+/env.c/1.10/Mon Oct 19 10:36:43 2020//
+/parse.y/1.29/Result of merge//
D
diff --git a/usr.bin/doas/doas.1 b/usr.bin/doas/doas.1
index c7196e3..a91705e 100644
--- a/usr.bin/doas/doas.1
+++ b/usr.bin/doas/doas.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: doas.1,v 1.23 2019/07/04 19:04:17 tedu Exp $
+.\" $OpenBSD: doas.1,v 1.25 2021/01/16 09:18:41 martijn Exp $
.\"
.\"Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
.\"
@@ -13,7 +13,7 @@
.\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.Dd $Mdocdate: July 4 2019 $
+.Dd $Mdocdate: January 16 2021 $
.Dt DOAS 1
.Os
.Sh NAME
@@ -85,13 +85,13 @@ will be printed on standard output, depending on command
matching results.
No command is executed.
.It Fl L
-Clear any persisted authorizations from previous invocations,
+Clear any persisted authentications from previous invocations,
then immediately exit.
No command is executed.
.It Fl n
-Non interactive mode, fail if
-.Nm
-would prompt for password.
+Non interactive mode, fail if the matching rule doesn't have the
+.Ic nopass
+option.
.It Fl s
Execute the shell from
.Ev SHELL
diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c
index 15220e4..799373c 100644
--- a/usr.bin/doas/doas.c
+++ b/usr.bin/doas/doas.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: doas.c,v 1.82 2019/10/18 17:15:45 tedu Exp $ */
+/* $OpenBSD: doas.c,v 1.90 2021/07/12 15:09:19 beck Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -147,7 +147,7 @@ static int
permit(uid_t uid, gid_t *groups, int ngroups, const struct rule **lastr,
uid_t target, const char *cmd, const char **cmdargs)
{
- int i;
+ size_t i;
*lastr = NULL;
for (i = 0; i < nrules; i++) {
@@ -194,6 +194,8 @@ checkconfig(const char *confpath, int argc, char **argv,
const struct rule *rule;
setresuid(uid, uid, uid);
+ if (pledge("stdio rpath getpw", NULL) == -1)
+ err(1, "pledge");
parseconfig(confpath, 0);
if (!argc)
exit(0);
@@ -254,8 +256,9 @@ authuser(char *myname, int persist)
}
if (!verifypasswd(myname, response)) {
explicit_bzero(rbuf, sizeof(rbuf));
- syslog(LOG_NOTICE, "failed auth for %s", myname);
- errx(1, "Authorization failed");
+ syslog(LOG_AUTHPRIV | LOG_NOTICE,
+ "failed auth for %s", myname);
+ errx(1, "Authentication failed");
}
explicit_bzero(rbuf, sizeof(rbuf));
good:
@@ -385,6 +388,8 @@ main(int argc, char **argv)
}
if (confpath) {
+ if (pledge("stdio rpath getpw id", NULL) == -1)
+ err(1, "pledge");
checkconfig(confpath, argc, argv, uid, groups, ngroups,
target);
exit(1); /* fail safe */
@@ -407,14 +412,15 @@ main(int argc, char **argv)
cmd = argv[0];
if (!permit(uid, groups, ngroups, &rule, target, cmd,
(const char **)argv + 1)) {
- syslog(LOG_NOTICE, "failed command for %s: %s", mypw->pw_name, cmdline);
+ syslog(LOG_AUTHPRIV | LOG_NOTICE,
+ "command not permitted for %s: %s", mypw->pw_name, cmdline);
errno = EPERM;
err(1, NULL);
}
if (!(rule->options & NOPASS)) {
if (nflag)
- errx(1, "Authorization required");
+ errx(1, "Authentication required");
authuser(mypw->pw_name, rule->options & PERSIST);
}
@@ -461,8 +467,11 @@ main(int argc, char **argv)
if (pledge("stdio exec", NULL) == -1)
err(1, "pledge");
- syslog(LOG_INFO, "%s ran command %s as %s from %s",
- mypw->pw_name, cmdline, targpw->pw_name, cwd);
+ if (!(rule->options & NOLOG)) {
+ syslog(LOG_AUTHPRIV | LOG_INFO,
+ "%s ran command %s as %s from %s",
+ mypw->pw_name, cmdline, targpw->pw_name, cwd);
+ }
envp = prepenv(rule, mypw, targpw);
diff --git a/usr.bin/doas/doas.conf.5 b/usr.bin/doas/doas.conf.5
index 4adb94e..e98bfbe 100644
--- a/usr.bin/doas/doas.conf.5
+++ b/usr.bin/doas/doas.conf.5
@@ -1,4 +1,4 @@
-.\" $OpenBSD: doas.conf.5,v 1.43 2020/05/16 16:58:11 jmc Exp $
+.\" $OpenBSD: doas.conf.5,v 1.45 2020/10/09 10:24:33 jmc Exp $
.\"
.\"Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
.\"
@@ -13,7 +13,7 @@
.\"WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\"ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\"OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-.Dd $Mdocdate: May 16 2020 $
+.Dd $Mdocdate: October 9 2020 $
.Dt DOAS.CONF 5
.Os
.Sh NAME
@@ -45,6 +45,9 @@ Options are:
.Bl -tag -width keepenv
.It Ic nopass
The user is not required to enter a password.
+.It Ic nolog
+Do not log successful command execution to
+.Xr syslogd 8 .
.It Ic persist
After the user successfully authenticates, do not ask for a password
again for some time.
@@ -139,7 +142,8 @@ permit nopass tedu as root cmd /usr/sbin/procmap
permit nopass keepenv setenv { PATH } root as root
.Ed
.Sh SEE ALSO
-.Xr doas 1
+.Xr doas 1 ,
+.Xr syslogd 8
.Sh HISTORY
The
.Nm
diff --git a/usr.bin/doas/doas.h b/usr.bin/doas/doas.h
index c97986e..58b2215 100644
--- a/usr.bin/doas/doas.h
+++ b/usr.bin/doas/doas.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: doas.h,v 1.15 2019/06/17 19:51:23 tedu Exp $ */
+/* $OpenBSD: doas.h,v 1.17 2021/01/27 17:02:50 millert Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -26,7 +26,7 @@ struct rule {
};
extern struct rule **rules;
-extern int nrules;
+extern size_t nrules;
extern int parse_errors;
extern const char *formerpath;
@@ -46,3 +46,4 @@ int clearpersist(void);
#define NOPASS 0x1
#define KEEPENV 0x2
#define PERSIST 0x4
+#define NOLOG 0x8
diff --git a/usr.bin/doas/parse.c b/usr.bin/doas/parse.c
index abebdb2..9291da5 100644
--- a/usr.bin/doas/parse.c
+++ b/usr.bin/doas/parse.c
@@ -5,7 +5,7 @@
#define YYBYACC 1
#define YYMAJOR 2
#define YYMINOR 0
-#define YYPATCH 20200910
+#define YYPATCH 20210619
#define YYEMPTY (-1)
#define yyclearin (yychar = YYEMPTY)
@@ -50,8 +50,8 @@ typedef struct {
FILE *yyfp;
struct rule **rules;
-int nrules;
-static int maxrules;
+size_t nrules;
+static size_t maxrules;
int parse_errors = 0;
@@ -119,48 +119,52 @@ extern int YYPARSE_DECL();
#define TCMD 260
#define TARGS 261
#define TNOPASS 262
-#define TPERSIST 263
-#define TKEEPENV 264
-#define TSETENV 265
-#define TSTRING 266
+#define TNOLOG 263
+#define TPERSIST 264
+#define TKEEPENV 265
+#define TSETENV 266
+#define TSTRING 267
#define YYERRCODE 256
-typedef short YYINT;
+typedef int YYINT;
static const YYINT yylhs[] = { -1,
0, 0, 0, 0, 1, 2, 2, 6, 6, 7,
- 7, 7, 7, 8, 8, 3, 4, 4, 5, 5,
- 9, 9,
+ 7, 7, 7, 7, 8, 8, 3, 4, 4, 5,
+ 5, 9, 9,
};
static const YYINT yylen[] = { 2,
0, 2, 3, 2, 4, 2, 1, 0, 2, 1,
- 1, 1, 4, 0, 2, 1, 0, 2, 0, 3,
- 0, 2,
+ 1, 1, 1, 4, 0, 2, 1, 0, 2, 0,
+ 3, 0, 2,
};
static const YYINT yydefred[] = { 0,
0, 0, 4, 8, 7, 2, 0, 0, 0, 3,
- 16, 0, 10, 11, 12, 0, 9, 0, 0, 14,
- 18, 0, 5, 0, 0, 15, 13, 14, 20, 0,
+ 17, 0, 10, 11, 12, 13, 0, 9, 0, 0,
+ 15, 19, 0, 5, 0, 0, 16, 14, 15, 21,
+ 0,
};
static const YYINT yydgoto[] = { 2,
- 7, 8, 12, 19, 23, 9, 17, 24, 29,
+ 7, 8, 12, 20, 24, 9, 18, 25, 30,
};
static const YYINT yysindex[] = { -253,
- -1, -6, 0, 0, 0, 0, 2, -256, -257, 0,
- 0, -246, 0, 0, 0, -109, 0, -251, -244, 0,
- 0, -249, 0, -123, -243, 0, 0, 0, 0, -247,
+ 2, -6, 0, 0, 0, 0, 3, -252, -257, 0,
+ 0, -249, 0, 0, 0, 0, -109, 0, -251, -243,
+ 0, 0, -248, 0, -123, -241, 0, 0, 0, 0,
+ -246,
};
static const YYINT yyrindex[] = { 1,
0, 0, 0, 0, 0, 0, 0, 0, -245, 0,
- 0, -10, 0, 0, 0, 0, 0, 0, 10, 0,
- 0, 0, 0, 0, 12, 0, 0, 0, 0, 13,
+ 0, -10, 0, 0, 0, 0, 0, 0, 0, 8,
+ 0, 0, 0, 0, 0, 13, 0, 0, 0, 0,
+ 14,
};
static const YYINT yygindex[] = { 0,
0, 0, 0, 0, 0, 0, 0, -4, 0,
};
#define YYTABLESIZE 259
-static const YYINT yytable[] = { 17,
- 1, 27, 1, 6, 13, 14, 15, 16, 3, 11,
- 1, 10, 18, 20, 21, 22, 25, 28, 26, 19,
- 6, 21, 22, 30, 0, 0, 0, 0, 0, 0,
+static const YYINT yytable[] = { 18,
+ 1, 28, 1, 6, 13, 14, 15, 16, 17, 19,
+ 1, 3, 10, 21, 11, 22, 23, 20, 26, 29,
+ 27, 6, 22, 23, 31, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -172,7 +176,7 @@ static const YYINT yytable[] = { 17,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 26, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 27, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -182,13 +186,13 @@ static const YYINT yytable[] = { 17,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 17,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 18,
4, 5, 0, 0, 0, 0, 0, 1, 1,
};
static const YYINT yycheck[] = { 10,
- 0, 125, 256, 10, 262, 263, 264, 265, 10, 266,
- 10, 10, 259, 123, 266, 260, 266, 261, 266, 10,
- 266, 10, 10, 28, -1, -1, -1, -1, -1, -1,
+ 0, 125, 256, 10, 262, 263, 264, 265, 266, 259,
+ 10, 10, 10, 123, 267, 267, 260, 10, 267, 261,
+ 267, 267, 10, 10, 29, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -200,7 +204,7 @@ static const YYINT yycheck[] = { 10,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 266, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 267, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
@@ -217,8 +221,8 @@ static const YYINT yycheck[] = { 10,
#ifndef YYDEBUG
#define YYDEBUG 0
#endif
-#define YYMAXTOKEN 266
-#define YYUNDFTOKEN 278
+#define YYMAXTOKEN 267
+#define YYUNDFTOKEN 279
#define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
#if YYDEBUG
static const char *const yyname[] = {
@@ -230,8 +234,8 @@ static const char *const yyname[] = {
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"TPERMIT","TDENY",
-"TAS","TCMD","TARGS","TNOPASS","TPERSIST","TKEEPENV","TSETENV","TSTRING",0,0,0,
-0,0,0,0,0,0,0,0,"illegal-symbol",
+"TAS","TCMD","TARGS","TNOPASS","TNOLOG","TPERSIST","TKEEPENV","TSETENV",
+"TSTRING",0,0,0,0,0,0,0,0,0,0,0,"illegal-symbol",
};
static const char *const yyrule[] = {
"$accept : grammar",
@@ -245,6 +249,7 @@ static const char *const yyrule[] = {
"options :",
"options : options option",
"option : TNOPASS",
+"option : TNOLOG",
"option : TPERSIST",
"option : TKEEPENV",
"option : TSETENV '{' strlist '}'",
@@ -296,7 +301,7 @@ typedef struct {
} YYSTACKDATA;
/* variables for the parser stack */
static YYSTACKDATA yystack;
-#line 189 "usr.bin/doas/parse.y"
+#line 192 "usr.bin/doas/parse.y"
void
yyerror(const char *fmt, ...)
@@ -321,6 +326,7 @@ static struct keyword {
{ "cmd", TCMD },
{ "args", TARGS },
{ "nopass", TNOPASS },
+ { "nolog", TNOLOG },
{ "persist", TPERSIST },
{ "keepenv", TKEEPENV },
{ "setenv", TSETENV },
@@ -330,7 +336,8 @@ int
yylex(void)
{
char buf[1024], *ebuf, *p, *str;
- int i, c, quotes = 0, escape = 0, qpos = -1, nonkw = 0;
+ int c, quotes = 0, escape = 0, qpos = -1, nonkw = 0;
+ size_t i;
p = buf;
ebuf = buf + sizeof(buf);
@@ -452,7 +459,7 @@ eof:
yyerror("input error reading config");
return 0;
}
-#line 456 "usr.bin/doas/parse.c"
+#line 463 "usr.bin/doas/parse.c"
#if YYDEBUG
#include <stdio.h> /* needed for printf */
@@ -527,12 +534,12 @@ YYPARSE_DECL()
}
#endif
- yym = 0;
- yyn = 0;
+ /* yym is set below */
+ /* yyn is set below */
yynerrs = 0;
yyerrflag = 0;
yychar = YYEMPTY;
- yystate = 0;
+ /* yystate is set below */
#if YYPURE
memset(&yystack, 0, sizeof(yystack));
@@ -667,12 +674,12 @@ case 5:
r->cmdargs = yystack.l_mark[0].cmdargs;
if (nrules == maxrules) {
if (maxrules == 0)
- maxrules = 63;
- else
- maxrules *= 2;
- if (!(rules = reallocarray(rules, maxrules,
- sizeof(*rules))))
+ maxrules = 32;
+ rules = reallocarray(rules, maxrules,
+ 2 * sizeof(*rules));
+ if (!rules)
errx(1, "can't allocate rules");
+ maxrules *= 2;
}
rules[nrules++] = r;
}
@@ -728,33 +735,40 @@ break;
case 11:
#line 140 "usr.bin/doas/parse.y"
{
- yyval.options = PERSIST;
+ yyval.options = NOLOG;
yyval.envlist = NULL;
}
break;
case 12:
#line 143 "usr.bin/doas/parse.y"
{
- yyval.options = KEEPENV;
+ yyval.options = PERSIST;
yyval.envlist = NULL;
}
break;
case 13:
#line 146 "usr.bin/doas/parse.y"
{
+ yyval.options = KEEPENV;
+ yyval.envlist = NULL;
+ }
+break;
+case 14:
+#line 149 "usr.bin/doas/parse.y"
+ {
yyval.options = 0;
yyval.envlist = yystack.l_mark[-1].strlist;
}
break;
-case 14:
-#line 151 "usr.bin/doas/parse.y"
+case 15:
+#line 154 "usr.bin/doas/parse.y"
{
if (!(yyval.strlist = calloc(1, sizeof(char *))))
errx(1, "can't allocate strlist");
}
break;
-case 15:
-#line 154 "usr.bin/doas/parse.y"
+case 16:
+#line 157 "usr.bin/doas/parse.y"
{
int nstr = arraylen(yystack.l_mark[-1].strlist);
if (!(yyval.strlist = reallocarray(yystack.l_mark[-1].strlist, nstr + 2,
@@ -764,51 +778,51 @@ case 15:
yyval.strlist[nstr + 1] = NULL;
}
break;
-case 16:
-#line 164 "usr.bin/doas/parse.y"
+case 17:
+#line 167 "usr.bin/doas/parse.y"
{
yyval.str = yystack.l_mark[0].str;
}
break;
-case 17:
-#line 168 "usr.bin/doas/parse.y"
+case 18:
+#line 171 "usr.bin/doas/parse.y"
{
yyval.str = NULL;
}
break;
-case 18:
-#line 170 "usr.bin/doas/parse.y"
+case 19:
+#line 173 "usr.bin/doas/parse.y"
{
yyval.str = yystack.l_mark[0].str;
}
break;
-case 19:
-#line 174 "usr.bin/doas/parse.y"
+case 20:
+#line 177 "usr.bin/doas/parse.y"
{
yyval.cmd = NULL;
yyval.cmdargs = NULL;
}
break;
-case 20:
-#line 177 "usr.bin/doas/parse.y"
+case 21:
+#line 180 "usr.bin/doas/parse.y"
{
yyval.cmd = yystack.l_mark[-1].str;
yyval.cmdargs = yystack.l_mark[0].cmdargs;
}
break;
-case 21:
-#line 182 "usr.bin/doas/parse.y"
+case 22:
+#line 185 "usr.bin/doas/parse.y"
{
yyval.cmdargs = NULL;
}
break;
-case 22:
-#line 184 "usr.bin/doas/parse.y"
+case 23:
+#line 187 "usr.bin/doas/parse.y"
{
yyval.cmdargs = yystack.l_mark[0].strlist;
}
break;
-#line 812 "usr.bin/doas/parse.c"
+#line 826 "usr.bin/doas/parse.c"
}
yystack.s_mark -= yym;
yystate = *yystack.s_mark;
diff --git a/usr.bin/doas/parse.tab.h b/usr.bin/doas/parse.tab.h
index dfa6b41..c2ce6f9 100644
--- a/usr.bin/doas/parse.tab.h
+++ b/usr.bin/doas/parse.tab.h
@@ -4,7 +4,8 @@
#define TCMD 260
#define TARGS 261
#define TNOPASS 262
-#define TPERSIST 263
-#define TKEEPENV 264
-#define TSETENV 265
-#define TSTRING 266
+#define TNOLOG 263
+#define TPERSIST 264
+#define TKEEPENV 265
+#define TSETENV 266
+#define TSTRING 267
diff --git a/usr.bin/doas/parse.y b/usr.bin/doas/parse.y
index d1f698c..587fd2c 100644
--- a/usr.bin/doas/parse.y
+++ b/usr.bin/doas/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.27 2018/07/11 07:39:22 krw Exp $ */
+/* $OpenBSD: parse.y,v 1.29 2021/01/27 17:02:50 millert Exp $ */
/*
* Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
*
@@ -48,8 +48,8 @@ typedef struct {
FILE *yyfp;
struct rule **rules;
-int nrules;
-static int maxrules;
+size_t nrules;
+static size_t maxrules;
int parse_errors = 0;
@@ -71,7 +71,7 @@ arraylen(const char **arr)
%}
%token TPERMIT TDENY TAS TCMD TARGS
-%token TNOPASS TPERSIST TKEEPENV TSETENV
+%token TNOPASS TNOLOG TPERSIST TKEEPENV TSETENV
%token TSTRING
%%
@@ -96,12 +96,12 @@ rule: action ident target cmd {
r->cmdargs = $4.cmdargs;
if (nrules == maxrules) {
if (maxrules == 0)
- maxrules = 63;
- else
- maxrules *= 2;
- if (!(rules = reallocarray(rules, maxrules,
- sizeof(*rules))))
+ maxrules = 32;
+ rules = reallocarray(rules, maxrules,
+ 2 * sizeof(*rules));
+ if (!rules)
errx(1, "can't allocate rules");
+ maxrules *= 2;
}
rules[nrules++] = r;
} ;
@@ -137,6 +137,9 @@ options: /* none */ {
option: TNOPASS {
$$.options = NOPASS;
$$.envlist = NULL;
+ } | TNOLOG {
+ $$.options = NOLOG;
+ $$.envlist = NULL;
} | TPERSIST {
$$.options = PERSIST;
$$.envlist = NULL;
@@ -210,6 +213,7 @@ static struct keyword {
{ "cmd", TCMD },
{ "args", TARGS },
{ "nopass", TNOPASS },
+ { "nolog", TNOLOG },
{ "persist", TPERSIST },
{ "keepenv", TKEEPENV },
{ "setenv", TSETENV },
@@ -219,7 +223,8 @@ int
yylex(void)
{
char buf[1024], *ebuf, *p, *str;
- int i, c, quotes = 0, escape = 0, qpos = -1, nonkw = 0;
+ int c, quotes = 0, escape = 0, qpos = -1, nonkw = 0;
+ size_t i;
p = buf;
ebuf = buf + sizeof(buf);
diff --git a/usr.bin/m4/CVS/Entries b/usr.bin/m4/CVS/Entries
index adab986..bf36e6d 100644
--- a/usr.bin/m4/CVS/Entries
+++ b/usr.bin/m4/CVS/Entries
@@ -1,18 +1,18 @@
D/PSD.doc////
D/TEST////
-/Makefile/1.16/Sun Jul 9 14:04:50 2017//
-/NOTES/1.1.1.1/Wed Oct 18 08:45:35 1995//
/eval.c/1.78/Fri Jun 28 05:35:34 2019//
-/expr.c/1.18/Tue Sep 7 19:58:09 2010//
/extern.h/1.55/Thu Jun 15 13:48:42 2017//
-/gnum4.c/1.52/Mon Aug 21 21:41:13 2017//
/look.c/1.24/Sun Dec 21 09:33:12 2014//
-/m4.1/1.64/Thu Jun 15 13:48:42 2017//
/main.c/1.87/Thu Jun 15 13:48:42 2017//
-/mdef.h/1.33/Tue Nov 3 16:21:47 2015//
-/misc.c/1.47/Thu Jun 15 13:48:42 2017//
/parser.y/1.7/Thu Apr 12 17:00:11 2012//
-/pathnames.h/1.6/Tue Nov 3 16:21:47 2015//
-/stdd.h/1.6/Tue Sep 7 19:58:09 2010//
/tokenizer.l/1.10/Sat Jun 17 01:55:16 2017//
-/trace.c/1.16/Tue Sep 7 19:58:09 2010//
+/Makefile/1.16/Mon Oct 19 10:36:43 2020//
+/NOTES/1.1.1.1/Mon Oct 19 10:36:43 2020//
+/expr.c/1.18/Mon Oct 19 10:36:43 2020//
+/gnum4.c/1.52/Mon Oct 19 10:36:43 2020//
+/m4.1/1.65/Wed Jul 14 10:47:49 2021//
+/mdef.h/1.33/Mon Oct 19 10:36:43 2020//
+/misc.c/1.47/Mon Oct 19 10:36:43 2020//
+/pathnames.h/1.6/Mon Oct 19 10:36:43 2020//
+/stdd.h/1.6/Mon Oct 19 10:36:43 2020//
+/trace.c/1.16/Mon Oct 19 10:36:43 2020//
diff --git a/usr.bin/m4/PSD.doc/CVS/Entries b/usr.bin/m4/PSD.doc/CVS/Entries
index 8644d2d..4a1078a 100644
--- a/usr.bin/m4/PSD.doc/CVS/Entries
+++ b/usr.bin/m4/PSD.doc/CVS/Entries
@@ -1,3 +1,3 @@
-/Makefile/1.4/Sun Feb 1 14:43:10 2004//
-/m4.ms/1.2/Thu Jun 26 16:18:48 2003//
+/Makefile/1.4/Mon Oct 19 10:36:43 2020//
+/m4.ms/1.2/Mon Oct 19 10:36:43 2020//
D
diff --git a/usr.bin/m4/TEST/CVS/Entries b/usr.bin/m4/TEST/CVS/Entries
index 390dc32..c3ab419 100644
--- a/usr.bin/m4/TEST/CVS/Entries
+++ b/usr.bin/m4/TEST/CVS/Entries
@@ -1,7 +1,7 @@
-/ack.m4/1.3/Tue Jun 3 02:56:11 2003//
-/hanoi.m4/1.3/Tue Jun 3 02:56:11 2003//
-/hash.m4/1.3/Tue Jun 3 02:56:11 2003//
-/sqroot.m4/1.3/Tue Jun 3 02:56:11 2003//
-/string.m4/1.3/Tue Jun 3 02:56:11 2003//
-/test.m4/1.3/Tue Jun 3 02:56:11 2003//
+/ack.m4/1.3/Mon Oct 19 10:36:43 2020//
+/hanoi.m4/1.3/Mon Oct 19 10:36:43 2020//
+/hash.m4/1.3/Mon Oct 19 10:36:43 2020//
+/sqroot.m4/1.3/Mon Oct 19 10:36:43 2020//
+/string.m4/1.3/Mon Oct 19 10:36:43 2020//
+/test.m4/1.3/Mon Oct 19 10:36:43 2020//
D
diff --git a/usr.bin/m4/m4.1 b/usr.bin/m4/m4.1
index d389c15..c614235 100644
--- a/usr.bin/m4/m4.1
+++ b/usr.bin/m4/m4.1
@@ -1,4 +1,4 @@
-.\" @(#) $OpenBSD: m4.1,v 1.64 2017/06/15 13:48:42 bcallah Exp $
+.\" @(#) $OpenBSD: m4.1,v 1.65 2021/03/08 02:47:28 jsg Exp $
.\"
.\" Copyright (c) 1989, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -30,7 +30,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 15 2017 $
+.Dd $Mdocdate: March 8 2021 $
.Dt M4 1
.Os
.Sh NAME
@@ -450,6 +450,17 @@ But note that the
macro can modify the exit status, as can the
.Fl E
flag.
+.Sh SEE ALSO
+.Rs
+.\" 4.4BSD PSD:17
+.%A B. W. Kernighan
+.%A D. M. Ritchie
+.%I AT&T Bell Laboratories
+.%T The M4 Macro Processor
+.%R Computing Science Technical Report
+.%N 59
+.%D July 1977
+.Re
.Sh STANDARDS
The
.Nm
diff --git a/usr.bin/mandoc/CVS/Entries b/usr.bin/mandoc/CVS/Entries
index 3091a79..c1a6b0a 100644
--- a/usr.bin/mandoc/CVS/Entries
+++ b/usr.bin/mandoc/CVS/Entries
@@ -1,101 +1,101 @@
-/Makefile/1.118/Fri Mar 13 00:31:04 2020//
-/apropos.1/1.43/Mon Jul 20 14:52:12 2020//
-/arch.c/1.12/Mon Jun 29 19:16:59 2020//
-/att.c/1.14/Thu Dec 13 11:55:14 2018//
-/cgi.c/1.111/Mon Jun 29 19:16:59 2020//
-/cgi.h.example/1.6/Sat Mar 18 16:48:07 2017//
/chars.c/1.49/Thu Feb 13 16:16:03 2020//
/dba.c/1.7/Thu Feb 9 18:26:17 2017//
-/dba.h/1.2/Wed Aug 17 20:46:06 2016//
-/dba_array.c/1.1/Mon Aug 1 10:32:39 2016//
-/dba_array.h/1.1/Mon Aug 1 10:32:39 2016//
-/dba_read.c/1.4/Wed Aug 17 20:46:06 2016//
-/dba_write.c/1.1/Mon Aug 1 10:32:39 2016//
-/dba_write.h/1.1/Mon Aug 1 10:32:39 2016//
/dbm.c/1.5/Mon Jul 1 22:43:03 2019//
-/dbm.h/1.1/Mon Aug 1 10:32:39 2016//
/dbm_map.c/1.6/Thu Feb 9 18:26:17 2017//
-/dbm_map.h/1.2/Mon Jul 1 22:43:03 2019//
-/eqn.c/1.47/Wed Jan 8 12:09:14 2020//
-/eqn.h/1.1/Thu Dec 13 05:13:15 2018//
-/eqn_html.c/1.15/Sun Mar 17 18:20:07 2019//
-/eqn_parse.h/1.3/Fri Dec 14 06:33:03 2018//
-/eqn_term.c/1.15/Thu Dec 13 05:13:15 2018//
-/html.c/1.141/Mon Apr 20 12:59:24 2020//
-/html.h/1.70/Sat Apr 18 20:28:46 2020//
-/libman.h/1.61/Mon Dec 31 10:03:38 2018//
-/libmandoc.h/1.64/Fri Apr 3 11:34:19 2020//
-/libmdoc.h/1.88/Mon Dec 31 04:55:42 2018//
-/main.c/1.255/Tue Jul 21 15:08:48 2020//
-/main.h/1.25/Sun Mar 3 13:01:47 2019//
-/makewhatis.8/1.14/Wed May 17 22:26:52 2017//
-/man.1/1.39/Mon Jul 20 14:52:12 2020//
-/man.c/1.135/Sat Jan 5 00:36:46 2019//
-/man.cgi.8/1.22/Sun May 20 21:48:23 2018//
-/man.conf.5/1.8/Mon Feb 10 14:42:03 2020//
-/man.h/1.59/Thu Aug 23 19:32:03 2018//
-/man_html.c/1.131/Sat Apr 4 20:23:06 2020//
-/man_macro.c/1.107/Wed Sep 9 16:57:05 2020//
-/man_term.c/1.188/Fri Mar 13 00:31:05 2020//
-/man_validate.c/1.124/Fri Apr 24 11:58:02 2020//
-/manconf.h/1.9/Tue Jul 21 15:08:49 2020//
-/mandoc.1/1.173/Tue Sep 1 18:24:09 2020//
-/mandoc.c/1.85/Sun Jan 19 16:16:32 2020//
-/mandoc.css/1.33/Sun Jun 2 16:50:46 2019//
-/mandoc.h/1.211/Tue Sep 1 18:24:09 2020//
-/mandoc_aux.c/1.9/Wed Feb 7 20:04:33 2018//
-/mandoc_aux.h/1.9/Mon Jun 12 18:55:42 2017//
-/mandoc_msg.c/1.10/Tue Sep 1 18:24:10 2020//
/mandoc_ohash.c/1.2/Mon Oct 19 18:58:20 2015//
-/mandoc_ohash.h/1.2/Sat Nov 7 13:57:55 2015//
-/mandoc_parse.h/1.4/Sat Nov 9 14:39:42 2019//
/mandoc_xr.c/1.3/Sun Jul 2 21:17:12 2017//
-/mandoc_xr.h/1.3/Sun Jul 2 21:17:12 2017//
-/mandocdb.c/1.216/Fri Apr 3 11:34:19 2020//
-/manpath.c/1.30/Thu Aug 27 14:59:42 2020//
/mansearch.c/1.65/Mon Jul 1 22:43:03 2019//
-/mansearch.h/1.24/Tue Apr 30 18:48:26 2019//
-/mdoc.c/1.164/Mon Apr 6 09:55:49 2020//
-/mdoc.h/1.71/Sun Dec 30 00:48:47 2018//
-/mdoc_argv.c/1.76/Thu Jul 11 16:56:52 2019//
-/mdoc_html.c/1.215/Sun Apr 19 15:15:54 2020//
-/mdoc_macro.c/1.191/Sun Jan 19 17:59:01 2020//
-/mdoc_man.c/1.134/Thu Feb 27 01:25:57 2020//
-/mdoc_markdown.c/1.35/Fri Apr 3 11:34:19 2020//
-/mdoc_state.c/1.16/Sun Jan 19 17:59:01 2020//
-/mdoc_term.c/1.279/Mon Apr 6 09:55:49 2020//
-/mdoc_validate.c/1.302/Sun Apr 26 21:29:45 2020//
-/msec.c/1.13/Fri Dec 14 01:17:46 2018//
-/msec.in/1.6/Sat Jun 24 17:36:50 2017//
-/out.c/1.51/Tue Dec 31 22:49:17 2019//
-/out.h/1.25/Fri Apr 3 11:34:19 2020//
-/preconv.c/1.9/Thu Dec 13 11:55:14 2018//
-/predefs.in/1.4/Fri Nov 28 19:25:03 2014//
-/read.c/1.190/Fri Apr 24 11:58:02 2020//
-/roff.c/1.248/Thu Aug 27 12:58:00 2020//
-/roff.h/1.56/Wed Apr 8 11:54:14 2020//
-/roff_html.c/1.20/Tue Apr 30 15:52:42 2019//
-/roff_int.h/1.17/Fri Apr 24 11:58:02 2020//
-/roff_term.c/1.21/Thu Sep 3 20:33:20 2020//
-/roff_validate.c/1.19/Thu Feb 27 01:25:58 2020//
-/st.c/1.13/Fri Dec 14 01:17:46 2018//
/tag.c/1.36/Sun Apr 19 16:26:11 2020//
-/tag.h/1.14/Sat Apr 18 20:28:46 2020//
-/tbl.c/1.27/Fri Dec 14 06:33:03 2018//
-/tbl.h/1.5/Wed Dec 12 21:54:30 2018//
-/tbl_data.c/1.40/Sat Jan 11 20:48:13 2020//
-/tbl_html.c/1.28/Sun Mar 17 18:20:07 2019//
-/tbl_int.h/1.2/Fri Dec 14 06:33:03 2018//
-/tbl_layout.c/1.36/Tue Sep 1 18:24:10 2020//
-/tbl_opts.c/1.16/Fri Dec 14 05:17:45 2018//
-/tbl_parse.h/1.2/Fri Dec 14 06:33:03 2018//
-/tbl_term.c/1.61/Sat Jan 11 16:24:33 2020//
-/term.c/1.142/Wed Sep 2 16:36:48 2020//
-/term.h/1.75/Fri Jan 4 03:20:44 2019//
-/term_ascii.c/1.52/Wed Sep 9 13:40:24 2020//
-/term_ps.c/1.56/Sun Sep 6 14:44:19 2020//
-/term_tab.c/1.4/Sat Jun 17 14:55:02 2017//
-/term_tag.c/1.5/Tue Jul 21 15:08:49 2020//
-/term_tag.h/1.3/Tue Jul 21 15:08:49 2020//
-/tree.c/1.56/Wed Apr 8 11:54:14 2020//
+/Makefile/1.118/Mon Oct 19 10:36:43 2020//
+/apropos.1/1.45/Wed Jul 14 10:44:49 2021//
+/arch.c/1.14/Wed Jul 14 10:44:49 2021//
+/att.c/1.14/Mon Oct 19 10:36:43 2020//
+/cgi.c/1.113/Wed Jul 14 10:44:49 2021//
+/cgi.h.example/1.6/Mon Oct 19 10:36:43 2020//
+/dba.h/1.2/Mon Oct 19 10:36:43 2020//
+/dba_array.c/1.1/Mon Oct 19 10:36:43 2020//
+/dba_array.h/1.1/Mon Oct 19 10:36:43 2020//
+/dba_read.c/1.4/Mon Oct 19 10:36:43 2020//
+/dba_write.c/1.1/Mon Oct 19 10:36:43 2020//
+/dba_write.h/1.1/Mon Oct 19 10:36:43 2020//
+/dbm.h/1.1/Mon Oct 19 10:36:43 2020//
+/dbm_map.h/1.2/Mon Oct 19 10:36:43 2020//
+/eqn.c/1.47/Mon Oct 19 10:36:43 2020//
+/eqn.h/1.1/Mon Oct 19 10:36:43 2020//
+/eqn_html.c/1.15/Mon Oct 19 10:36:43 2020//
+/eqn_parse.h/1.3/Mon Oct 19 10:36:43 2020//
+/eqn_term.c/1.15/Mon Oct 19 10:36:43 2020//
+/html.c/1.144/Result of merge//
+/html.h/1.70/Mon Oct 19 10:36:43 2020//
+/libman.h/1.61/Mon Oct 19 10:36:43 2020//
+/libmandoc.h/1.65/Wed Jul 14 10:44:49 2021//
+/libmdoc.h/1.88/Mon Oct 19 10:36:43 2020//
+/main.c/1.257/Result of merge//
+/main.h/1.25/Mon Oct 19 10:36:43 2020//
+/makewhatis.8/1.14/Mon Oct 19 10:36:43 2020//
+/man.1/1.39/Mon Oct 19 10:36:43 2020//
+/man.c/1.135/Mon Oct 19 10:36:43 2020//
+/man.cgi.8/1.22/Mon Oct 19 10:36:43 2020//
+/man.conf.5/1.8/Mon Oct 19 10:36:43 2020//
+/man.h/1.59/Mon Oct 19 10:36:43 2020//
+/man_html.c/1.132/Wed Jul 14 10:44:50 2021//
+/man_macro.c/1.107/Mon Oct 19 10:36:43 2020//
+/man_term.c/1.189/Wed Jul 14 10:44:50 2021//
+/man_validate.c/1.125/Wed Jul 14 10:44:50 2021//
+/manconf.h/1.9/Mon Oct 19 10:36:43 2020//
+/mandoc.1/1.178/Wed Jul 14 10:44:50 2021//
+/mandoc.c/1.86/Wed Jul 14 10:44:50 2021//
+/mandoc.css/1.35/Wed Jul 14 10:44:50 2021//
+/mandoc.h/1.214/Wed Jul 14 10:44:50 2021//
+/mandoc_aux.c/1.9/Mon Oct 19 10:36:43 2020//
+/mandoc_aux.h/1.9/Mon Oct 19 10:36:43 2020//
+/mandoc_msg.c/1.13/Wed Jul 14 10:44:50 2021//
+/mandoc_ohash.h/1.2/Mon Oct 19 10:36:43 2020//
+/mandoc_parse.h/1.4/Mon Oct 19 10:36:43 2020//
+/mandoc_xr.h/1.3/Mon Oct 19 10:36:43 2020//
+/mandocdb.c/1.216/Mon Oct 19 10:36:43 2020//
+/manpath.c/1.30/Mon Oct 19 10:36:43 2020//
+/mansearch.h/1.24/Mon Oct 19 10:36:43 2020//
+/mdoc.c/1.164/Mon Oct 19 10:36:43 2020//
+/mdoc.h/1.71/Mon Oct 19 10:36:43 2020//
+/mdoc_argv.c/1.76/Mon Oct 19 10:36:43 2020//
+/mdoc_html.c/1.217/Wed Jul 14 10:44:50 2021//
+/mdoc_macro.c/1.191/Mon Oct 19 10:36:43 2020//
+/mdoc_man.c/1.135/Wed Jul 14 10:44:50 2021//
+/mdoc_markdown.c/1.35/Mon Oct 19 10:36:43 2020//
+/mdoc_state.c/1.16/Mon Oct 19 10:36:43 2020//
+/mdoc_term.c/1.279/Mon Oct 19 10:36:43 2020//
+/mdoc_validate.c/1.303/Wed Jul 14 10:44:50 2021//
+/msec.c/1.13/Mon Oct 19 10:36:43 2020//
+/msec.in/1.6/Mon Oct 19 10:36:43 2020//
+/out.c/1.51/Mon Oct 19 10:36:43 2020//
+/out.h/1.25/Mon Oct 19 10:36:43 2020//
+/preconv.c/1.9/Mon Oct 19 10:36:43 2020//
+/predefs.in/1.4/Mon Oct 19 10:36:43 2020//
+/read.c/1.191/Wed Jul 14 10:44:50 2021//
+/roff.c/1.249/Result of merge//
+/roff.h/1.56/Mon Oct 19 10:36:43 2020//
+/roff_html.c/1.20/Mon Oct 19 10:36:43 2020//
+/roff_int.h/1.17/Mon Oct 19 10:36:43 2020//
+/roff_term.c/1.21/Mon Oct 19 10:36:43 2020//
+/roff_validate.c/1.19/Mon Oct 19 10:36:43 2020//
+/st.c/1.13/Mon Oct 19 10:36:43 2020//
+/tag.h/1.14/Mon Oct 19 10:36:43 2020//
+/tbl.c/1.27/Mon Oct 19 10:36:43 2020//
+/tbl.h/1.5/Mon Oct 19 10:36:43 2020//
+/tbl_data.c/1.42/Wed Jul 14 10:44:50 2021//
+/tbl_html.c/1.30/Wed Jul 14 10:44:50 2021//
+/tbl_int.h/1.2/Mon Oct 19 10:36:43 2020//
+/tbl_layout.c/1.36/Mon Oct 19 10:36:43 2020//
+/tbl_opts.c/1.16/Mon Oct 19 10:36:43 2020//
+/tbl_parse.h/1.2/Mon Oct 19 10:36:43 2020//
+/tbl_term.c/1.62/Wed Jul 14 10:44:50 2021//
+/term.c/1.142/Mon Oct 19 10:36:43 2020//
+/term.h/1.75/Mon Oct 19 10:36:43 2020//
+/term_ascii.c/1.52/Mon Oct 19 10:36:43 2020//
+/term_ps.c/1.56/Mon Oct 19 10:36:43 2020//
+/term_tab.c/1.4/Mon Oct 19 10:36:43 2020//
+/term_tag.c/1.6/Wed Jul 14 10:44:50 2021//
+/term_tag.h/1.4/Wed Jul 14 10:44:50 2021//
+/tree.c/1.56/Mon Oct 19 10:36:43 2020//
D
diff --git a/usr.bin/mandoc/CVS/Entries.Log b/usr.bin/mandoc/CVS/Entries.Log
new file mode 100644
index 0000000..73c8ed5
--- /dev/null
+++ b/usr.bin/mandoc/CVS/Entries.Log
@@ -0,0 +1,4 @@
+A D/lib////
+A D/mandoc////
+R D/mandoc////
+R D/lib////
diff --git a/usr.bin/mandoc/apropos.1 b/usr.bin/mandoc/apropos.1
index c81add1..5f1229f 100644
--- a/usr.bin/mandoc/apropos.1
+++ b/usr.bin/mandoc/apropos.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: apropos.1,v 1.43 2020/07/20 14:52:12 schwarze Exp $
+.\" $OpenBSD: apropos.1,v 1.45 2020/10/01 22:47:26 schwarze Exp $
.\"
.\" Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2011,2012,2014,2017,2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 20 2020 $
+.Dd $Mdocdate: October 1 2020 $
.Dt APROPOS 1
.Os
.Sh NAME
@@ -403,6 +403,10 @@ Search in names and descriptions using a case-sensitive regular expression:
.Pp
.Dl $ apropos \(aq\(tiset.?[ug]id\(aq
.Pp
+Search for all manual pages in a given section:
+.Pp
+.Dl $ apropos \-s 9 \&.
+.Pp
Search for manuals in the library section mentioning both the
.Qq optind
and the
diff --git a/usr.bin/mandoc/arch.c b/usr.bin/mandoc/arch.c
index 782f2c7..cc1c456 100644
--- a/usr.bin/mandoc/arch.c
+++ b/usr.bin/mandoc/arch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: arch.c,v 1.12 2020/06/29 19:16:59 schwarze Exp $ */
+/* $OpenBSD: arch.c,v 1.14 2021/05/01 16:11:17 visa Exp $ */
/*
* Copyright (c) 2017, 2019 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -24,7 +24,7 @@ arch_valid(const char *arch, enum mandoc_os os)
const char *openbsd_arch[] = {
"alpha", "amd64", "arm64", "armv7", "hppa", "i386",
"landisk", "loongson", "luna88k", "macppc", "mips64",
- "octeon", "powerpc64", "sgi", "sparc64", NULL
+ "octeon", "powerpc64", "riscv64", "sparc64", NULL
};
const char *netbsd_arch[] = {
"acorn26", "acorn32", "algor", "alpha", "amiga",
diff --git a/usr.bin/mandoc/cgi.c b/usr.bin/mandoc/cgi.c
index c6db66f..0fa50e1 100644
--- a/usr.bin/mandoc/cgi.c
+++ b/usr.bin/mandoc/cgi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cgi.c,v 1.111 2020/06/29 19:16:59 schwarze Exp $ */
+/* $OpenBSD: cgi.c,v 1.113 2021/05/01 16:11:17 visa Exp $ */
/*
* Copyright (c) 2014-2019 Ingo Schwarze <schwarze@usta.de>
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -121,14 +121,15 @@ static const char *const arch_names[] = {
"amd64", "alpha", "armv7", "arm64",
"hppa", "i386", "landisk", "loongson",
"luna88k", "macppc", "mips64", "octeon",
- "powerpc64", "sgi", "socppc", "sparc64",
+ "powerpc64", "riscv64", "sparc64",
"amiga", "arc", "armish", "arm32",
"atari", "aviion", "beagle", "cats",
"hppa64", "hp300",
"ia64", "mac68k", "mvme68k", "mvme88k",
"mvmeppc", "palm", "pc532", "pegasos",
- "pmax", "powerpc", "solbourne", "sparc",
+ "pmax", "powerpc", "sgi", "socppc",
+ "solbourne", "sparc",
"sun3", "vax", "wgrisc", "x68k",
"zaurus"
};
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 0225e66..a47dc92 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.141 2020/04/20 12:59:24 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.144 2021/05/22 05:49:32 anton Exp $ */
/*
* Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -80,7 +80,7 @@ static const struct htmldata htmltags[TAG_MAX] = {
{"h1", HTML_TOPHRASE | HTML_NLAROUND},
{"h2", HTML_TOPHRASE | HTML_NLAROUND},
{"p", HTML_TOPHRASE | HTML_NLAROUND | HTML_INDENT},
- {"pre", HTML_TOPHRASE | HTML_NLALL | HTML_NOINDENT},
+ {"pre", HTML_TOPHRASE | HTML_NLAROUND | HTML_NOINDENT},
{"a", HTML_INPHRASE | HTML_TOPHRASE},
{"b", HTML_INPHRASE | HTML_TOPHRASE},
{"cite", HTML_INPHRASE | HTML_TOPHRASE},
@@ -139,6 +139,7 @@ html_alloc(const struct manoutput *outopts)
h = mandoc_calloc(1, sizeof(struct html));
h->tag = NULL;
+ h->metac = h->metal = ESCAPE_FONTROMAN;
h->style = outopts->style;
if ((h->base_man1 = outopts->man) == NULL)
h->base_man2 = NULL;
@@ -194,6 +195,8 @@ print_gen_head(struct html *h)
struct tag *t;
print_otag(h, TAG_META, "?", "charset", "utf-8");
+ print_otag(h, TAG_META, "??", "name", "viewport",
+ "content", "width=device-width, initial-scale=1.0");
if (h->style != NULL) {
print_otag(h, TAG_LINK, "?h??", "rel", "stylesheet",
h->style, "type", "text/css", "media", "all");
diff --git a/usr.bin/mandoc/libmandoc.h b/usr.bin/mandoc/libmandoc.h
index b291631..354845f 100644
--- a/usr.bin/mandoc/libmandoc.h
+++ b/usr.bin/mandoc/libmandoc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: libmandoc.h,v 1.64 2020/04/03 11:34:19 schwarze Exp $ */
+/* $OpenBSD: libmandoc.h,v 1.65 2021/06/27 17:57:13 schwarze Exp $ */
/*
* Copyright (c) 2013-2015,2017,2018,2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -73,7 +73,7 @@ void roff_reset(struct roff *);
void roff_man_free(struct roff_man *);
struct roff_man *roff_man_alloc(struct roff *, const char *, int);
void roff_man_reset(struct roff_man *);
-int roff_parseln(struct roff *, int, struct buf *, int *);
+int roff_parseln(struct roff *, int, struct buf *, int *, size_t);
void roff_userret(struct roff *);
void roff_endparse(struct roff *);
void roff_setreg(struct roff *, const char *, int, char);
diff --git a/usr.bin/mandoc/main.c b/usr.bin/mandoc/main.c
index e472977..3a5585c 100644
--- a/usr.bin/mandoc/main.c
+++ b/usr.bin/mandoc/main.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: main.c,v 1.255 2020/07/21 15:08:48 schwarze Exp $ */
+/* $OpenBSD: main.c,v 1.257 2021/06/02 18:27:36 schwarze Exp $ */
/*
- * Copyright (c) 2010-2012, 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010-2012, 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Joerg Sonnenberger <joerg@netbsd.org>
*
@@ -92,7 +92,7 @@ struct outstate {
int mandocdb(int, char *[]);
-static void check_xr(void);
+static void check_xr(struct manpaths *);
static int fs_lookup(const struct manpaths *,
size_t ipath, const char *,
const char *, const char *,
@@ -103,7 +103,7 @@ static int fs_search(const struct mansearch *,
static void glob_esc(char **, const char *, const char *);
static void outdata_alloc(struct outstate *, struct manoutput *);
static void parse(struct mparse *, int, const char *,
- struct outstate *, struct manoutput *);
+ struct outstate *, struct manconf *);
static void passthrough(int, int);
static void process_onefile(struct mparse *, struct manpage *,
int, struct outstate *, struct manconf *);
@@ -432,7 +432,8 @@ main(int argc, char *argv[])
/* Read the configuration file. */
- if (search.argmode != ARG_FILE)
+ if (search.argmode != ARG_FILE ||
+ mandoc_msg_getmin() == MANDOCERR_STYLE)
manconf_parse(&conf, conf_file, defpaths, auxpaths);
/* man(1): Resolve each name individually. */
@@ -826,6 +827,7 @@ process_onefile(struct mparse *mp, struct manpage *resp, int startdir,
if (outst->use_pager) {
outst->use_pager = 0;
outst->tag_files = term_tag_init(conf->output.outfilename,
+ outst->outtype == OUTT_HTML ? ".html" : "",
conf->output.tagfilename);
if ((conf->output.outfilename != NULL ||
conf->output.tagfilename != NULL) &&
@@ -842,7 +844,7 @@ process_onefile(struct mparse *mp, struct manpage *resp, int startdir,
}
if (resp->form == FORM_SRC)
- parse(mp, fd, resp->file, outst, &conf->output);
+ parse(mp, fd, resp->file, outst, conf);
else {
passthrough(fd, conf->output.synopsisonly);
outst->had_output = 1;
@@ -863,8 +865,9 @@ process_onefile(struct mparse *mp, struct manpage *resp, int startdir,
static void
parse(struct mparse *mp, int fd, const char *file,
- struct outstate *outst, struct manoutput *outconf)
+ struct outstate *outst, struct manconf *conf)
{
+ static struct manpaths basepaths;
static int previous;
struct roff_meta *meta;
@@ -890,7 +893,7 @@ parse(struct mparse *mp, int fd, const char *file,
return;
if (outst->outdata == NULL)
- outdata_alloc(outst, outconf);
+ outdata_alloc(outst, &conf->output);
else if (outst->outtype == OUTT_HTML)
html_reset(outst->outdata);
@@ -947,24 +950,25 @@ parse(struct mparse *mp, int fd, const char *file,
break;
}
}
- if (outconf->tag != NULL && outconf->tag_found == 0 &&
- tag_exists(outconf->tag))
- outconf->tag_found = 1;
- if (mandoc_msg_getmin() < MANDOCERR_STYLE)
- check_xr();
+ if (conf->output.tag != NULL && conf->output.tag_found == 0 &&
+ tag_exists(conf->output.tag))
+ conf->output.tag_found = 1;
+
+ if (mandoc_msg_getmin() < MANDOCERR_STYLE) {
+ if (basepaths.sz == 0)
+ manpath_base(&basepaths);
+ check_xr(&basepaths);
+ } else if (mandoc_msg_getmin() < MANDOCERR_WARNING)
+ check_xr(&conf->manpath);
}
static void
-check_xr(void)
+check_xr(struct manpaths *paths)
{
- static struct manpaths paths;
struct mansearch search;
struct mandoc_xr *xr;
size_t sz;
- if (paths.sz == 0)
- manpath_base(&paths);
-
for (xr = mandoc_xr_get(); xr != NULL; xr = xr->next) {
if (xr->line == -1)
continue;
@@ -973,9 +977,9 @@ check_xr(void)
search.outkey = NULL;
search.argmode = ARG_NAME;
search.firstmatch = 1;
- if (mansearch(&search, &paths, 1, &xr->name, NULL, &sz))
+ if (mansearch(&search, paths, 1, &xr->name, NULL, &sz))
continue;
- if (fs_search(&search, &paths, xr->name, NULL, &sz) != -1)
+ if (fs_search(&search, paths, xr->name, NULL, &sz) != -1)
continue;
if (xr->count == 1)
mandoc_msg(MANDOCERR_XR_BAD, xr->line,
diff --git a/usr.bin/mandoc/man_html.c b/usr.bin/mandoc/man_html.c
index a2a1b4d..3d57bad 100644
--- a/usr.bin/mandoc/man_html.c
+++ b/usr.bin/mandoc/man_html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_html.c,v 1.131 2020/04/04 20:23:06 schwarze Exp $ */
+/* $OpenBSD: man_html.c,v 1.132 2020/10/16 17:22:39 schwarze Exp $ */
/*
* Copyright (c) 2013-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -167,7 +167,12 @@ print_man_node(MAN_ARGS)
if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT)
return;
- html_fillmode(h, n->flags & NODE_NOFILL ? ROFF_nf : ROFF_fi);
+ if ((n->flags & NODE_NOFILL) == 0)
+ html_fillmode(h, ROFF_fi);
+ else if (html_fillmode(h, ROFF_nf) == ROFF_nf &&
+ n->tok != ROFF_fi && n->flags & NODE_LINE &&
+ (n->prev == NULL || n->prev->tok != MAN_YS))
+ print_endline(h);
child = 1;
switch (n->type) {
@@ -251,13 +256,6 @@ print_man_node(MAN_ARGS)
}
if (t != NULL)
print_stagq(h, t);
-
- if (n->flags & NODE_NOFILL && n->tok != MAN_YS &&
- (n->next != NULL && n->next->flags & NODE_LINE)) {
- /* In .nf = <pre>, print even empty lines. */
- h->col++;
- print_endline(h);
- }
}
static void
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 3bf25ad..3755550 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_term.c,v 1.188 2020/03/13 00:31:05 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.189 2021/06/28 19:49:57 schwarze Exp $ */
/*
* Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1019,10 +1019,6 @@ print_man_foot(struct termp *p, const struct roff_meta *meta)
*/
if ( ! p->mdocstyle) {
- if (meta->hasbody) {
- term_vspace(p);
- term_vspace(p);
- }
mandoc_asprintf(&title, "%s(%s)",
meta->title, meta->msec);
} else if (meta->os != NULL) {
@@ -1141,9 +1137,5 @@ print_man_head(struct termp *p, const struct roff_meta *meta)
*/
term_vspace(p);
- if ( ! p->mdocstyle) {
- term_vspace(p);
- term_vspace(p);
- }
free(title);
}
diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c
index 49aa390..fef8909 100644
--- a/usr.bin/mandoc/man_validate.c
+++ b/usr.bin/mandoc/man_validate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_validate.c,v 1.124 2020/04/24 11:58:02 schwarze Exp $ */
+/* $OpenBSD: man_validate.c,v 1.125 2020/10/30 13:24:26 schwarze Exp $ */
/*
* Copyright (c) 2010, 2012-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -322,7 +322,7 @@ post_SH(CHKARGS)
*cp = '_';
if (nc != NULL && nc->type == ROFFT_TEXT &&
strcmp(nc->string, tag) == 0)
- tag_put(NULL, TAG_WEAK, n);
+ tag_put(NULL, TAG_STRONG, n);
else
tag_put(tag, TAG_FALLBACK, n);
free(tag);
diff --git a/usr.bin/mandoc/mandoc.1 b/usr.bin/mandoc/mandoc.1
index 78c5a4c..6df390c 100644
--- a/usr.bin/mandoc/mandoc.1
+++ b/usr.bin/mandoc/mandoc.1
@@ -1,6 +1,6 @@
-.\" $OpenBSD: mandoc.1,v 1.173 2020/09/01 18:24:09 schwarze Exp $
+.\" $OpenBSD: mandoc.1,v 1.178 2021/07/04 15:38:08 schwarze Exp $
.\"
-.\" Copyright (c) 2012, 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2012, 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: September 1 2020 $
+.Dd $Mdocdate: July 4 2021 $
.Dt MANDOC 1
.Os
.Sh NAME
@@ -301,8 +301,8 @@ Format
input files in
.Xr mdoc 7
output style.
-Specifically, this suppresses the two additional blank lines near the
-top and the bottom of each page, and it implies
+This prints the operating system name rather than the page title
+on the right side of the footer line, and it implies
.Fl O Cm indent Ns =5 .
One useful application is for checking that
.Fl T Cm man
@@ -922,14 +922,6 @@ generated by CVS
or
.Ic NetBSD
keyword substitution as conventionally used in these operating systems.
-.It Sy "referenced manual not found"
-.Pq mdoc
-An
-.Ic \&Xr
-macro references a manual page that is not found in the base system.
-The path to look for base system manuals is configurable at compile
-time and defaults to
-.Pa /usr/share/man : /usr/X11R6/man .
.El
.Ss Style suggestions
.Bl -ohang
@@ -1016,6 +1008,35 @@ list contains two consecutive
entries describing the same
.Ic \&Er
number.
+.It Sy "referenced manual not found"
+.Pq mdoc
+An
+.Ic \&Xr
+macro references a manual page that was not found.
+When running with
+.Fl W Cm base ,
+the search is restricted to the base system, by default to
+.Pa /usr/share/man : Ns Pa /usr/X11R6/man .
+This path can be configured at compile time using the
+.Dv MANPATH_BASE
+preprocessor macro.
+When running with
+.Fl W Cm style ,
+the search is done along the full search path as described in the
+.Xr man 1
+manual page, respecting the
+.Fl m
+and
+.Fl M
+command line options, the
+.Ev MANPATH
+environment variable, the
+.Xr man.conf 5
+file and falling back to the default of
+.Pa /usr/share/man : Ns Pa /usr/X11R6/man : Ns Pa /usr/local/man ,
+also configurable at compile time using the
+.Dv MANPATH_DEFAULT
+preprocessor macro.
.It Sy "trailing delimiter"
.Pq mdoc
The last argument of an
@@ -1045,6 +1066,9 @@ An
request occurs even though the document already switched to no-fill mode
and did not switch back to fill mode yet.
It has no effect.
+.It Sy "input text line longer than 80 bytes"
+Consider breaking the input text line
+at one of the blank characters before column 80.
.It Sy "verbatim \(dq--\(dq, maybe consider using \e(em"
.Pq mdoc
Even though the ASCII output device renders an em-dash as
@@ -2290,6 +2314,26 @@ or
macro or of an undefined macro.
The macro is ignored, and its arguments are handled
as if they were a text line.
+.It Sy "skipping tbl in -Tman mode"
+.Pq mdoc , tbl
+An input file contains the
+.Ic \&TS
+macro.
+This message is only generated in
+.Fl T Cm man
+output mode, where
+.Xr tbl 7
+input is not supported.
+.It Sy "skipping eqn in -Tman mode"
+.Pq mdoc , eqn
+An input file contains the
+.Ic \&EQ
+macro.
+This message is only generated in
+.Fl T Cm man
+output mode, where
+.Xr eqn 7
+input is not supported.
.El
.Ss Bad command line arguments
.Bl -ohang
diff --git a/usr.bin/mandoc/mandoc.c b/usr.bin/mandoc/mandoc.c
index 0b2d301..265393d 100644
--- a/usr.bin/mandoc/mandoc.c
+++ b/usr.bin/mandoc/mandoc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mandoc.c,v 1.85 2020/01/19 16:16:32 schwarze Exp $ */
+/* $OpenBSD: mandoc.c,v 1.86 2020/10/24 22:52:34 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
@@ -201,7 +201,18 @@ mandoc_escape(const char **end, const char **start, int *sz)
case 'O':
case 'V':
case 'Y':
- gly = (*start)[-1] == 'f' ? ESCAPE_FONT : ESCAPE_IGNORE;
+ case '*':
+ switch ((*start)[-1]) {
+ case 'f':
+ gly = ESCAPE_FONT;
+ break;
+ case '*':
+ gly = ESCAPE_DEVICE;
+ break;
+ default:
+ gly = ESCAPE_IGNORE;
+ break;
+ }
switch (**start) {
case '(':
if ((*start)[-1] == 'O')
@@ -236,13 +247,6 @@ mandoc_escape(const char **end, const char **start, int *sz)
break;
}
break;
- case '*':
- if (strncmp(*start, "(.T", 3) != 0)
- abort();
- gly = ESCAPE_DEVICE;
- *start = ++*end;
- *sz = 2;
- break;
/*
* These escapes are of the form \X'Y', where 'X' is the trigger
@@ -457,6 +461,9 @@ mandoc_escape(const char **end, const char **start, int *sz)
+ 1 == *sz)
gly = ESCAPE_UNICODE;
break;
+ case ESCAPE_DEVICE:
+ assert(*sz == 2 && (*start)[0] == '.' && (*start)[1] == 'T');
+ break;
default:
break;
}
diff --git a/usr.bin/mandoc/mandoc.css b/usr.bin/mandoc/mandoc.css
index 3c4ea18..2b19ba6 100644
--- a/usr.bin/mandoc/mandoc.css
+++ b/usr.bin/mandoc/mandoc.css
@@ -1,4 +1,4 @@
-/* $OpenBSD: mandoc.css,v 1.33 2019/06/02 16:50:46 schwarze Exp $ */
+/* $OpenBSD: mandoc.css,v 1.35 2021/03/30 19:23:50 schwarze Exp $ */
/*
* Standard style sheet for mandoc(1) -Thtml and man.cgi(8).
*
@@ -31,6 +31,7 @@ td { vertical-align: top;
ul, ol, dl { margin-top: 0em;
margin-bottom: 0em; }
li, dt { margin-top: 1em; }
+pre { font-family: inherit; }
.permalink { border-bottom: thin dotted;
color: inherit;
@@ -135,12 +136,12 @@ h2.Ss { margin-top: 1.2em;
vertical-align: top; }
.Bl-tag > dd {
clear: right;
+ column-count: 1; /* Force block formatting context. */
width: 100%;
margin-top: 0em;
margin-left: 0em;
margin-bottom: 0.6em;
- vertical-align: top;
- overflow: auto; }
+ vertical-align: top; }
.Bl-compact { margin-top: 0em; }
.Bl-compact > dd {
margin-bottom: 0em; }
diff --git a/usr.bin/mandoc/mandoc.h b/usr.bin/mandoc/mandoc.h
index 3d1a3f9..1aef8c2 100644
--- a/usr.bin/mandoc/mandoc.h
+++ b/usr.bin/mandoc/mandoc.h
@@ -1,6 +1,6 @@
-/* $OpenBSD: mandoc.h,v 1.211 2020/09/01 18:24:09 schwarze Exp $ */
+/* $OpenBSD: mandoc.h,v 1.214 2021/07/04 15:38:08 schwarze Exp $ */
/*
- * Copyright (c) 2012-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2012-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -54,7 +54,6 @@ enum mandocerr {
MANDOCERR_ARCH_BAD, /* unknown architecture: Dt ... arch */
MANDOCERR_OS_ARG, /* operating system explicitly specified: Os ... */
MANDOCERR_RCS_MISSING, /* RCS id missing */
- MANDOCERR_XR_BAD, /* referenced manual not found: Xr name sec */
MANDOCERR_STYLE, /* ===== start of style suggestions ===== */
@@ -68,10 +67,12 @@ enum mandocerr {
MANDOCERR_BX, /* consider using OS macro: macro */
MANDOCERR_ER_ORDER, /* errnos out of order: Er ... */
MANDOCERR_ER_REP, /* duplicate errno: Er ... */
+ MANDOCERR_XR_BAD, /* referenced manual not found: Xr name sec */
MANDOCERR_DELIM, /* trailing delimiter: macro ... */
MANDOCERR_DELIM_NB, /* no blank before trailing delimiter: macro ... */
MANDOCERR_FI_SKIP, /* fill mode already enabled, skipping: fi */
MANDOCERR_NF_SKIP, /* fill mode already disabled, skipping: nf */
+ MANDOCERR_TEXT_LONG, /* input text line longer than 80 bytes */
MANDOCERR_DASHDASH, /* verbatim "--", maybe consider using \(em */
MANDOCERR_FUNC, /* function name without markup: name() */
MANDOCERR_SPACE_EOL, /* whitespace at end of input line */
@@ -244,6 +245,8 @@ enum mandocerr {
MANDOCERR_TBLOPT_EQN, /* eqn delim option in tbl: arg */
MANDOCERR_TBLLAYOUT_MOD, /* unsupported tbl layout modifier: m */
MANDOCERR_TBLMACRO, /* ignoring macro in table: macro */
+ MANDOCERR_TBL_TMAN, /* skipping tbl in -Tman mode */
+ MANDOCERR_EQN_TMAN, /* skipping eqn in -Tman mode */
MANDOCERR_BADARG, /* ===== start of bad invocations ===== */
diff --git a/usr.bin/mandoc/mandoc_msg.c b/usr.bin/mandoc/mandoc_msg.c
index d40b7e5..26306da 100644
--- a/usr.bin/mandoc/mandoc_msg.c
+++ b/usr.bin/mandoc/mandoc_msg.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: mandoc_msg.c,v 1.10 2020/09/01 18:24:10 schwarze Exp $ */
+/* $OpenBSD: mandoc_msg.c,v 1.13 2021/07/04 15:38:09 schwarze Exp $ */
/*
- * Copyright (c) 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -53,7 +53,6 @@ static const char *const type_message[MANDOCERR_MAX] = {
"unknown architecture",
"operating system explicitly specified",
"RCS id missing",
- "referenced manual not found",
"generic style suggestion",
@@ -67,10 +66,12 @@ static const char *const type_message[MANDOCERR_MAX] = {
"consider using OS macro",
"errnos out of order",
"duplicate errno",
+ "referenced manual not found",
"trailing delimiter",
"no blank before trailing delimiter",
"fill mode already enabled, skipping",
"fill mode already disabled, skipping",
+ "input text line longer than 80 bytes",
"verbatim \"--\", maybe consider using \\(em",
"function name without markup",
"whitespace at end of input line",
@@ -242,6 +243,8 @@ static const char *const type_message[MANDOCERR_MAX] = {
"eqn delim option in tbl",
"unsupported tbl layout modifier",
"ignoring macro in table",
+ "skipping tbl in -Tman mode",
+ "skipping eqn in -Tman mode",
/* bad command line arguments */
NULL,
diff --git a/usr.bin/mandoc/mdoc_html.c b/usr.bin/mandoc/mdoc_html.c
index fcff005..e6dbfbe 100644
--- a/usr.bin/mandoc/mdoc_html.c
+++ b/usr.bin/mandoc/mdoc_html.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: mdoc_html.c,v 1.215 2020/04/19 15:15:54 schwarze Exp $ */
+/* $OpenBSD: mdoc_html.c,v 1.217 2021/03/30 19:23:50 schwarze Exp $ */
/*
- * Copyright (c) 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014-2021 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -347,12 +347,11 @@ print_mdoc_node(MDOC_ARGS)
if (n->type == ROFFT_COMMENT || n->flags & NODE_NOPRT)
return;
- if (n->flags & NODE_NOFILL) {
- html_fillmode(h, ROFF_nf);
- if (n->flags & NODE_LINE)
- print_endline(h);
- } else
+ if ((n->flags & NODE_NOFILL) == 0)
html_fillmode(h, ROFF_fi);
+ else if (html_fillmode(h, ROFF_nf) == ROFF_nf &&
+ n->tok != ROFF_fi && n->flags & NODE_LINE)
+ print_endline(h);
child = 1;
n->flags &= ~NODE_ENDED;
@@ -929,7 +928,7 @@ mdoc_sx_pre(MDOC_ARGS)
static int
mdoc_bd_pre(MDOC_ARGS)
{
- char buf[16];
+ char buf[20];
struct roff_node *nn;
int comp;
@@ -966,6 +965,9 @@ mdoc_bd_pre(MDOC_ARGS)
strcmp(n->norm->Bd.offs, "left") != 0)
(void)strlcat(buf, " Bd-indent", sizeof(buf));
+ if (n->norm->Bd.type == DISP_literal)
+ (void)strlcat(buf, " Li", sizeof(buf));
+
print_otag_id(h, TAG_DIV, buf, n);
return 1;
}
diff --git a/usr.bin/mandoc/mdoc_man.c b/usr.bin/mandoc/mdoc_man.c
index 25d59a5..a2baf55 100644
--- a/usr.bin/mandoc/mdoc_man.c
+++ b/usr.bin/mandoc/mdoc_man.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: mdoc_man.c,v 1.134 2020/02/27 01:25:57 schwarze Exp $ */
+/* $OpenBSD: mdoc_man.c,v 1.135 2021/07/04 15:38:09 schwarze Exp $ */
/*
- * Copyright (c) 2011-2020 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -658,7 +658,20 @@ print_node(DECL_ARGS)
do_sub = 1;
n->flags &= ~NODE_ENDED;
- if (n->type == ROFFT_TEXT) {
+ switch (n->type) {
+ case ROFFT_EQN:
+ case ROFFT_TBL:
+ mandoc_msg(n->type == ROFFT_EQN ? MANDOCERR_EQN_TMAN :
+ MANDOCERR_TBL_TMAN, n->line, n->pos, NULL);
+ outflags |= MMAN_PP | MMAN_sp | MMAN_nl;
+ print_word("The");
+ print_line(".B \\-T man", MMAN_nl);
+ print_word("output mode does not support");
+ print_word(n->type == ROFFT_EQN ? "eqn(7)" : "tbl(7)");
+ print_word("input.");
+ outflags |= MMAN_PP | MMAN_sp | MMAN_nl;
+ return;
+ case ROFFT_TEXT:
/*
* Make sure that we don't happen to start with a
* control character at the start of a line.
@@ -678,19 +691,18 @@ print_node(DECL_ARGS)
outflags &= ~(MMAN_spc | MMAN_spc_force);
else if (outflags & MMAN_Sm)
outflags |= MMAN_spc;
- } else if (n->tok < ROFF_MAX) {
- (*roff_man_acts[n->tok])(meta, n);
- return;
- } else {
- /*
- * Conditionally run the pre-node action handler for a
- * node.
- */
+ break;
+ default:
+ if (n->tok < ROFF_MAX) {
+ (*roff_man_acts[n->tok])(meta, n);
+ return;
+ }
act = mdoc_man_act(n->tok);
cond = act->cond == NULL || (*act->cond)(meta, n);
if (cond && act->pre != NULL &&
(n->end == ENDBODY_NOT || n->child != NULL))
do_sub = (*act->pre)(meta, n);
+ break;
}
/*
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c
index 34668bf..e27de2e 100644
--- a/usr.bin/mandoc/mdoc_validate.c
+++ b/usr.bin/mandoc/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_validate.c,v 1.302 2020/04/26 21:29:45 schwarze Exp $ */
+/* $OpenBSD: mdoc_validate.c,v 1.303 2020/10/30 13:24:26 schwarze Exp $ */
/*
* Copyright (c) 2010-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -2602,7 +2602,7 @@ post_section(POST_ARGS)
if ((nch = n->child) != NULL &&
nch->type == ROFFT_TEXT &&
strcmp(nch->string, tag) == 0)
- tag_put(NULL, TAG_WEAK, n);
+ tag_put(NULL, TAG_STRONG, n);
else
tag_put(tag, TAG_FALLBACK, n);
free(tag);
diff --git a/usr.bin/mandoc/read.c b/usr.bin/mandoc/read.c
index a6a25de..223dc82 100644
--- a/usr.bin/mandoc/read.c
+++ b/usr.bin/mandoc/read.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read.c,v 1.190 2020/04/24 11:58:02 schwarze Exp $ */
+/* $OpenBSD: read.c,v 1.191 2021/06/27 17:57:13 schwarze Exp $ */
/*
* Copyright (c) 2010-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -152,6 +152,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
struct buf *firstln, *lastln, *thisln, *loop;
char *cp;
size_t pos; /* byte number in the ln buffer */
+ size_t spos; /* at the start of the current line parse */
int line_result, result;
int of;
int lnn; /* line number in the real file */
@@ -178,6 +179,7 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
curp->filenc & MPARSE_LATIN1)
curp->filenc = preconv_cue(&blk, i);
}
+ spos = pos;
while (i < blk.sz && (start || blk.buf[i] != '\0')) {
@@ -277,7 +279,8 @@ mparse_buf_r(struct mparse *curp, struct buf blk, size_t i, int start)
of = 0;
rerun:
- line_result = roff_parseln(curp->roff, curp->line, &ln, &of);
+ line_result = roff_parseln(curp->roff, curp->line,
+ &ln, &of, start && spos == 0 ? pos : 0);
/* Process options. */
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index 07c977d..484664f 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: roff.c,v 1.248 2020/08/27 12:58:00 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.249 2021/06/27 17:57:13 schwarze Exp $ */
/*
* Copyright (c) 2010-2015, 2017-2020 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
@@ -1822,7 +1822,7 @@ roff_parsetext(struct roff *r, struct buf *buf, int pos, int *offs)
}
int
-roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs)
+roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs, size_t len)
{
enum roff_tok t;
int e;
@@ -1833,6 +1833,14 @@ roff_parseln(struct roff *r, int ln, struct buf *buf, int *offs)
ppos = pos = *offs;
+ if (len > 80 && r->tbl == NULL && r->eqn == NULL &&
+ (r->man->flags & ROFF_NOFILL) == 0 &&
+ strchr(" .\\", buf->buf[pos]) == NULL &&
+ buf->buf[pos] != r->control &&
+ strcspn(buf->buf, " ") < 80)
+ mandoc_msg(MANDOCERR_TEXT_LONG, ln, (int)len - 1,
+ "%.20s...", buf->buf + pos);
+
/* Handle in-line equation delimiters. */
if (r->tbl == NULL &&
diff --git a/usr.bin/mandoc/tbl_data.c b/usr.bin/mandoc/tbl_data.c
index b2556d9..93039de 100644
--- a/usr.bin/mandoc/tbl_data.c
+++ b/usr.bin/mandoc/tbl_data.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: tbl_data.c,v 1.40 2020/01/11 20:48:13 schwarze Exp $ */
+/* $OpenBSD: tbl_data.c,v 1.42 2021/05/18 13:22:37 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011,2015,2017,2018,2019 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011,2015,2017-2019,2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -44,6 +44,7 @@ getdata(struct tbl_node *tbl, struct tbl_span *dp,
struct tbl_dat *dat, *pdat;
struct tbl_cell *cp;
struct tbl_span *pdp;
+ const char *ccp;
int sv;
/*
@@ -52,8 +53,11 @@ getdata(struct tbl_node *tbl, struct tbl_span *dp,
*/
sv = *pos;
- while (p[*pos] != '\0' && p[*pos] != tbl->opts.tab)
- (*pos)++;
+ ccp = p + sv;
+ while (*ccp != '\0' && *ccp != tbl->opts.tab)
+ if (*ccp++ == '\\')
+ mandoc_escape(&ccp, NULL, NULL);
+ *pos = ccp - p;
/* Advance to the next layout cell, skipping spanners. */
@@ -242,10 +246,11 @@ tbl_data(struct tbl_node *tbl, int ln, const char *p, int pos)
struct tbl_cell *cp;
struct tbl_span *sp;
- rp = (sp = tbl->last_span) == NULL ? tbl->first_row :
- sp->pos == TBL_SPAN_DATA && sp->layout->next != NULL ?
- sp->layout->next : sp->layout;
-
+ for (sp = tbl->last_span; sp != NULL; sp = sp->prev)
+ if (sp->pos == TBL_SPAN_DATA)
+ break;
+ rp = sp == NULL ? tbl->first_row :
+ sp->layout->next == NULL ? sp->layout : sp->layout->next;
assert(rp != NULL);
if (p[1] == '\0') {
diff --git a/usr.bin/mandoc/tbl_html.c b/usr.bin/mandoc/tbl_html.c
index cbc4bfa..4dda78a 100644
--- a/usr.bin/mandoc/tbl_html.c
+++ b/usr.bin/mandoc/tbl_html.c
@@ -1,7 +1,7 @@
-/* $OpenBSD: tbl_html.c,v 1.28 2019/03/17 18:20:07 schwarze Exp $ */
+/* $OpenBSD: tbl_html.c,v 1.30 2021/05/16 23:16:22 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014, 2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014,2015,2017,2018,2021 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -117,6 +117,7 @@ print_tbl(struct html *h, const struct tbl_span *sp)
const char *hspans, *vspans, *halign, *valign;
const char *bborder, *lborder, *rborder;
char hbuf[4], vbuf[4];
+ enum mandoc_esc save_font;
int i;
if (h->tblt == NULL)
@@ -238,8 +239,17 @@ print_tbl(struct html *h, const struct tbl_span *sp)
"vertical-align", valign,
"text-align", halign,
"border-right-style", rborder);
- if (dp->string != NULL)
+ if (dp->string != NULL) {
+ save_font = h->metac;
+ if (dp->layout->flags & TBL_CELL_BOLD)
+ html_setfont(h, ESCAPE_FONTBOLD);
+ else if (dp->layout->flags & TBL_CELL_ITALIC)
+ html_setfont(h, ESCAPE_FONTITALIC);
+ if (dp->layout->pos == TBL_CELL_LONG)
+ print_text(h, "\\[u2003]"); /* em space */
print_text(h, dp->string);
+ html_setfont(h, save_font);
+ }
}
print_tagq(h, tt);
diff --git a/usr.bin/mandoc/tbl_term.c b/usr.bin/mandoc/tbl_term.c
index 238bf7a..8f2d67c 100644
--- a/usr.bin/mandoc/tbl_term.c
+++ b/usr.bin/mandoc/tbl_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tbl_term.c,v 1.61 2020/01/11 16:24:33 schwarze Exp $ */
+/* $OpenBSD: tbl_term.c,v 1.62 2020/10/25 18:21:07 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2020 Ingo Schwarze <schwarze@openbsd.org>
@@ -188,17 +188,6 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
tblcalc(&tp->tbl, sp, tp->tcol->offset, tp->tcol->rmargin);
- /* Tables leak .ta settings to subsequent text. */
-
- term_tab_set(tp, NULL);
- coloff = sp->opts->opts & (TBL_OPT_BOX | TBL_OPT_DBOX) ||
- sp->opts->lvert;
- for (ic = 0; ic < sp->opts->cols; ic++) {
- coloff += tp->tbl.cols[ic].width;
- term_tab_iset(coloff);
- coloff += tp->tbl.cols[ic].spacing;
- }
-
/* Center the table as a whole. */
offset = tp->tcol->offset;
diff --git a/usr.bin/mandoc/term_tag.c b/usr.bin/mandoc/term_tag.c
index 86ad01e..2d44650 100644
--- a/usr.bin/mandoc/term_tag.c
+++ b/usr.bin/mandoc/term_tag.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: term_tag.c,v 1.5 2020/07/21 15:08:49 schwarze Exp $ */
+/* $OpenBSD: term_tag.c,v 1.6 2021/02/19 19:49:49 kn Exp $ */
/*
* Copyright (c) 2015,2016,2018,2019,2020 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -45,7 +45,8 @@ static struct tag_files tag_files;
* but for simplicity, create it anyway.
*/
struct tag_files *
-term_tag_init(const char *outfilename, const char *tagfilename)
+term_tag_init(const char *outfilename, const char *suffix,
+ const char *tagfilename)
{
struct sigaction sa;
int ofd; /* In /tmp/, dup(2)ed to stdout. */
@@ -83,9 +84,9 @@ term_tag_init(const char *outfilename, const char *tagfilename)
/* Create both temporary output files. */
if (outfilename == NULL) {
- (void)strlcpy(tag_files.ofn, "/tmp/man.XXXXXXXXXX",
- sizeof(tag_files.ofn));
- if ((ofd = mkstemp(tag_files.ofn)) == -1) {
+ (void)snprintf(tag_files.ofn, sizeof(tag_files.ofn),
+ "/tmp/man.XXXXXXXXXX%s", suffix);
+ if ((ofd = mkstemps(tag_files.ofn, strlen(suffix))) == -1) {
mandoc_msg(MANDOCERR_MKSTEMP, 0, 0,
"%s: %s", tag_files.ofn, strerror(errno));
goto fail;
diff --git a/usr.bin/mandoc/term_tag.h b/usr.bin/mandoc/term_tag.h
index fc692d7..8809df2 100644
--- a/usr.bin/mandoc/term_tag.h
+++ b/usr.bin/mandoc/term_tag.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: term_tag.h,v 1.3 2020/07/21 15:08:49 schwarze Exp $ */
+/* $OpenBSD: term_tag.h,v 1.4 2021/02/19 19:49:49 kn Exp $ */
/*
* Copyright (c) 2015, 2018, 2019, 2020 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -28,7 +28,7 @@ struct tag_files {
};
-struct tag_files *term_tag_init(const char *, const char *);
+struct tag_files *term_tag_init(const char *, const char *, const char *);
void term_tag_write(struct roff_node *, size_t);
int term_tag_close(void);
void term_tag_unlink(void);
diff --git a/usr.bin/nc/CVS/Entries b/usr.bin/nc/CVS/Entries
index 86fb43f..ed809bd 100644
--- a/usr.bin/nc/CVS/Entries
+++ b/usr.bin/nc/CVS/Entries
@@ -1,7 +1,7 @@
-/Makefile/1.7/Fri Sep 11 21:07:01 2015//
-/atomicio.c/1.11/Tue Dec 4 02:24:47 2012//
-/atomicio.h/1.2/Fri Sep 7 14:50:44 2007//
-/nc.1/1.95/Wed Feb 12 14:46:36 2020//
-/netcat.c/1.217/Wed Feb 12 14:46:36 2020//
-/socks.c/1.30/Mon Nov 4 17:33:28 2019//
+/Makefile/1.7/Mon Oct 19 10:36:43 2020//
+/atomicio.c/1.11/Mon Oct 19 10:36:43 2020//
+/atomicio.h/1.2/Mon Oct 19 10:36:43 2020//
+/nc.1/1.96/Wed Jul 14 10:53:32 2021//
+/netcat.c/1.218/Result of merge//
+/socks.c/1.30/Mon Oct 19 10:36:43 2020//
D
diff --git a/usr.bin/nc/CVS/Entries.Log b/usr.bin/nc/CVS/Entries.Log
new file mode 100644
index 0000000..9895b9d
--- /dev/null
+++ b/usr.bin/nc/CVS/Entries.Log
@@ -0,0 +1,4 @@
+A D/data////
+A D/scripts////
+R D/scripts////
+R D/data////
diff --git a/usr.bin/nc/nc.1 b/usr.bin/nc/nc.1
index fff5857..1473359 100644
--- a/usr.bin/nc/nc.1
+++ b/usr.bin/nc/nc.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: nc.1,v 1.95 2020/02/12 14:46:36 schwarze Exp $
+.\" $OpenBSD: nc.1,v 1.96 2021/03/31 20:41:35 jmc Exp $
.\"
.\" Copyright (c) 1996 David Sacerdote
.\" All rights reserved.
@@ -25,7 +25,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: February 12 2020 $
+.Dd $Mdocdate: March 31 2021 $
.Dt NC 1
.Os
.Sh NAME
@@ -414,7 +414,7 @@ On a second console
.Pq or a second machine ,
connect to the machine and port being listened on:
.Pp
-.Dl $ nc 127.0.0.1 1234
+.Dl $ nc -N 127.0.0.1 1234
.Pp
There should now be a connection between the ports.
Anything typed at the second console will be concatenated to the first,
@@ -427,7 +427,10 @@ and which side is being used as a
.Sq client .
The connection may be terminated using an
.Dv EOF
-.Pq Sq ^D .
+.Pq Sq ^D ,
+as the
+.Fl N
+flag was given.
.Sh DATA TRANSFER
The example in the previous section can be expanded to build a
basic data transfer model.
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
index f052766..489fe49 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.217 2020/02/12 14:46:36 schwarze Exp $ */
+/* $OpenBSD: netcat.c,v 1.218 2021/07/12 15:09:20 beck Exp $ */
/*
* Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
* Copyright (c) 2015 Bob Beck. All rights reserved.
@@ -374,13 +374,13 @@ main(int argc, char *argv[])
if (usetls) {
if (Cflag && unveil(Cflag, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", Cflag);
if (unveil(Rflag, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", Rflag);
if (Kflag && unveil(Kflag, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", Kflag);
if (oflag && unveil(oflag, "r") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", oflag);
} else if (family == AF_UNIX && uflag && lflag && !kflag) {
/*
* After recvfrom(2) from client, the server connects
@@ -390,20 +390,20 @@ main(int argc, char *argv[])
} else {
if (family == AF_UNIX) {
if (unveil(host, "rwc") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", host);
if (uflag && !kflag) {
if (sflag) {
if (unveil(sflag, "rwc") == -1)
- err(1, "unveil");
+ err(1, "unveil %s", sflag);
} else {
if (unveil("/tmp", "rwc") == -1)
- err(1, "unveil");
+ err(1, "unveil /tmp");
}
}
} else {
/* no filesystem visibility */
if (unveil("/", "") == -1)
- err(1, "unveil");
+ err(1, "unveil /");
}
}
diff --git a/usr.bin/patch/CVS/Entries b/usr.bin/patch/CVS/Entries
index aab1841..123cecf 100644
--- a/usr.bin/patch/CVS/Entries
+++ b/usr.bin/patch/CVS/Entries
@@ -1,16 +1,16 @@
-/Makefile/1.5/Fri Oct 16 07:33:47 2015//
-/backupfile.c/1.21/Tue Nov 26 13:19:07 2013//
-/backupfile.h/1.6/Mon Jul 28 18:35:36 2003//
-/common.h/1.30/Mon Dec 2 22:17:32 2019//
-/ed.c/1.4/Mon Dec 2 22:17:32 2019//
-/ed.h/1.1/Fri Oct 16 07:33:47 2015//
-/inp.c/1.49/Fri Jun 28 13:35:02 2019//
-/inp.h/1.8/Fri Aug 15 08:00:51 2003//
-/mkpath.c/1.4/Tue May 20 01:25:23 2014//
-/patch.1/1.32/Fri Jun 22 15:37:15 2018//
/patch.c/1.69/Mon Dec 2 22:17:32 2019//
-/pch.c/1.62/Mon Dec 2 22:23:19 2019//
-/pch.h/1.13/Wed Dec 11 20:10:17 2019//
-/util.c/1.45/Mon Dec 2 22:17:32 2019//
-/util.h/1.18/Sat Aug 17 14:25:06 2019//
+/Makefile/1.5/Mon Oct 19 10:36:43 2020//
+/backupfile.c/1.22/Result of merge+Wed Jul 14 10:55:46 2021//
+/backupfile.h/1.6/Mon Oct 19 10:36:43 2020//
+/common.h/1.30/Mon Oct 19 10:36:43 2020//
+/ed.c/1.4/Mon Oct 19 10:36:43 2020//
+/ed.h/1.1/Mon Oct 19 10:36:43 2020//
+/inp.c/1.49/Mon Oct 19 10:36:43 2020//
+/inp.h/1.8/Mon Oct 19 10:36:43 2020//
+/mkpath.c/1.4/Mon Oct 19 10:36:43 2020//
+/patch.1/1.32/Mon Oct 19 10:36:43 2020//
+/pch.c/1.62/Mon Oct 19 10:36:43 2020//
+/pch.h/1.13/Mon Oct 19 10:36:43 2020//
+/util.c/1.45/Mon Oct 19 10:36:43 2020//
+/util.h/1.18/Mon Oct 19 10:36:43 2020//
D
diff --git a/usr.bin/patch/backupfile.c b/usr.bin/patch/backupfile.c
index 243d00e..fc05e48 100644
--- a/usr.bin/patch/backupfile.c
+++ b/usr.bin/patch/backupfile.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: backupfile.c,v 1.21 2013/11/26 13:19:07 deraadt Exp $ */
+/* $OpenBSD: backupfile.c,v 1.22 2020/10/12 13:58:27 naddy Exp $ */
/*
* backupfile.c -- make Emacs style backup file names Copyright (C) 1990 Free
@@ -53,22 +53,32 @@ static void invalid_arg(const char *, const char *, int);
char *
find_backup_file_name(const char *file)
{
- char *path, *base_versions;
+ char *dir, *base_versions, *tmp_file;
int highest_backup;
if (backup_type == simple)
return concat(file, simple_backup_suffix);
- path = strdup(file);
- if (path == NULL)
+ tmp_file = strdup(file);
+ if (tmp_file == NULL)
return NULL;
- base_versions = concat(basename(path), ".~");
- if (base_versions == NULL) {
- free(path);
+ base_versions = concat(basename(tmp_file), ".~");
+ free(tmp_file);
+ if (base_versions == NULL)
+ return NULL;
+ tmp_file = strdup(file);
+ if (tmp_file == NULL) {
+ free(base_versions);
+ return NULL;
+ }
+ dir = dirname(tmp_file);
+ if (dir == NULL) {
+ free(base_versions);
+ free(tmp_file);
return NULL;
}
- highest_backup = max_backup_version(base_versions, dirname(path));
+ highest_backup = max_backup_version(base_versions, dir);
free(base_versions);
- free(path);
+ free(tmp_file);
if (backup_type == numbered_existing && highest_backup == 0)
return concat(file, simple_backup_suffix);
return make_version_name(file, highest_backup + 1);
diff --git a/usr.bin/signify/CVS/Entries b/usr.bin/signify/CVS/Entries
index c9caa83..3ef28ae 100644
--- a/usr.bin/signify/CVS/Entries
+++ b/usr.bin/signify/CVS/Entries
@@ -1,16 +1,16 @@
-/Makefile/1.12/Sun May 28 21:59:56 2017//
/crypto_api.c/1.1/Wed Jan 8 03:59:46 2014//
-/crypto_api.h/1.2/Tue Jan 16 21:42:40 2018//
-/fe25519.c/1.1/Tue Jul 22 00:41:19 2014//
-/fe25519.h/1.1/Tue Jul 22 00:41:19 2014//
-/ge25519.h/1.2/Mon Feb 16 18:26:26 2015//
-/ge25519_base.data/1.1/Tue Jul 22 00:41:19 2014//
-/mod_ed25519.c/1.1/Wed Jan 8 05:00:01 2014//
-/mod_ge25519.c/1.2/Wed Jan 8 05:51:35 2014//
-/sc25519.c/1.1/Tue Jul 22 00:41:19 2014//
-/sc25519.h/1.1/Tue Jul 22 00:41:19 2014//
-/signify.1/1.51/Mon Aug 31 16:08:28 2020//
/signify.c/1.135/Tue Jan 21 12:13:21 2020//
-/signify.h/1.2/Sat Mar 23 07:10:06 2019//
/zsig.c/1.18/Sun Dec 22 06:37:25 2019//
+/Makefile/1.12/Mon Oct 19 10:36:43 2020//
+/crypto_api.h/1.2/Mon Oct 19 10:36:43 2020//
+/fe25519.c/1.1/Mon Oct 19 10:36:43 2020//
+/fe25519.h/1.1/Mon Oct 19 10:36:43 2020//
+/ge25519.h/1.2/Mon Oct 19 10:36:43 2020//
+/ge25519_base.data/1.1/Mon Oct 19 10:36:43 2020//
+/mod_ed25519.c/1.1/Mon Oct 19 10:36:43 2020//
+/mod_ge25519.c/1.2/Mon Oct 19 10:36:43 2020//
+/sc25519.c/1.1/Mon Oct 19 10:36:43 2020//
+/sc25519.h/1.1/Mon Oct 19 10:36:43 2020//
+/signify.1/1.51/Mon Oct 19 10:36:43 2020//
+/signify.h/1.2/Mon Oct 19 10:36:43 2020//
D