commit: 3838ad3380912036fe7c6b9e912e3bf07257357b
parent 6156b3e1c5da8a9d356d6f063f3a5b2ed11f5ef0
Author: Michael Forney <mforney@mforney.org>
Date: Thu, 1 Nov 2018 22:22:51 -0700
openbsd: Update to 6.4
Diffstat:
12 files changed, 117 insertions(+), 131 deletions(-)
diff --git a/pkg/openbsd/gen.lua b/pkg/openbsd/gen.lua
@@ -83,7 +83,7 @@ man{'usr.bin/patch/patch.1'}
-- pax
exe('pax', [[bin/pax/(
- ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c
+ ar_io.c ar_subs.c buf_subs.c cpio.c file_subs.c ftree.c
gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c tables.c
tar.c tty_subs.c
) libbsd.a]])
diff --git a/pkg/openbsd/include/grp.h b/pkg/openbsd/include/grp.h
@@ -1,3 +1,4 @@
#include_next <grp.h>
#define setgroupent(n) setgrent()
-char *group_from_gid(gid_t, int);
+const char *group_from_gid(gid_t, int);
+int gid_from_group(const char *, gid_t *);
diff --git a/pkg/openbsd/include/pwd.h b/pkg/openbsd/include/pwd.h
@@ -1,3 +1,4 @@
#include_next <pwd.h>
#define setpassent(n) setpwent()
-char *user_from_uid(uid_t, int);
+const char *user_from_uid(uid_t, int);
+int uid_from_user(const char *, uid_t *);
diff --git a/pkg/openbsd/include/unistd.h b/pkg/openbsd/include/unistd.h
@@ -1,3 +1,4 @@
#include_next <unistd.h>
-#define pledge(request, paths) 0 /* linux doesn't have pledge */
+#define pledge(request, paths) 0 /* linux doesn't have pledge */
+#define unveil(path, permissions) 0 /* linux doesn't have unveil */
int getentropy(void *, size_t);
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
@@ -1,4 +1,4 @@
-From 3c6a27e7ab65ee24222db9513f2a352774644944 Mon Sep 17 00:00:00 2001
+From e2ca2e2a530e61e8af65dca829aa1fcad5c59a7d 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,10 +8,10 @@ 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 ca46ba50a..8be03f408 100644
+index f6b3634369a..3d50e051075 100644
--- a/bin/pax/pax.c
+++ b/bin/pax/pax.c
-@@ -91,7 +91,7 @@ char *dirptr; /* destination dir in a copy */
+@@ -93,7 +93,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 */
@@ -20,7 +20,7 @@ index ca46ba50a..8be03f408 100644
int listfd = STDERR_FILENO; /* fd matching listf, for sighandler output */
char *tempfile; /* tempfile to use for mkstemp(3) */
char *tempbase; /* basename of tempfile to use for mkstemp(3) */
-@@ -222,6 +222,8 @@ main(int argc, char **argv)
+@@ -224,6 +224,8 @@ main(int argc, char **argv)
char *tmpdir;
size_t tdlen;
@@ -30,5 +30,5 @@ index ca46ba50a..8be03f408 100644
* Keep a reference to cwd, so we can always come back home.
*/
--
-2.12.2
+2.19.0
diff --git a/pkg/openbsd/patch/0008-patch-Add-missing-includes.patch b/pkg/openbsd/patch/0008-patch-Add-missing-includes.patch
@@ -1,27 +1,14 @@
-From d0261effc519faf5a2d0f5a6835a0242f8f90d02 Mon Sep 17 00:00:00 2001
+From 299d570c708b33349131b8ca925c3e9bb733db84 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
---
- usr.bin/patch/inp.c | 1 +
usr.bin/patch/patch.c | 1 +
- 2 files changed, 2 insertions(+)
+ 1 file changed, 1 insertion(+)
-diff --git a/usr.bin/patch/inp.c b/usr.bin/patch/inp.c
-index 45f89d29d..5b30f4435 100644
---- a/usr.bin/patch/inp.c
-+++ b/usr.bin/patch/inp.c
-@@ -32,6 +32,7 @@
- #include <sys/mman.h>
-
- #include <ctype.h>
-+#include <fcntl.h>
- #include <libgen.h>
- #include <stddef.h>
- #include <stdint.h>
diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c
-index 8f8f8cd4e..8087a2194 100644
+index 0cb924db733..17b3aa4e23a 100644
--- a/usr.bin/patch/patch.c
+++ b/usr.bin/patch/patch.c
@@ -26,6 +26,7 @@
@@ -33,5 +20,5 @@ index 8f8f8cd4e..8087a2194 100644
#include <sys/stat.h>
#include <unistd.h>
--
-2.12.2
+2.19.0
diff --git a/pkg/openbsd/patch/0016-doas-Port-to-linux-musl.patch b/pkg/openbsd/patch/0016-doas-Port-to-linux-musl.patch
@@ -1,4 +1,4 @@
-From a7af02ecbf949ff0327320994d5dcfda0c0e5f82 Mon Sep 17 00:00:00 2001
+From 6cfb637821716082e7ab7e8bec3300d1dc01e4d8 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
@@ -30,7 +30,7 @@ Call openlog at start to set syslog identity.
create mode 100644 usr.bin/doas/persist.c
diff --git a/usr.bin/doas/doas.1 b/usr.bin/doas/doas.1
-index d39c4aab2..3097991bc 100644
+index d39c4aab2d5..3097991bc68 100644
--- a/usr.bin/doas/doas.1
+++ b/usr.bin/doas/doas.1
@@ -22,7 +22,6 @@
@@ -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 9ec4257df..ecce4b7f1 100644
+index f20f5d35b69..1080edc5bbc 100644
--- a/usr.bin/doas/doas.c
+++ b/usr.bin/doas/doas.c
@@ -20,8 +20,6 @@
@@ -165,7 +165,7 @@ index 9ec4257df..ecce4b7f1 100644
close(fd);
}
}
-@@ -242,14 +259,13 @@ good:
+@@ -280,14 +297,13 @@ done:
int
main(int argc, char **argv)
{
@@ -182,7 +182,7 @@ index 9ec4257df..ecce4b7f1 100644
struct passwd *pw;
const struct rule *rule;
uid_t uid;
-@@ -261,28 +277,20 @@ main(int argc, char **argv)
+@@ -299,28 +315,20 @@ main(int argc, char **argv)
int nflag = 0;
char cwdpath[PATH_MAX];
const char *cwd;
@@ -214,7 +214,7 @@ index 9ec4257df..ecce4b7f1 100644
case 'u':
if (parseuid(optarg, &target) != 0)
errx(1, "unknown user");
-@@ -352,16 +360,16 @@ main(int argc, char **argv)
+@@ -390,16 +398,16 @@ main(int argc, char **argv)
cmd = argv[0];
if (!permit(uid, groups, ngroups, &rule, target, cmd,
(const char **)argv + 1)) {
@@ -234,8 +234,8 @@ index 9ec4257df..ecce4b7f1 100644
+ authuser(myname, rule->options & PERSIST);
}
- if (pledge("stdio rpath getpw exec id", NULL) == -1)
-@@ -371,10 +379,12 @@ main(int argc, char **argv)
+ if (unveil(_PATH_LOGIN_CONF, "r") == -1)
+@@ -418,10 +426,12 @@ main(int argc, char **argv)
if (!pw)
errx(1, "no passwd entry for target");
@@ -252,7 +252,7 @@ index 9ec4257df..ecce4b7f1 100644
if (pledge("stdio rpath exec", NULL) == -1)
err(1, "pledge");
-@@ -387,7 +397,7 @@ main(int argc, char **argv)
+@@ -434,7 +444,7 @@ main(int argc, char **argv)
if (pledge("stdio exec", NULL) == -1)
err(1, "pledge");
@@ -262,7 +262,7 @@ index 9ec4257df..ecce4b7f1 100644
envp = prepenv(rule);
diff --git a/usr.bin/doas/doas.h b/usr.bin/doas/doas.h
-index cbeb33994..b1a4c8199 100644
+index cbeb3399419..b1a4c819954 100644
--- a/usr.bin/doas/doas.h
+++ b/usr.bin/doas/doas.h
@@ -31,6 +31,10 @@ extern int parse_errors;
@@ -277,7 +277,7 @@ index cbeb33994..b1a4c8199 100644
#define DENY 2
diff --git a/usr.bin/doas/parse.y b/usr.bin/doas/parse.y
-index fde406bcf..474415859 100644
+index dd9466e5f13..d1f698c7679 100644
--- a/usr.bin/doas/parse.y
+++ b/usr.bin/doas/parse.y
@@ -19,6 +19,7 @@
@@ -290,7 +290,7 @@ index fde406bcf..474415859 100644
#include <stdio.h>
diff --git a/usr.bin/doas/persist.c b/usr.bin/doas/persist.c
new file mode 100644
-index 000000000..41fa74745
+index 00000000000..41fa747458b
--- /dev/null
+++ b/usr.bin/doas/persist.c
@@ -0,0 +1,133 @@
@@ -428,5 +428,5 @@ index 000000000..41fa74745
+ return 0;
+}
--
-2.18.0
+2.19.1
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
@@ -1,96 +1,92 @@
-From 145b2b78355f1024c1bb2c179ca2b947dded7921 Mon Sep 17 00:00:00 2001
+From ab480e176692b91f2fb6fb9ea2e1725d980d805d 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(-)
+ lib/libc/gen/pwcache.c | 20 ++++++++------------
+ 1 file changed, 8 insertions(+), 12 deletions(-)
diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c
-index 743cad456..fa5a22f4d 100644
+index d54daa08cc7..2f30f4b966b 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>
+@@ -202,8 +202,7 @@ grptb_start(void)
+ const char *
+ user_from_uid(uid_t uid, int noname)
+ {
+- struct passwd pwstore, *pw = NULL;
+- char pwbuf[_PW_BUF_LEN];
++ struct passwd *pw;
+ UIDC **pptr, *ptr = NULL;
+
+ if ((uidtb != NULL) || (uidtb_start() == 0)) {
+@@ -226,7 +225,7 @@ user_from_uid(uid_t uid, int noname)
+ *pptr = ptr = malloc(sizeof(UIDC));
+ }
+
+- getpwuid_r(uid, &pwstore, pwbuf, sizeof(pwbuf), &pw);
++ pw = getpwuid(uid);
+ if (pw == NULL) {
+ /*
+ * no match for this uid in the local password file
+@@ -263,8 +262,7 @@ user_from_uid(uid_t uid, int noname)
+ const char *
+ group_from_gid(gid_t gid, int noname)
+ {
+- struct group grstore, *gr = NULL;
+- char grbuf[_GR_BUF_LEN];
++ struct group *gr;
+ GIDC **pptr, *ptr = NULL;
+
+ if ((gidtb != NULL) || (gidtb_start() == 0)) {
+@@ -287,7 +285,7 @@ group_from_gid(gid_t gid, int noname)
+ *pptr = ptr = malloc(sizeof(GIDC));
+ }
- #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];
+- getgrgid_r(gid, &grstore, grbuf, sizeof(grbuf), &gr);
++ gr = getgrgid(gid);
+ if (gr == NULL) {
+ /*
+ * no match for this gid in the local group file, put in
+@@ -322,8 +320,7 @@ group_from_gid(gid_t gid, int noname)
+ int
+ uid_from_user(const char *name, uid_t *uid)
+ {
+- struct passwd pwstore, *pw = NULL;
- 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;
+ UIDC **pptr, *ptr = NULL;
+ size_t namelen;
- 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];
+@@ -357,7 +354,7 @@ uid_from_user(const char *name, uid_t *uid)
+ * no match, look it up, if no match store it as an invalid entry,
+ * or store the matching uid
+ */
+- getpwnam_r(name, &pwstore, pwbuf, sizeof(pwbuf), &pw);
++ pw = getpwnam(name);
+ if (ptr == NULL) {
+ if (pw == NULL)
+ return -1;
+@@ -383,8 +380,7 @@ uid_from_user(const char *name, uid_t *uid)
+ int
+ gid_from_group(const char *name, gid_t *gid)
+ {
+- struct group grstore, *gr = NULL;
- 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;
+ GIDC **pptr, *ptr = NULL;
+ size_t namelen;
- 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)
+@@ -418,7 +414,7 @@ gid_from_group(const char *name, gid_t *gid)
+ * no match, look it up, if no match store it as an invalid entry,
+ * or store the matching gid
+ */
+- getgrnam_r(name, &grstore, grbuf, sizeof(grbuf), &gr);
++ gr = getgrnam(name);
+ if (ptr == NULL) {
+ if (gr == NULL)
+ return -1;
--
-2.12.2
+2.19.0
diff --git a/pkg/openbsd/patch/0019-nc-Port-to-linux.patch b/pkg/openbsd/patch/0019-nc-Port-to-linux.patch
@@ -1,4 +1,4 @@
-From 5c2d730713faaf09febc887e5d6e51e4f65e9c9d Mon Sep 17 00:00:00 2001
+From 0d05008cdf8188f66789de23e581d46608ad036b Mon Sep 17 00:00:00 2001
From: Michael Forney <mforney@mforney.org>
Date: Fri, 16 Jun 2017 20:32:42 -0700
Subject: [PATCH] nc: Port to linux
@@ -8,7 +8,7 @@ Subject: [PATCH] nc: Port to linux
1 file changed, 31 insertions(+), 14 deletions(-)
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
-index fcc38897c..632ba4b1f 100644
+index 3798dc760f1..6cbf346ed10 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -73,6 +73,31 @@
@@ -72,10 +72,10 @@ index fcc38897c..632ba4b1f 100644
- if (setrtable(rtableid) == -1)
- err(1, "setrtable");
-
- if (family == AF_UNIX) {
- if (pledge("stdio rpath wpath cpath tmppath unix", NULL) == -1)
- err(1, "pledge");
-@@ -901,8 +915,12 @@ remote_connect(const char *host, const char *port, struct addrinfo hints)
+ /* Cruft to make sure options are clean, and used properly. */
+ if (argv[0] && !argv[1] && family == AF_UNIX) {
+ host = argv[0];
+@@ -923,8 +937,12 @@ remote_connect(const char *host, const char *port, struct addrinfo hints)
if (sflag || pflag) {
struct addrinfo ahints, *ares;
@@ -89,7 +89,7 @@ index fcc38897c..632ba4b1f 100644
memset(&ahints, 0, sizeof(struct addrinfo));
ahints.ai_family = res->ai_family;
ahints.ai_socktype = uflag ? SOCK_DGRAM : SOCK_STREAM;
-@@ -1732,7 +1750,6 @@ help(void)
+@@ -1754,7 +1772,6 @@ help(void)
\t-t Answer TELNET negotiation\n\
\t-U Use UNIX domain socket\n\
\t-u UDP mode\n\
@@ -97,7 +97,7 @@ index fcc38897c..632ba4b1f 100644
\t-v Verbose\n\
\t-W recvlimit Terminate after receiving a number of packets\n\
\t-w timeout Timeout for connects and final net reads\n\
-@@ -1753,7 +1770,7 @@ usage(int ret)
+@@ -1775,7 +1792,7 @@ usage(int ret)
"\t [-i interval] [-K keyfile] [-M ttl] [-m minttl] [-O length]\n"
"\t [-o staplefile] [-P proxy_username] [-p source_port] "
"[-R CAfile]\n"
@@ -107,5 +107,5 @@ index fcc38897c..632ba4b1f 100644
"\t [-X proxy_protocol] [-x proxy_address[:port]] "
"[-Z peercertfile]\n"
--
-2.16.2
+2.19.0
diff --git a/pkg/openbsd/rev b/pkg/openbsd/rev
@@ -1 +1 @@
-20
+21
diff --git a/pkg/openbsd/sha256 b/pkg/openbsd/sha256
@@ -1,2 +1,2 @@
-23f9905b26f1dfd981c2f89a46cbcf2d25c3fa75167efc34da96c60af9f71274 src.tar.gz
-ac9729a0c7b845b68e76e0b5f0ac2a8f874c486f84bbb369d5e5954a8f762d4b sys.tar.gz
+26b63181a7cc90418a2ca5ac87e2d32fb65ad23bdca8a07502edaf431abb6aa2 src.tar.gz
+95c6eb2c7fee014a38bf376198e8fe4f9bc7702dac9c0b1ead483383cca858dc sys.tar.gz
diff --git a/pkg/openbsd/url b/pkg/openbsd/url
@@ -1,5 +1,5 @@
remote-name
-url = "https://fastly.cdn.openbsd.org/pub/OpenBSD/6.3/src.tar.gz"
+url = "https://fastly.cdn.openbsd.org/pub/OpenBSD/6.4/src.tar.gz"
remote-name
-url = "https://fastly.cdn.openbsd.org/pub/OpenBSD/6.3/sys.tar.gz"
+url = "https://fastly.cdn.openbsd.org/pub/OpenBSD/6.4/sys.tar.gz"