summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pkg/openbsd/gen.rc8
-rw-r--r--pkg/openbsd/include/grp.h1
-rw-r--r--pkg/openbsd/include/pwd.h1
-rw-r--r--pkg/openbsd/patch/0001-fts-Avoid-d_namlen.patch19
-rw-r--r--pkg/openbsd/patch/0002-fts-Add-some-includes.patch8
-rw-r--r--pkg/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch10
-rw-r--r--pkg/openbsd/patch/0004-pax-Add-some-includes.patch83
-rw-r--r--pkg/openbsd/patch/0005-tar-Default-to-stdin.patch26
-rw-r--r--pkg/openbsd/patch/0006-yacc-Add-some-includes.patch6
-rw-r--r--pkg/openbsd/patch/0007-diff-Add-missing-includes.patch8
-rw-r--r--pkg/openbsd/patch/0008-patch-Add-missing-includes.patch8
-rw-r--r--pkg/openbsd/patch/0009-patch-Avoid-d_namlen.patch6
-rw-r--r--pkg/openbsd/patch/0010-patch-Fix-with-musl-s-basename-dirname.patch6
-rw-r--r--pkg/openbsd/patch/0011-pax-Fix-GNU-long-name-handling-with-short-read.patch26
-rw-r--r--pkg/openbsd/patch/0012-pax-Support-xz-compression-with-J-flag.patch20
-rw-r--r--pkg/openbsd/patch/0013-setprogname-Explicitly-discard-const-qualifier.patch6
-rw-r--r--pkg/openbsd/patch/0014-readpassphrase-Support-systems-without-VSTATUS-and-T.patch6
-rw-r--r--pkg/openbsd/patch/0015-Remove-getpass-definition.patch8
-rw-r--r--pkg/openbsd/patch/0016-doas-Apply-some-patches-from-OpenBSD-CVS.patch317
-rw-r--r--pkg/openbsd/patch/0016-doas-Port-to-linux-musl.patch (renamed from pkg/openbsd/patch/0017-doas-Port-to-linux-musl.patch)28
-rw-r--r--pkg/openbsd/patch/0017-pwcache-Don-t-use-fixed-buffer-sizes.patch96
-rw-r--r--pkg/openbsd/patch/0018-Use-explicit_bzero-reallocarray-instead-of-recalloca.patch42
-rw-r--r--pkg/openbsd/rev2
-rw-r--r--pkg/openbsd/sha2564
-rw-r--r--pkg/openbsd/url4
25 files changed, 296 insertions, 453 deletions
diff --git a/pkg/openbsd/gen.rc b/pkg/openbsd/gen.rc
index f7a94adb..d8d1caf9 100644
--- a/pkg/openbsd/gen.rc
+++ b/pkg/openbsd/gen.rc
@@ -8,18 +8,18 @@ cflags\
# Link arc4random.c to '$outdir' so that it doesn't include the local
# arc4random.h
build '$outdir'/lib/libc/crypt/arc4random.c copy '$srcdir'/lib/libc/crypt/arc4random.c
-build '$outdir'/lib/libc/crypt/arc4random.h copy '$srcdir'/lib/libcrypto/crypto/arc4random_linux.h
+build '$outdir'/lib/libc/crypt/arc4random.h copy '$srcdir'/lib/libcrypto/arc4random/arc4random_linux.h
build '$outdir'/lib/libc/crypt/chacha_private.h copy '$srcdir'/lib/libc/crypt/chacha_private.h
cc '$outdir'/lib/libc/crypt/arc4random.c '||' '$outdir'/lib/libc/crypt/^(arc4random.h chacha_private.h)
lib libbsd.a -d pkg/libressl/headers\
lib/libc/^(\
crypt/^(arc4random.c.o arc4random_uniform.c)\
- gen/^(fts.c getprogname.c readpassphrase.c setprogname.c vis.c warnc.c vwarnc.c)\
+ gen/^(fts.c getprogname.c pwcache.c readpassphrase.c setprogname.c vis.c warnc.c vwarnc.c)\
stdlib/^(reallocarray.c strtonum.c)\
string/^(explicit_bzero.c strmode.c timingsafe_memcmp.c)\
)\
- lib/libcrypto/crypto/getentropy_linux.c
+ lib/libcrypto/arc4random/getentropy_linux.c
# diff
exe diff usr.bin/diff/^(diff.c diffdir.c diffreg.c xmalloc.c) libbsd.a
@@ -67,7 +67,7 @@ man -d usr.bin/yacc 1 yacc.1
srcpats=./^(\
bin/pax\
include\
- lib/^(libc/^(crypt gen stdlib string) libcrypto/crypto)\
+ lib/^(libc/^(crypt gen stdlib string) libcrypto/arc4random)\
usr.bin/^(diff doas fmt patch yacc)\
)^/'*'
syspats='./sys/sys/*'
diff --git a/pkg/openbsd/include/grp.h b/pkg/openbsd/include/grp.h
index 49f4dfd4..b1cee552 100644
--- a/pkg/openbsd/include/grp.h
+++ b/pkg/openbsd/include/grp.h
@@ -1,2 +1,3 @@
#include_next <grp.h>
#define setgroupent(n) setgrent()
+char *group_from_gid(gid_t, int);
diff --git a/pkg/openbsd/include/pwd.h b/pkg/openbsd/include/pwd.h
index e859a8d1..bb28a69f 100644
--- a/pkg/openbsd/include/pwd.h
+++ b/pkg/openbsd/include/pwd.h
@@ -1,2 +1,3 @@
#include_next <pwd.h>
#define setpassent(n) setpwent()
+char *user_from_uid(uid_t, int);
diff --git a/pkg/openbsd/patch/0001-fts-Avoid-d_namlen.patch b/pkg/openbsd/patch/0001-fts-Avoid-d_namlen.patch
index fb3e7cbd..acf95b95 100644
--- a/pkg/openbsd/patch/0001-fts-Avoid-d_namlen.patch
+++ b/pkg/openbsd/patch/0001-fts-Avoid-d_namlen.patch
@@ -1,17 +1,17 @@
-From 03bc025e5ccfc5ba5524cd76a83a5682263fd3e4 Mon Sep 17 00:00:00 2001
+From b546a0ae0beb2323143aed00d05e2fdf4fef5239 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 17 Apr 2016 23:50:15 -0700
Subject: [PATCH] fts: Avoid d_namlen
---
- lib/libc/gen/fts.c | 11 +++++++----
- 1 file changed, 7 insertions(+), 4 deletions(-)
+ lib/libc/gen/fts.c | 10 ++++++----
+ 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
-index 9a9b2a5..77e1e77 100644
+index 98b3a0a39..c186b7af2 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
-@@ -556,6 +556,7 @@ fts_build(FTS *sp, int type)
+@@ -555,6 +555,7 @@ fts_build(FTS *sp, int type)
int nitems, cderrno, descend, level, nlinks, nostat, doadjust;
int saved_errno;
char *cp;
@@ -19,13 +19,12 @@ index 9a9b2a5..77e1e77 100644
/* Set current node pointer. */
cur = sp->fts_cur;
-@@ -654,11 +655,13 @@ fts_build(FTS *sp, int type)
+@@ -653,11 +654,12 @@ fts_build(FTS *sp, int type)
if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
continue;
-- if (!(p = fts_alloc(sp, dp->d_name, (size_t)dp->d_namlen)))
+- if (!(p = fts_alloc(sp, dp->d_name, dp->d_namlen)))
+ namlen = strlen(dp->d_name);
-+
+ if (!(p = fts_alloc(sp, dp->d_name, namlen)))
goto mem1;
- if (dp->d_namlen >= maxlen) { /* include space for NUL */
@@ -36,7 +35,7 @@ index 9a9b2a5..77e1e77 100644
/*
* No more memory for path or structures. Save
* errno, free up the current structure and the
-@@ -684,7 +687,7 @@ mem1: saved_errno = errno;
+@@ -683,7 +685,7 @@ mem1: saved_errno = errno;
p->fts_level = level;
p->fts_parent = sp->fts_cur;
@@ -46,5 +45,5 @@ index 9a9b2a5..77e1e77 100644
/*
* If we wrap, free up the current structure and
--
-2.9.3
+2.12.2
diff --git a/pkg/openbsd/patch/0002-fts-Add-some-includes.patch b/pkg/openbsd/patch/0002-fts-Add-some-includes.patch
index a6a16303..81a3eeb3 100644
--- a/pkg/openbsd/patch/0002-fts-Add-some-includes.patch
+++ b/pkg/openbsd/patch/0002-fts-Add-some-includes.patch
@@ -1,4 +1,4 @@
-From de6a55b9392c80bb9be3dd8b9bb816d8d269ee5b Mon Sep 17 00:00:00 2001
+From e73065515ec3b6c03e45ee7c8c10543ff44a407c Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Mon, 18 Apr 2016 01:25:29 -0700
Subject: [PATCH] fts: Add some includes
@@ -9,7 +9,7 @@ Subject: [PATCH] fts: Add some includes
2 files changed, 4 insertions(+)
diff --git a/include/fts.h b/include/fts.h
-index eaf6be0..a5b3aff 100644
+index eaf6be07c..a5b3aff91 100644
--- a/include/fts.h
+++ b/include/fts.h
@@ -35,6 +35,8 @@
@@ -22,7 +22,7 @@ index eaf6be0..a5b3aff 100644
struct _ftsent *fts_cur; /* current node */
struct _ftsent *fts_child; /* linked list of children */
diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
-index 77e1e77..eff297c 100644
+index c186b7af2..f41254c71 100644
--- a/lib/libc/gen/fts.c
+++ b/lib/libc/gen/fts.c
@@ -31,6 +31,7 @@
@@ -42,5 +42,5 @@ index 77e1e77..eff297c 100644
#define MAXIMUM(a, b) (((a) > (b)) ? (a) : (b))
--
-2.9.3
+2.12.2
diff --git a/pkg/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch b/pkg/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch
index 0ca88edf..0b111d86 100644
--- a/pkg/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch
+++ b/pkg/openbsd/patch/0003-pax-Set-listf-to-stderr-in-main.patch
@@ -1,4 +1,4 @@
-From 2d5f85f2a77ee62751c4ec4193cc55207875a757 Mon Sep 17 00:00:00 2001
+From 3c6a27e7ab65ee24222db9513f2a352774644944 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Mon, 18 Apr 2016 00:13:51 -0700
Subject: [PATCH] pax: Set listf to stderr in main
@@ -8,12 +8,12 @@ Subject: [PATCH] pax: Set listf to stderr in main
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/bin/pax/pax.c b/bin/pax/pax.c
-index 1b17b8c..7e62c51 100644
+index ca46ba50a..8be03f408 100644
--- a/bin/pax/pax.c
+++ b/bin/pax/pax.c
-@@ -91,7 +91,7 @@ int docrc; /* check/create file crc */
- char *dirptr; /* destination dir in a copy */
+@@ -91,7 +91,7 @@ char *dirptr; /* destination dir in a copy */
char *argv0; /* root of argv[0] */
+ enum op_mode op_mode; /* what program are we acting as? */
sigset_t s_mask; /* signal mask for cleanup critical sect */
-FILE *listf = stderr; /* file pointer to print file list to */
+FILE *listf; /* file pointer to print file list to */
@@ -30,5 +30,5 @@ index 1b17b8c..7e62c51 100644
* Keep a reference to cwd, so we can always come back home.
*/
--
-2.9.3
+2.12.2
diff --git a/pkg/openbsd/patch/0004-pax-Add-some-includes.patch b/pkg/openbsd/patch/0004-pax-Add-some-includes.patch
index 4061d470..cc029d57 100644
--- a/pkg/openbsd/patch/0004-pax-Add-some-includes.patch
+++ b/pkg/openbsd/patch/0004-pax-Add-some-includes.patch
@@ -1,63 +1,86 @@
-From 140c41d57f7bef789f4a0ea0db0426c1b3f0f38f Mon Sep 17 00:00:00 2001
+From fbf6dc8783f31408cc090cf42cf92008d4f2a455 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Mon, 18 Apr 2016 01:27:29 -0700
Subject: [PATCH] pax: Add some includes
---
- bin/pax/ar_subs.c | 1 +
- bin/pax/file_subs.c | 1 +
- bin/pax/gen_subs.c | 1 +
+ bin/pax/ar_subs.c | 3 ++-
+ bin/pax/buf_subs.c | 1 +
+ bin/pax/file_subs.c | 2 ++
bin/pax/sel_subs.c | 1 +
- 4 files changed, 4 insertions(+)
+ bin/pax/tables.c | 1 +
+ 5 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c
-index b95b1c2..91b8436 100644
+index 51dd6e085..f70ec4ed0 100644
--- a/bin/pax/ar_subs.c
+++ b/bin/pax/ar_subs.c
-@@ -44,6 +44,7 @@
+@@ -36,14 +36,15 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/time.h>
#include <errno.h>
+ #include <fcntl.h>
+ #include <signal.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+ #include <time.h>
#include <unistd.h>
- #include <stdlib.h>
-+#include <time.h>
+-
#include "pax.h"
#include "extern.h"
+diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c
+index 41f06ae31..30be3dc46 100644
+--- a/bin/pax/buf_subs.c
++++ b/bin/pax/buf_subs.c
+@@ -36,6 +36,7 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/time.h>
+ #include <stdio.h>
+ #include <errno.h>
+ #include <unistd.h>
diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c
-index 1f27d28..b7239c8 100644
+index 9f834bf17..57ebdb490 100644
--- a/bin/pax/file_subs.c
+++ b/bin/pax/file_subs.c
-@@ -36,6 +36,7 @@
+@@ -35,6 +35,8 @@
+ */
- #include <sys/time.h>
#include <sys/stat.h>
++#include <sys/time.h>
+#include <sys/types.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
-diff --git a/bin/pax/gen_subs.c b/bin/pax/gen_subs.c
-index cd857dc..ae5843e 100644
---- a/bin/pax/gen_subs.c
-+++ b/bin/pax/gen_subs.c
-@@ -43,6 +43,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <vis.h>
-+#include <time.h>
- #include "pax.h"
- #include "extern.h"
-
diff --git a/bin/pax/sel_subs.c b/bin/pax/sel_subs.c
-index fc9194d..7bdbe46 100644
+index 17200b5a4..136f87c5d 100644
--- a/bin/pax/sel_subs.c
+++ b/bin/pax/sel_subs.c
-@@ -44,6 +44,7 @@
+@@ -43,6 +43,7 @@
#include <stdlib.h>
#include <string.h>
- #include <unistd.h>
-+#include <time.h>
+ #include <time.h>
++#include <unistd.h>
+
#include "pax.h"
- #include "sel_subs.h"
#include "extern.h"
+diff --git a/bin/pax/tables.c b/bin/pax/tables.c
+index b700f1649..99790f986 100644
+--- a/bin/pax/tables.c
++++ b/bin/pax/tables.c
+@@ -36,6 +36,7 @@
+
+ #include <sys/types.h>
+ #include <sys/stat.h>
++#include <sys/time.h>
+ #include <errno.h>
+ #include <fcntl.h>
+ #include <limits.h>
--
-2.8.1
+2.12.2
diff --git a/pkg/openbsd/patch/0005-tar-Default-to-stdin.patch b/pkg/openbsd/patch/0005-tar-Default-to-stdin.patch
index f4c2e08c..4ee9207e 100644
--- a/pkg/openbsd/patch/0005-tar-Default-to-stdin.patch
+++ b/pkg/openbsd/patch/0005-tar-Default-to-stdin.patch
@@ -1,27 +1,25 @@
-From 4e6eb43b544fff46d7ca4307b4c0e7699a261ed7 Mon Sep 17 00:00:00 2001
+From cee8b0c189dd7b421e2f3e85557fb4ee4fdf4d6c Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Mon, 18 Apr 2016 01:16:12 -0700
Subject: [PATCH] tar: Default to stdin
---
- bin/pax/options.c | 4 +---
- 1 file changed, 1 insertion(+), 3 deletions(-)
+ bin/pax/options.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bin/pax/options.c b/bin/pax/options.c
-index 8721eaa..51101c7 100644
+index d615e39cf..022c59664 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
-@@ -871,9 +871,7 @@ tar_options(int argc, char **argv)
-
- if (!fstdin && ((arcname == NULL) || (*arcname == '\0'))) {
+@@ -937,7 +937,7 @@ tar_options(int argc, char **argv)
+ if ((arcname == NULL) || (*arcname == '\0')) {
arcname = getenv("TAPE");
-- if ((arcname == NULL) || (*arcname == '\0'))
+ if ((arcname == NULL) || (*arcname == '\0'))
- arcname = _PATH_DEFTAPE;
-- else if ((arcname[0] == '-') && (arcname[1]== '\0')) {
-+ if ((arcname == NULL) || (*arcname == '\0') || (arcname[0] == '-') && (arcname[1]== '\0')) {
- arcname = NULL;
- fstdin = 1;
- }
++ arcname = NULL;
+ }
+ if ((arcname[0] == '-') && (arcname[1]== '\0'))
+ arcname = NULL;
--
-2.9.3
+2.12.2
diff --git a/pkg/openbsd/patch/0006-yacc-Add-some-includes.patch b/pkg/openbsd/patch/0006-yacc-Add-some-includes.patch
index a4b0ed78..d4498745 100644
--- a/pkg/openbsd/patch/0006-yacc-Add-some-includes.patch
+++ b/pkg/openbsd/patch/0006-yacc-Add-some-includes.patch
@@ -1,4 +1,4 @@
-From 148c9835e6304a4247c7116156e8c5a97f153c0e Mon Sep 17 00:00:00 2001
+From f926c3a15c772a7d54561e01682dea486c2a2833 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Mon, 18 Apr 2016 17:34:01 -0700
Subject: [PATCH] yacc: Add some includes
@@ -8,7 +8,7 @@ Subject: [PATCH] yacc: Add some includes
1 file changed, 1 insertion(+)
diff --git a/usr.bin/yacc/defs.h b/usr.bin/yacc/defs.h
-index 7300cae..fab6e12 100644
+index 7300caec2..fab6e1266 100644
--- a/usr.bin/yacc/defs.h
+++ b/usr.bin/yacc/defs.h
@@ -35,6 +35,7 @@
@@ -20,5 +20,5 @@ index 7300cae..fab6e12 100644
#include <ctype.h>
#include <stdio.h>
--
-2.8.1
+2.12.2
diff --git a/pkg/openbsd/patch/0007-diff-Add-missing-includes.patch b/pkg/openbsd/patch/0007-diff-Add-missing-includes.patch
index 2560b726..643a6daf 100644
--- a/pkg/openbsd/patch/0007-diff-Add-missing-includes.patch
+++ b/pkg/openbsd/patch/0007-diff-Add-missing-includes.patch
@@ -1,4 +1,4 @@
-From cd4851a8e922a6bda085b6d345df2a291004ffb8 Mon Sep 17 00:00:00 2001
+From 7ce395bfbff36cf0020d0a425ff3053fcf2eaa3d Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 4 Jun 2016 14:48:20 -0700
Subject: [PATCH] diff: Add missing includes
@@ -9,7 +9,7 @@ Subject: [PATCH] diff: Add missing includes
2 files changed, 2 insertions(+)
diff --git a/usr.bin/diff/diff.c b/usr.bin/diff/diff.c
-index 2b075f12c49..80c7f842ef6 100644
+index 2b075f12c..80c7f842e 100644
--- a/usr.bin/diff/diff.c
+++ b/usr.bin/diff/diff.c
@@ -20,6 +20,7 @@
@@ -21,7 +21,7 @@ index 2b075f12c49..80c7f842ef6 100644
#include <ctype.h>
diff --git a/usr.bin/diff/diffreg.c b/usr.bin/diff/diffreg.c
-index 35d61c349cb..953018cf553 100644
+index 35d61c349..953018cf5 100644
--- a/usr.bin/diff/diffreg.c
+++ b/usr.bin/diff/diffreg.c
@@ -77,6 +77,7 @@
@@ -33,5 +33,5 @@ index 35d61c349cb..953018cf553 100644
#include <limits.h>
--
-2.11.0
+2.12.2
diff --git a/pkg/openbsd/patch/0008-patch-Add-missing-includes.patch b/pkg/openbsd/patch/0008-patch-Add-missing-includes.patch
index 782880c4..9adc1dcd 100644
--- a/pkg/openbsd/patch/0008-patch-Add-missing-includes.patch
+++ b/pkg/openbsd/patch/0008-patch-Add-missing-includes.patch
@@ -1,4 +1,4 @@
-From e47145b05bd63b51df6219855747a8247c0910fc Mon Sep 17 00:00:00 2001
+From d0261effc519faf5a2d0f5a6835a0242f8f90d02 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 4 Jun 2016 18:40:24 -0700
Subject: [PATCH] patch: Add missing includes
@@ -9,7 +9,7 @@ Subject: [PATCH] patch: Add missing includes
2 files changed, 2 insertions(+)
diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c
-index 3f60861..80c4801 100644
+index 45f89d29d..5b30f4435 100644
--- a/usr.bin/patch/inp.c
+++ b/usr.bin/patch/inp.c
@@ -32,6 +32,7 @@
@@ -21,7 +21,7 @@ index 3f60861..80c4801 100644
#include <stddef.h>
#include <stdint.h>
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
-index 8f8f8cd..8087a21 100644
+index 8f8f8cd4e..8087a2194 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -26,6 +26,7 @@
@@ -33,5 +33,5 @@ index 8f8f8cd..8087a21 100644
#include <sys/stat.h>
#include <unistd.h>
--
-2.9.3
+2.12.2
diff --git a/pkg/openbsd/patch/0009-patch-Avoid-d_namlen.patch b/pkg/openbsd/patch/0009-patch-Avoid-d_namlen.patch
index 0eb9f9d2..33d744a0 100644
--- a/pkg/openbsd/patch/0009-patch-Avoid-d_namlen.patch
+++ b/pkg/openbsd/patch/0009-patch-Avoid-d_namlen.patch
@@ -1,4 +1,4 @@
-From 0d285d78276b91b101391a4dab53b0585d2812f8 Mon Sep 17 00:00:00 2001
+From 91483dfca3aa6373451120db45c60198faa0766e Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 4 Jun 2016 18:40:37 -0700
Subject: [PATCH] patch: Avoid d_namlen
@@ -8,7 +8,7 @@ Subject: [PATCH] patch: Avoid d_namlen
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/usr.bin/patch/backupfile.c b/usr.bin/patch/backupfile.c
-index d9e40bc..1d7858a 100644
+index d9e40bcba..1d7858ae3 100644
--- a/usr.bin/patch/backupfile.c
+++ b/usr.bin/patch/backupfile.c
@@ -95,7 +95,7 @@ max_backup_version(const char *file, const char *dir)
@@ -21,5 +21,5 @@ index d9e40bc..1d7858a 100644
this_version = version_number(file, dp->d_name, file_name_length);
--
-2.8.1
+2.12.2
diff --git a/pkg/openbsd/patch/0010-patch-Fix-with-musl-s-basename-dirname.patch b/pkg/openbsd/patch/0010-patch-Fix-with-musl-s-basename-dirname.patch
index 3956747e..80a1db3a 100644
--- a/pkg/openbsd/patch/0010-patch-Fix-with-musl-s-basename-dirname.patch
+++ b/pkg/openbsd/patch/0010-patch-Fix-with-musl-s-basename-dirname.patch
@@ -1,4 +1,4 @@
-From 4eaf0cae80ad349f877a6c29d71d7dcdfa077481 Mon Sep 17 00:00:00 2001
+From e16acc0e80f475b2139eabe1b07b7eb0521a7918 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 4 Jun 2016 20:13:35 -0700
Subject: [PATCH] patch: Fix with musl's basename/dirname
@@ -8,7 +8,7 @@ Subject: [PATCH] patch: Fix with musl's basename/dirname
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/usr.bin/patch/backupfile.c b/usr.bin/patch/backupfile.c
-index 1d7858a..243d00e 100644
+index 1d7858ae3..243d00e32 100644
--- a/usr.bin/patch/backupfile.c
+++ b/usr.bin/patch/backupfile.c
@@ -53,21 +53,22 @@ static void invalid_arg(const char *, const char *, int);
@@ -42,5 +42,5 @@ index 1d7858a..243d00e 100644
return concat(file, simple_backup_suffix);
return make_version_name(file, highest_backup + 1);
--
-2.8.1
+2.12.2
diff --git a/pkg/openbsd/patch/0011-pax-Fix-GNU-long-name-handling-with-short-read.patch b/pkg/openbsd/patch/0011-pax-Fix-GNU-long-name-handling-with-short-read.patch
index 6fa04409..9cd4120c 100644
--- a/pkg/openbsd/patch/0011-pax-Fix-GNU-long-name-handling-with-short-read.patch
+++ b/pkg/openbsd/patch/0011-pax-Fix-GNU-long-name-handling-with-short-read.patch
@@ -1,4 +1,4 @@
-From 633eb1c50eb77216f4049c1ec983c5616fef13da Mon Sep 17 00:00:00 2001
+From fdfd554d5e24850f7ebbc67798c893c4ec6b7506 Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 3 Dec 2016 20:49:24 -0800
Subject: [PATCH] pax: Fix GNU long name handling with short read
@@ -10,17 +10,17 @@ Subject: [PATCH] pax: Fix GNU long name handling with short read
3 files changed, 51 insertions(+), 44 deletions(-)
diff --git a/bin/pax/ar_subs.c b/bin/pax/ar_subs.c
-index 91b843645af..4071b71e2e0 100644
+index f70ec4ed0..222bfafa5 100644
--- a/bin/pax/ar_subs.c
+++ b/bin/pax/ar_subs.c
@@ -37,6 +37,7 @@
#include <sys/types.h>
- #include <sys/time.h>
#include <sys/stat.h>
+ #include <sys/time.h>
+#include <err.h>
+ #include <errno.h>
+ #include <fcntl.h>
#include <signal.h>
- #include <string.h>
- #include <stdio.h>
@@ -51,6 +52,7 @@
static void wr_archive(ARCHD *, int is_app);
static int get_arc(void);
@@ -29,7 +29,7 @@ index 91b843645af..4071b71e2e0 100644
extern sigset_t s_mask;
/*
-@@ -96,16 +98,8 @@ list(void)
+@@ -93,16 +95,8 @@ list(void)
* step through the archive until the format says it is done
*/
while (next_head(arcn) == 0) {
@@ -47,7 +47,7 @@ index 91b843645af..4071b71e2e0 100644
/*
* check for pattern, and user specified options match.
-@@ -211,15 +205,8 @@ extract(void)
+@@ -208,15 +202,8 @@ extract(void)
* says it is done
*/
while (next_head(arcn) == 0) {
@@ -64,7 +64,7 @@ index 91b843645af..4071b71e2e0 100644
/*
* check for pattern, and user specified options match. When
-@@ -1246,3 +1233,48 @@ get_arc(void)
+@@ -1243,3 +1230,48 @@ get_arc(void)
paxwarn(1, "Sorry, unable to determine archive format.");
return(-1);
}
@@ -114,7 +114,7 @@ index 91b843645af..4071b71e2e0 100644
+ return 1;
+}
diff --git a/bin/pax/buf_subs.c b/bin/pax/buf_subs.c
-index cac45294436..31a05c300a6 100644
+index 30be3dc46..6a9594918 100644
--- a/bin/pax/buf_subs.c
+++ b/bin/pax/buf_subs.c
@@ -673,9 +673,7 @@ rd_wrfile(ARCHD *arcn, int ofd, off_t *left)
@@ -129,10 +129,10 @@ index cac45294436..31a05c300a6 100644
sz = (int)sb.st_blksize;
} else
diff --git a/bin/pax/file_subs.c b/bin/pax/file_subs.c
-index b7239c87409..5b7f81b713b 100644
+index 57ebdb490..1a8f58d57 100644
--- a/bin/pax/file_subs.c
+++ b/bin/pax/file_subs.c
-@@ -920,7 +920,6 @@ file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz,
+@@ -917,7 +917,6 @@ file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz,
char *end;
int wcnt;
char *st = str;
@@ -140,7 +140,7 @@ index b7239c87409..5b7f81b713b 100644
/*
* while we have data to process
-@@ -979,29 +978,7 @@ file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz,
+@@ -976,29 +975,7 @@ file_write(int fd, char *str, int cnt, int *rem, int *isempt, int sz,
/*
* have non-zero data in this file system block, have to write
*/
@@ -172,5 +172,5 @@ index b7239c87409..5b7f81b713b 100644
return(-1);
}
--
-2.11.0
+2.12.2
diff --git a/pkg/openbsd/patch/0012-pax-Support-xz-compression-with-J-flag.patch b/pkg/openbsd/patch/0012-pax-Support-xz-compression-with-J-flag.patch
index 61a4332e..cd9034cc 100644
--- a/pkg/openbsd/patch/0012-pax-Support-xz-compression-with-J-flag.patch
+++ b/pkg/openbsd/patch/0012-pax-Support-xz-compression-with-J-flag.patch
@@ -1,4 +1,4 @@
-From 5b372180bd0994a256be1a334c565d882f0db458 Mon Sep 17 00:00:00 2001
+From d3515f559d148e217f2a8799fd1e3db63dd817ad Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sat, 3 Dec 2016 23:50:27 -0800
Subject: [PATCH] pax: Support xz compression with -J flag
@@ -8,10 +8,10 @@ Subject: [PATCH] pax: Support xz compression with -J flag
1 file changed, 22 insertions(+), 3 deletions(-)
diff --git a/bin/pax/options.c b/bin/pax/options.c
-index 51101c7ad5a..a79a03b5bed 100644
+index 022c59664..c2d046d07 100644
--- a/bin/pax/options.c
+++ b/bin/pax/options.c
-@@ -78,6 +78,7 @@ static int xz_id(char *_blk, int _size);
+@@ -154,6 +154,7 @@ static int xz_id(char *_blk, int _size);
#define GZIP_CMD "gzip" /* command to run as gzip */
#define COMPRESS_CMD "compress" /* command to run as compress */
#define BZIP2_CMD "bzip2" /* command to run as bzip2 */
@@ -19,7 +19,7 @@ index 51101c7ad5a..a79a03b5bed 100644
/*
* Format specific routine table
-@@ -221,7 +222,7 @@ pax_options(int argc, char **argv)
+@@ -300,7 +301,7 @@ pax_options(int argc, char **argv)
/*
* process option flags
*/
@@ -28,7 +28,7 @@ index 51101c7ad5a..a79a03b5bed 100644
!= -1) {
switch (c) {
case 'a':
-@@ -481,6 +482,12 @@ pax_options(int argc, char **argv)
+@@ -556,6 +557,12 @@ pax_options(int argc, char **argv)
Hflag = 1;
flg |= CHF;
break;
@@ -41,7 +41,7 @@ index 51101c7ad5a..a79a03b5bed 100644
case 'L':
/*
* follow symlinks
-@@ -657,7 +664,7 @@ tar_options(int argc, char **argv)
+@@ -731,7 +738,7 @@ tar_options(int argc, char **argv)
* process option flags
*/
while ((c = getoldopt(argc, argv,
@@ -50,7 +50,7 @@ index 51101c7ad5a..a79a03b5bed 100644
switch (c) {
case 'b':
/*
-@@ -815,6 +822,12 @@ tar_options(int argc, char **argv)
+@@ -880,6 +887,12 @@ tar_options(int argc, char **argv)
incfiles[nincfiles - 1].file = optarg;
incfiles[nincfiles - 1].dir = chdname;
break;
@@ -63,7 +63,7 @@ index 51101c7ad5a..a79a03b5bed 100644
case 'L':
/*
* follow symlinks
-@@ -1098,7 +1111,7 @@ cpio_options(int argc, char **argv)
+@@ -1164,7 +1177,7 @@ cpio_options(int argc, char **argv)
dflag = 1;
act = -1;
nodirs = 1;
@@ -72,7 +72,7 @@ index 51101c7ad5a..a79a03b5bed 100644
switch (c) {
case 'a':
/*
-@@ -1282,6 +1295,12 @@ cpio_options(int argc, char **argv)
+@@ -1347,6 +1360,12 @@ cpio_options(int argc, char **argv)
(void)fputs("\n\n", stderr);
cpio_usage();
break;
@@ -86,5 +86,5 @@ index 51101c7ad5a..a79a03b5bed 100644
/*
* follow symbolic links
--
-2.11.0
+2.12.2
diff --git a/pkg/openbsd/patch/0013-setprogname-Explicitly-discard-const-qualifier.patch b/pkg/openbsd/patch/0013-setprogname-Explicitly-discard-const-qualifier.patch
index 121e10e8..da04c2ff 100644
--- a/pkg/openbsd/patch/0013-setprogname-Explicitly-discard-const-qualifier.patch
+++ b/pkg/openbsd/patch/0013-setprogname-Explicitly-discard-const-qualifier.patch
@@ -1,4 +1,4 @@
-From f976df1b8ad1ed79f25d04eb7285e582690ad965 Mon Sep 17 00:00:00 2001
+From 6ab5ad90eea823a8b7020108c827bc600d674d0b Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 11 Dec 2016 14:36:13 -0800
Subject: [PATCH] setprogname: Explicitly discard const qualifier
@@ -8,7 +8,7 @@ Subject: [PATCH] setprogname: Explicitly discard const qualifier
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/libc/gen/setprogname.c b/lib/libc/gen/setprogname.c
-index ec3189fa699..173148ba8cf 100644
+index ec3189fa6..173148ba8 100644
--- a/lib/libc/gen/setprogname.c
+++ b/lib/libc/gen/setprogname.c
@@ -25,7 +25,7 @@ setprogname(const char *progname)
@@ -22,5 +22,5 @@ index ec3189fa699..173148ba8cf 100644
+ __progname = (char *)tmpn + 1;
}
--
-2.11.0
+2.12.2
diff --git a/pkg/openbsd/patch/0014-readpassphrase-Support-systems-without-VSTATUS-and-T.patch b/pkg/openbsd/patch/0014-readpassphrase-Support-systems-without-VSTATUS-and-T.patch
index 0fad210a..78660907 100644
--- a/pkg/openbsd/patch/0014-readpassphrase-Support-systems-without-VSTATUS-and-T.patch
+++ b/pkg/openbsd/patch/0014-readpassphrase-Support-systems-without-VSTATUS-and-T.patch
@@ -1,4 +1,4 @@
-From d64f92d2e1242a0dbdbd58c4c2fc34375266abb9 Mon Sep 17 00:00:00 2001
+From d36036bbd959091b6442d003128342ed515af01b Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 26 Feb 2017 17:01:33 -0800
Subject: [PATCH] readpassphrase: Support systems without VSTATUS and TCSASOFT
@@ -8,7 +8,7 @@ Subject: [PATCH] readpassphrase: Support systems without VSTATUS and TCSASOFT
1 file changed, 6 insertions(+)
diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c
-index 3837b0881de..55fe687ed32 100644
+index a1aeb342b..a50eaf003 100644
--- a/lib/libc/gen/readpassphrase.c
+++ b/lib/libc/gen/readpassphrase.c
@@ -32,6 +32,10 @@
@@ -34,5 +34,5 @@ index 3837b0881de..55fe687ed32 100644
} else {
memset(&term, 0, sizeof(term));
--
-2.11.1
+2.12.2
diff --git a/pkg/openbsd/patch/0015-Remove-getpass-definition.patch b/pkg/openbsd/patch/0015-Remove-getpass-definition.patch
index aebfd49a..f2adafda 100644
--- a/pkg/openbsd/patch/0015-Remove-getpass-definition.patch
+++ b/pkg/openbsd/patch/0015-Remove-getpass-definition.patch
@@ -1,4 +1,4 @@
-From 0cbb9dbd472c79ecbb53e8c977955d7782fbb18b Mon Sep 17 00:00:00 2001
+From e76fda424564544bc8298fb5be7cda966451497d Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 26 Feb 2017 17:12:56 -0800
Subject: [PATCH] Remove getpass definition
@@ -9,10 +9,10 @@ It is a legacy function and musl already provides an implementation.
1 file changed, 2 insertions(+), 10 deletions(-)
diff --git a/lib/libc/gen/readpassphrase.c b/lib/libc/gen/readpassphrase.c
-index 55fe687ed32..1a327d35a6d 100644
+index a50eaf003..57c6dc527 100644
--- a/lib/libc/gen/readpassphrase.c
+++ b/lib/libc/gen/readpassphrase.c
-@@ -179,16 +179,8 @@ restart:
+@@ -183,16 +183,8 @@ restart:
}
DEF_WEAK(readpassphrase);
@@ -32,5 +32,5 @@ index 55fe687ed32..1a327d35a6d 100644
signo[s] = 1;
}
--
-2.11.1
+2.12.2
diff --git a/pkg/openbsd/patch/0016-doas-Apply-some-patches-from-OpenBSD-CVS.patch b/pkg/openbsd/patch/0016-doas-Apply-some-patches-from-OpenBSD-CVS.patch
deleted file mode 100644
index 05bf3cb7..00000000
--- a/pkg/openbsd/patch/0016-doas-Apply-some-patches-from-OpenBSD-CVS.patch
+++ /dev/null
@@ -1,317 +0,0 @@
-From 5f959925db4a0d71cb926820b42780de8820f9d7 Mon Sep 17 00:00:00 2001
-From: tedu <tedu@openbsd.org>
-Date: Thu, 1 Sep 2016 13:16:38 +0000
-Subject: [PATCH] doas: Apply some patches from OpenBSD CVS
-
-move the authentication code to a function
-unconst these parameters; i won't be changing bsd auth today.
-add support for the verified auth ioctls using 'persist' rules.
-clarify that -L will exit without running a command.
-the sudo timeout was 5 minutes i believe, so we'll match that.
-don't allow combining nopass and persist in a single rule
--L means no command
----
- usr.bin/doas/doas.1 | 13 ++++---
- usr.bin/doas/doas.c | 90 ++++++++++++++++++++++++++++++------------------
- usr.bin/doas/doas.conf.5 | 7 ++--
- usr.bin/doas/doas.h | 3 +-
- usr.bin/doas/parse.y | 12 +++++--
- 5 files changed, 83 insertions(+), 42 deletions(-)
-
-diff --git a/usr.bin/doas/doas.1 b/usr.bin/doas/doas.1
-index c5b8e00f3..d39c4aab2 100644
---- a/usr.bin/doas/doas.1
-+++ b/usr.bin/doas/doas.1
-@@ -1,4 +1,4 @@
--.\" $OpenBSD: doas.1,v 1.16 2016/06/11 04:38:21 tedu Exp $
-+.\" $OpenBSD: doas.1,v 1.19 2016/09/04 15:20:37 tedu 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: June 11 2016 $
-+.Dd $Mdocdate: September 4 2016 $
- .Dt DOAS 1
- .Os
- .Sh NAME
-@@ -21,7 +21,7 @@
- .Nd execute commands as another user
- .Sh SYNOPSIS
- .Nm doas
--.Op Fl ns
-+.Op Fl Lns
- .Op Fl a Ar style
- .Op Fl C Ar config
- .Op Fl u Ar user
-@@ -34,7 +34,8 @@ utility executes the given command as another user.
- The
- .Ar command
- argument is mandatory unless
--.Fl C
-+.Fl C ,
-+.Fl L ,
- or
- .Fl s
- is specified.
-@@ -67,6 +68,10 @@ or
- 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,
-+then immediately exit.
-+No command is executed.
- .It Fl n
- Non interactive mode, fail if
- .Nm
-diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c
-index b17c8f13c..d82d9f119 100644
---- a/usr.bin/doas/doas.c
-+++ b/usr.bin/doas/doas.c
-@@ -1,4 +1,4 @@
--/* $OpenBSD: doas.c,v 1.60 2016/07/18 16:46:30 zhuk Exp $ */
-+/* $OpenBSD: doas.c,v 1.64 2016/09/03 11:03:18 tedu Exp $ */
- /*
- * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
- *
-@@ -17,6 +17,7 @@
-
- #include <sys/types.h>
- #include <sys/stat.h>
-+#include <sys/ioctl.h>
-
- #include <limits.h>
- #include <login_cap.h>
-@@ -31,13 +32,14 @@
- #include <grp.h>
- #include <syslog.h>
- #include <errno.h>
-+#include <fcntl.h>
-
- #include "doas.h"
-
- static void __dead
- usage(void)
- {
-- fprintf(stderr, "usage: doas [-ns] [-a style] [-C config] [-u user]"
-+ fprintf(stderr, "usage: doas [-Lns] [-a style] [-C config] [-u user]"
- " command [args]\n");
- exit(1);
- }
-@@ -203,6 +205,52 @@ checkconfig(const char *confpath, int argc, char **argv,
- }
- }
-
-+static void
-+authuser(char *myname, char *login_style, int persist)
-+{
-+ char *challenge = NULL, *response, rbuf[1024], cbuf[128];
-+ auth_session_t *as;
-+ int fd = -1;
-+
-+ if (persist)
-+ fd = open("/dev/tty", O_RDWR);
-+ if (fd != -1) {
-+ if (ioctl(fd, TIOCCHKVERAUTH) == 0)
-+ goto good;
-+ }
-+
-+ if (!(as = auth_userchallenge(myname, login_style, "auth-doas",
-+ &challenge)))
-+ errx(1, "Authorization failed");
-+ if (!challenge) {
-+ char host[HOST_NAME_MAX + 1];
-+ if (gethostname(host, sizeof(host)))
-+ snprintf(host, sizeof(host), "?");
-+ snprintf(cbuf, sizeof(cbuf),
-+ "\rdoas (%.32s@%.32s) password: ", myname, host);
-+ challenge = cbuf;
-+ }
-+ response = readpassphrase(challenge, rbuf, sizeof(rbuf),
-+ RPP_REQUIRE_TTY);
-+ if (response == NULL && errno == ENOTTY) {
-+ syslog(LOG_AUTHPRIV | LOG_NOTICE,
-+ "tty required for %s", myname);
-+ errx(1, "a tty is required");
-+ }
-+ if (!auth_userresponse(as, response, 0)) {
-+ syslog(LOG_AUTHPRIV | LOG_NOTICE,
-+ "failed auth for %s", myname);
-+ errc(1, EPERM, NULL);
-+ }
-+ explicit_bzero(rbuf, sizeof(rbuf));
-+good:
-+ if (fd != -1) {
-+ int secs = 5 * 60;
-+ ioctl(fd, TIOCSETVERAUTH, &secs);
-+ close(fd);
-+ }
-+}
-+
- int
- main(int argc, char **argv)
- {
-@@ -230,14 +278,11 @@ main(int argc, char **argv)
-
- setprogname("doas");
-
-- if (pledge("stdio rpath getpw tty recvfd proc exec id", NULL) == -1)
-- err(1, "pledge");
--
- closefrom(STDERR_FILENO + 1);
-
- uid = getuid();
-
-- while ((ch = getopt(argc, argv, "a:C:nsu:")) != -1) {
-+ while ((ch = getopt(argc, argv, "a:C:Lnsu:")) != -1) {
- switch (ch) {
- case 'a':
- login_style = optarg;
-@@ -245,6 +290,11 @@ main(int argc, char **argv)
- case 'C':
- confpath = optarg;
- break;
-+ case 'L':
-+ i = open("/dev/tty", O_RDWR);
-+ if (i != -1)
-+ ioctl(i, TIOCCLRVERAUTH);
-+ exit(i != -1);
- case 'u':
- if (parseuid(optarg, &target) != 0)
- errx(1, "unknown user");
-@@ -317,36 +367,10 @@ main(int argc, char **argv)
- }
-
- if (!(rule->options & NOPASS)) {
-- char *challenge = NULL, *response, rbuf[1024], cbuf[128];
-- auth_session_t *as;
--
- if (nflag)
- errx(1, "Authorization required");
-
-- if (!(as = auth_userchallenge(myname, login_style, "auth-doas",
-- &challenge)))
-- errx(1, "Authorization failed");
-- if (!challenge) {
-- char host[HOST_NAME_MAX + 1];
-- if (gethostname(host, sizeof(host)))
-- snprintf(host, sizeof(host), "?");
-- snprintf(cbuf, sizeof(cbuf),
-- "\rdoas (%.32s@%.32s) password: ", myname, host);
-- challenge = cbuf;
-- }
-- response = readpassphrase(challenge, rbuf, sizeof(rbuf),
-- RPP_REQUIRE_TTY);
-- if (response == NULL && errno == ENOTTY) {
-- syslog(LOG_AUTHPRIV | LOG_NOTICE,
-- "tty required for %s", myname);
-- errx(1, "a tty is required");
-- }
-- if (!auth_userresponse(as, response, 0)) {
-- syslog(LOG_AUTHPRIV | LOG_NOTICE,
-- "failed auth for %s", myname);
-- errc(1, EPERM, NULL);
-- }
-- explicit_bzero(rbuf, sizeof(rbuf));
-+ authuser(myname, login_style, rule->options & PERSIST);
- }
-
- if (pledge("stdio rpath getpw exec id", NULL) == -1)
-diff --git a/usr.bin/doas/doas.conf.5 b/usr.bin/doas/doas.conf.5
-index 864c37ec5..317ee0028 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.29 2016/06/27 17:36:33 jmc Exp $
-+.\" $OpenBSD: doas.conf.5,v 1.30 2016/09/02 18:12:30 tedu 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: June 27 2016 $
-+.Dd $Mdocdate: September 2 2016 $
- .Dt DOAS.CONF 5
- .Os
- .Sh NAME
-@@ -47,6 +47,9 @@ Options are:
- .Bl -tag -width keepenv
- .It Ic nopass
- The user is not required to enter a password.
-+.It Ic persist
-+After the user successfully authenticates, do not ask for a password
-+again for some time.
- .It Ic keepenv
- The user's environment is maintained.
- The default is to reset the environment, except for the variables
-diff --git a/usr.bin/doas/doas.h b/usr.bin/doas/doas.h
-index 067483ee3..93b68fadc 100644
---- a/usr.bin/doas/doas.h
-+++ b/usr.bin/doas/doas.h
-@@ -1,4 +1,4 @@
--/* $OpenBSD: doas.h,v 1.8 2016/06/19 19:29:43 martijn Exp $ */
-+/* $OpenBSD: doas.h,v 1.9 2016/09/02 18:12:30 tedu Exp $ */
- struct rule {
- int action;
- int options;
-@@ -22,3 +22,4 @@ char **prepenv(struct rule *);
-
- #define NOPASS 0x1
- #define KEEPENV 0x2
-+#define PERSIST 0x4
-diff --git a/usr.bin/doas/parse.y b/usr.bin/doas/parse.y
-index 7e68cb7c5..9a30e1ea7 100644
---- a/usr.bin/doas/parse.y
-+++ b/usr.bin/doas/parse.y
-@@ -1,4 +1,4 @@
--/* $OpenBSD: parse.y,v 1.19 2016/06/27 15:41:17 tedu Exp $ */
-+/* $OpenBSD: parse.y,v 1.21 2016/09/04 15:11:13 tedu Exp $ */
- /*
- * Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
- *
-@@ -57,7 +57,7 @@ int yyparse(void);
- %}
-
- %token TPERMIT TDENY TAS TCMD TARGS
--%token TNOPASS TKEEPENV TSETENV
-+%token TNOPASS TPERSIST TKEEPENV TSETENV
- %token TSTRING
-
- %%
-@@ -108,6 +108,10 @@ options: /* none */ {
- } | options option {
- $$.options = $1.options | $2.options;
- $$.envlist = $1.envlist;
-+ if (($$.options & (NOPASS|PERSIST)) == (NOPASS|PERSIST)) {
-+ yyerror("can't combine nopass and persist");
-+ YYERROR;
-+ }
- if ($2.envlist) {
- if ($$.envlist) {
- yyerror("can't have two setenv sections");
-@@ -119,6 +123,9 @@ options: /* none */ {
- option: TNOPASS {
- $$.options = NOPASS;
- $$.envlist = NULL;
-+ } | TPERSIST {
-+ $$.options = PERSIST;
-+ $$.envlist = NULL;
- } | TKEEPENV {
- $$.options = KEEPENV;
- $$.envlist = NULL;
-@@ -208,6 +215,7 @@ struct keyword {
- { "cmd", TCMD },
- { "args", TARGS },
- { "nopass", TNOPASS },
-+ { "persist", TPERSIST },
- { "keepenv", TKEEPENV },
- { "setenv", TSETENV },
- };
---
-2.12.0
-
diff --git a/pkg/openbsd/patch/0017-doas-Port-to-linux-musl.patch b/pkg/openbsd/patch/0016-doas-Port-to-linux-musl.patch
index 497036a4..7ba22b1e 100644
--- a/pkg/openbsd/patch/0017-doas-Port-to-linux-musl.patch
+++ b/pkg/openbsd/patch/0016-doas-Port-to-linux-musl.patch
@@ -1,4 +1,4 @@
-From d9031a1a34741f517760680305a9776d41bdcb32 Mon Sep 17 00:00:00 2001
+From 545c416a156628d6e5682184af2be5caaaa3262e Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Sun, 26 Feb 2017 16:50:55 -0800
Subject: [PATCH] doas: Port to linux/musl
@@ -57,7 +57,7 @@ index d39c4aab2..3097991bc 100644
Parse and check the configuration file
.Ar config ,
diff --git a/usr.bin/doas/doas.c b/usr.bin/doas/doas.c
-index d82d9f119..c84faf9ee 100644
+index 328834cc4..4cab9d272 100644
--- a/usr.bin/doas/doas.c
+++ b/usr.bin/doas/doas.c
@@ -21,7 +21,6 @@
@@ -92,7 +92,7 @@ index d82d9f119..c84faf9ee 100644
" command [args]\n");
exit(1);
}
-@@ -205,23 +213,36 @@ checkconfig(const char *confpath, int argc, char **argv,
+@@ -193,23 +201,36 @@ checkconfig(const char *confpath, int argc, char **argv,
}
}
@@ -139,7 +139,7 @@ index d82d9f119..c84faf9ee 100644
if (!challenge) {
char host[HOST_NAME_MAX + 1];
if (gethostname(host, sizeof(host)))
-@@ -233,20 +254,18 @@ authuser(char *myname, char *login_style, int persist)
+@@ -221,20 +242,18 @@ authuser(char *myname, char *login_style, int persist)
response = readpassphrase(challenge, rbuf, sizeof(rbuf),
RPP_REQUIRE_TTY);
if (response == NULL && errno == ENOTTY) {
@@ -166,7 +166,7 @@ index d82d9f119..c84faf9ee 100644
close(fd);
}
}
-@@ -254,14 +273,13 @@ good:
+@@ -242,14 +261,13 @@ good:
int
main(int argc, char **argv)
{
@@ -183,7 +183,7 @@ index d82d9f119..c84faf9ee 100644
struct passwd *pw;
struct rule *rule;
uid_t uid;
-@@ -273,28 +291,20 @@ main(int argc, char **argv)
+@@ -261,28 +279,20 @@ main(int argc, char **argv)
int nflag = 0;
char cwdpath[PATH_MAX];
const char *cwd;
@@ -210,12 +210,12 @@ index d82d9f119..c84faf9ee 100644
- i = open("/dev/tty", O_RDWR);
- if (i != -1)
- ioctl(i, TIOCCLRVERAUTH);
-- exit(i != -1);
+- exit(i == -1);
+ exit(clearpersist() != 0);
case 'u':
if (parseuid(optarg, &target) != 0)
errx(1, "unknown user");
-@@ -361,16 +371,16 @@ main(int argc, char **argv)
+@@ -352,16 +362,16 @@ main(int argc, char **argv)
cmd = argv[0];
if (!permit(uid, groups, ngroups, &rule, target, cmd,
(const char **)argv + 1)) {
@@ -236,7 +236,7 @@ index d82d9f119..c84faf9ee 100644
}
if (pledge("stdio rpath getpw exec id", NULL) == -1)
-@@ -380,10 +390,12 @@ main(int argc, char **argv)
+@@ -371,10 +381,12 @@ main(int argc, char **argv)
if (!pw)
errx(1, "no passwd entry for target");
@@ -253,7 +253,7 @@ index d82d9f119..c84faf9ee 100644
if (pledge("stdio rpath exec", NULL) == -1)
err(1, "pledge");
-@@ -396,7 +408,7 @@ main(int argc, char **argv)
+@@ -387,7 +399,7 @@ main(int argc, char **argv)
if (pledge("stdio exec", NULL) == -1)
err(1, "pledge");
@@ -263,10 +263,10 @@ index d82d9f119..c84faf9ee 100644
envp = prepenv(rule);
diff --git a/usr.bin/doas/doas.h b/usr.bin/doas/doas.h
-index 93b68fadc..daf4307e7 100644
+index ba54c3f71..0c1f5fa4e 100644
--- a/usr.bin/doas/doas.h
+++ b/usr.bin/doas/doas.h
-@@ -17,6 +17,10 @@ size_t arraylen(const char **);
+@@ -31,6 +31,10 @@ extern int parse_errors;
char **prepenv(struct rule *);
@@ -278,7 +278,7 @@ index 93b68fadc..daf4307e7 100644
#define DENY 2
diff --git a/usr.bin/doas/parse.y b/usr.bin/doas/parse.y
-index 9a30e1ea7..fb59d3130 100644
+index fde406bcf..474415859 100644
--- a/usr.bin/doas/parse.y
+++ b/usr.bin/doas/parse.y
@@ -19,6 +19,7 @@
@@ -424,5 +424,5 @@ index 000000000..dd9cc0411
+ return 0;
+}
--
-2.12.1
+2.12.2
diff --git a/pkg/openbsd/patch/0017-pwcache-Don-t-use-fixed-buffer-sizes.patch b/pkg/openbsd/patch/0017-pwcache-Don-t-use-fixed-buffer-sizes.patch
new file mode 100644
index 00000000..a581cdda
--- /dev/null
+++ b/pkg/openbsd/patch/0017-pwcache-Don-t-use-fixed-buffer-sizes.patch
@@ -0,0 +1,96 @@
+From 145b2b78355f1024c1bb2c179ca2b947dded7921 Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Fri, 14 Apr 2017 11:25:01 -0700
+Subject: [PATCH] pwcache: Don't use fixed buffer sizes
+
+---
+ lib/libc/gen/pwcache.c | 37 +++++++++++++++++++------------------
+ 1 file changed, 19 insertions(+), 18 deletions(-)
+
+diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c
+index 743cad456..fa5a22f4d 100644
+--- a/lib/libc/gen/pwcache.c
++++ b/lib/libc/gen/pwcache.c
+@@ -33,6 +33,7 @@
+ #include <grp.h>
+ #include <pwd.h>
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+
+ #define NCACHE 16 /* power of 2 */
+@@ -46,26 +47,26 @@ user_from_uid(uid_t uid, int nouser)
+ static struct ncache {
+ uid_t uid;
+ short noname;
+- char name[_PW_NAME_LEN + 1];
++ char *name;
+ } c_uid[NLINES * NCACHE];
+- char pwbuf[_PW_BUF_LEN];
+- struct passwd pwstore, *pw;
++ static char nbuf[15]; /* 32 bits == 10 digits */
++ struct passwd *pw;
+ struct ncache *cp;
+ unsigned int i;
+
+ for (i = 0; i < NLINES; i++) {
+ cp = &c_uid[IDX(uid, i)];
+- if (!*cp->name) {
++ if (cp->name == NULL) {
+ fillit:
+ cp->uid = uid;
+- pw = NULL;
+- getpwuid_r(uid, &pwstore, pwbuf, sizeof(pwbuf), &pw);
++ pw = getpwuid(uid);
+ if (pw == NULL) {
+- snprintf(cp->name, sizeof(cp->name), "%u", uid);
++ snprintf(nbuf, sizeof(nbuf), "%u", uid);
+ cp->noname = 1;
+- } else {
+- strlcpy(cp->name, pw->pw_name, sizeof(cp->name));
+ }
++ if (cp->name != NULL)
++ free(cp->name);
++ cp->name = strdup(pw ? pw->pw_name : nbuf);
+ }
+ if (cp->uid == uid) {
+ if (nouser && cp->noname)
+@@ -91,26 +92,26 @@ group_from_gid(gid_t gid, int nogroup)
+ static struct ncache {
+ gid_t gid;
+ short noname;
+- char name[_PW_NAME_LEN + 1];
++ char *name;
+ } c_gid[NLINES * NCACHE];
+- char grbuf[_GR_BUF_LEN];
+- struct group grstore, *gr;
++ static char nbuf[15]; /* 32 bits == 10 digits */
++ struct group *gr;
+ struct ncache *cp;
+ unsigned int i;
+
+ for (i = 0; i < NLINES; i++) {
+ cp = &c_gid[IDX(gid, i)];
+- if (!*cp->name) {
++ if (cp->name == NULL) {
+ fillit:
+ cp->gid = gid;
+- gr = NULL;
+- getgrgid_r(gid, &grstore, grbuf, sizeof(grbuf), &gr);
++ gr = getgrgid(gid);
+ if (gr == NULL) {
+- snprintf(cp->name, sizeof(cp->name), "%u", gid);
++ snprintf(nbuf, sizeof(nbuf), "%u", gid);
+ cp->noname = 1;
+- } else {
+- strlcpy(cp->name, gr->gr_name, sizeof(cp->name));
+ }
++ if (cp->name != NULL)
++ free(cp->name);
++ cp->name = strdup(gr ? gr->gr_name : nbuf);
+ }
+ if (cp->gid == gid) {
+ if (nogroup && cp->noname)
+--
+2.12.2
+
diff --git a/pkg/openbsd/patch/0018-Use-explicit_bzero-reallocarray-instead-of-recalloca.patch b/pkg/openbsd/patch/0018-Use-explicit_bzero-reallocarray-instead-of-recalloca.patch
new file mode 100644
index 00000000..9c8b684a
--- /dev/null
+++ b/pkg/openbsd/patch/0018-Use-explicit_bzero-reallocarray-instead-of-recalloca.patch
@@ -0,0 +1,42 @@
+From fcc6087729cc9b0514008876780782e2d1e5afbd Mon Sep 17 00:00:00 2001
+From: Michael Forney <mforney@mforney.org>
+Date: Fri, 14 Apr 2017 11:56:51 -0700
+Subject: [PATCH] Use explicit_bzero + reallocarray instead of recallocarray
+
+---
+ lib/libc/gen/fts.c | 4 ++--
+ usr.bin/patch/pch.c | 3 ++-
+ 2 files changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/lib/libc/gen/fts.c b/lib/libc/gen/fts.c
+index f41254c71..6f10c534f 100644
+--- a/lib/libc/gen/fts.c
++++ b/lib/libc/gen/fts.c
+@@ -967,8 +967,8 @@ fts_palloc(FTS *sp, size_t more)
+ errno = ENAMETOOLONG;
+ return (1);
+ }
+- p = recallocarray(sp->fts_path, sp->fts_pathlen,
+- sp->fts_pathlen + more, 1);
++ explicit_bzero(sp->fts_path, sp->fts_pathlen);
++ p = realloc(sp->fts_path, sp->fts_pathlen + more);
+ if (p == NULL) {
+ free(sp->fts_path);
+ sp->fts_path = NULL;
+diff --git a/usr.bin/patch/pch.c b/usr.bin/patch/pch.c
+index 251dd7c58..5c69ba281 100644
+--- a/usr.bin/patch/pch.c
++++ b/usr.bin/patch/pch.c
+@@ -157,7 +157,8 @@ grow_hunkmax(void)
+ if (new_p_len == NULL)
+ free(p_len);
+
+- new_p_char = recallocarray(p_char, hunkmax, new_hunkmax, sizeof(char));
++ explicit_bzero(p_char, hunkmax);
++ new_p_char = reallocarray(p_char, new_hunkmax, sizeof(char));
+ if (new_p_char == NULL)
+ free(p_char);
+
+--
+2.12.2
+
diff --git a/pkg/openbsd/rev b/pkg/openbsd/rev
index b4de3947..48082f72 100644
--- a/pkg/openbsd/rev
+++ b/pkg/openbsd/rev
@@ -1 +1 @@
-11
+12
diff --git a/pkg/openbsd/sha256 b/pkg/openbsd/sha256
index 4a497a70..a7820d45 100644
--- a/pkg/openbsd/sha256
+++ b/pkg/openbsd/sha256
@@ -1,2 +1,2 @@
-bcb1cc9fafe2f03ce52455bf07d5cdc90b26ee2550fba1598e938a5fb077b959 src.tar.gz
-2e10bf43f5d649a7b58f95c70848ef792fff159affbac5b6c14838cbf4f8b7fa sys.tar.gz
+3f3133369f8652cfaf9dafbe42952fc130b27ce51b63d3b474b48997d4c2e87a src.tar.gz
+941196277c2de814f3acc014e09798f92f490181a5e6cb09af86d41d6268f985 sys.tar.gz
diff --git a/pkg/openbsd/url b/pkg/openbsd/url
index 694db5e3..058d3305 100644
--- a/pkg/openbsd/url
+++ b/pkg/openbsd/url
@@ -1,5 +1,5 @@
remote-name
-url = "http://mirrors.sonic.net/pub/OpenBSD/6.0/src.tar.gz"
+url = "http://mirrors.sonic.net/pub/OpenBSD/6.1/src.tar.gz"
remote-name
-url = "http://mirrors.sonic.net/pub/OpenBSD/6.0/sys.tar.gz"
+url = "http://mirrors.sonic.net/pub/OpenBSD/6.1/sys.tar.gz"