switch Xorg protos to xorgproto 2018.4

2019-02-10 Thread Matthieu Herrb
Hi,

I've recently imported xorgproto 2018.4 in xenocara. This is a package
the unifies all the previous *proto packages from X.Org (except
xcb-proto which is special), and enabled it yesterday.

I had to revert that last commit since it is suspected to be the cause
for this regression mentionned on misc:
https://marc.infœ?l=openbsd-misc&m=154983711329128&w=2

So please test the following diff for other possible regressions,
while we're looking at the compton issue.

Index: Makefile
===
RCS file: /cvs/xenocara/proto/Makefile,v
retrieving revision 1.17
diff -u -r1.17 Makefile
--- Makefile10 Feb 2019 23:07:47 -  1.17
+++ Makefile11 Feb 2019 00:05:49 -
@@ -2,17 +2,7 @@
 
 .include 
 
-SUBDIR= bigreqsproto compositeproto dmxproto damageproto \
-   fixesproto fontsproto glproto inputproto \
-   kbproto pmproto xineramaproto presentproto randrproto \
-   recordproto renderproto resourceproto scrnsaverproto \
-   videoproto x11proto xcb-proto xcmiscproto xextproto \
-   xf86bigfontproto xf86dgaproto \
-   xf86vidmodeproto
-
-.if ${XENOCARA_BUILD_DRI:L} == "yes"
-SUBDIR+= xf86driproto dri2proto dri3proto
-.endif
+SUBDIR= xcb-proto xorgproto
 
 .include 
 
-- 
Matthieu Herrb



xtsscale - use abs() for integers

2019-02-10 Thread Matthieu Herrb
Noticed by clang warning.

ok ?

Index: xtsscale.c
===
RCS file: /cvs/OpenBSD/xenocara/app/xtsscale/xtsscale.c,v
retrieving revision 1.23
diff -u -r1.23 xtsscale.c
--- xtsscale.c  6 Mar 2012 23:24:37 -   1.23
+++ xtsscale.c  10 Feb 2019 15:53:44 -
@@ -732,7 +732,7 @@
cleanup_exit(device);
 
/* Check if  X and Y should be swapped */
-   if (fabs(x[0] - x[1]) > fabs(y[0] - y[1])) {
+   if (abs(x[0] - x[1]) > abs(y[0] - y[1])) {
 
calib.swapxy = 1;
 

-- 
Matthieu Herrb



Re: install(1) broken

2019-02-10 Thread Ted Unangst
Marc Espie wrote:
> Something similar to this  perhaps ?
> Not fully tested yet, but it should avoid the race of trying to 
> unlink tempfile several times, and also fix the file name in error messages.

That's probably better.



Re: spelling correction

2019-02-10 Thread Sebastian Benoit
Peter Hessler(phess...@theapt.org) on 2019.02.10 17:27:09 +0100:
> $ grep -c nonexistant /usr/share/dict/words 
> 0
> $ grep -c nonexistent /usr/share/dict/words
> 2
> 
> OK
> 
> or if someone else wants to give me an OK I can commit this.

ok.

I have checked that /usr/share/man/nonexistent does indeed
not.

> 
> 
> 
> On 2019 Feb 10 (Sun) at 11:13:04 -0500 (-0500), Pamela Mosiejczuk wrote:
> :Hi,
> :I noticed "non-existant" crop up in an error message and went hunting
> :for other examples. This is a possible set of corrections.
> :
> :Thanks,
> :Pamela
> :
> :
> :
> :Index: lib/libssl/d1_both.c
> :===
> :RCS file: /cvs/src/lib/libssl/d1_both.c,v
> :retrieving revision 1.56
> :diff -u -p -r1.56 d1_both.c
> :--- lib/libssl/d1_both.c 8 Nov 2018 22:28:52 -   1.56
> :+++ lib/libssl/d1_both.c 10 Feb 2019 15:54:50 -
> :@@ -1046,7 +1046,7 @@ dtls1_retransmit_message(SSL *s, unsigne
> : item = pqueue_find(s->d1->sent_messages, seq64be);
> : if (item == NULL) {
> : #ifdef DEBUG
> :-fprintf(stderr, "retransmit:  message %d non-existant\n", seq);
> :+fprintf(stderr, "retransmit:  message %d non-existent\n", seq);
> : #endif
> : *found = 0;
> : return 0;
> :Index: regress/sys/kern/unveil/syscalls.c
> :===
> :RCS file: /cvs/src/regress/sys/kern/unveil/syscalls.c,v
> :retrieving revision 1.20
> :diff -u -p -r1.20 syscalls.c
> :--- regress/sys/kern/unveil/syscalls.c   17 Jan 2019 03:26:19 -  
> 1.20
> :+++ regress/sys/kern/unveil/syscalls.c   10 Feb 2019 15:54:53 -
> :@@ -605,8 +605,8 @@ static int
> : test_stat2(int do_uv)
> : {
> : if (do_uv) {
> :-printf("testing stat components to nonexistant \"rw\"\n");
> :-if (unveil("/usr/share/man/nonexistant", "rw") == -1)
> :+printf("testing stat components to nonexistent \"rw\"\n");
> :+if (unveil("/usr/share/man/nonexistent", "rw") == -1)
> : err(1, "%s:%d - unveil", __FILE__, __LINE__);
> : }
> : struct stat sb;
> :@@ -616,7 +616,7 @@ test_stat2(int do_uv)
> : UV_SHOULD_SUCCEED((stat("/usr", &sb) == -1), "stat");
> : UV_SHOULD_SUCCEED((stat("/usr/share", &sb) == -1), "stat");
> : UV_SHOULD_SUCCEED((stat("/usr/share/man", &sb) == -1), "stat");
> :-UV_SHOULD_ENOENT((stat("/usr/share/man/nonexistant", &sb) == -1), 
> "stat");
> :+UV_SHOULD_ENOENT((stat("/usr/share/man/nonexistent", &sb) == -1), 
> "stat");
> : return 0;
> : }
> : 
> :Index: sys/net/if_pfsync.c
> :===
> :RCS file: /cvs/src/sys/net/if_pfsync.c,v
> :retrieving revision 1.261
> :diff -u -p -r1.261 if_pfsync.c
> :--- sys/net/if_pfsync.c  3 Oct 2018 01:24:14 -   1.261
> :+++ sys/net/if_pfsync.c  10 Feb 2019 15:55:00 -
> :@@ -2062,7 +2062,7 @@ pfsync_update_state_req(struct pf_state 
> : struct pfsync_softc *sc = pfsyncif;
> : 
> : if (sc == NULL)
> :-panic("pfsync_update_state_req: nonexistant instance");
> :+panic("pfsync_update_state_req: nonexistent instance");
> : 
> : if (ISSET(st->state_flags, PFSTATE_NOSYNC)) {
> : if (st->sync_state != PFSYNC_S_NONE)
> :Index: sys/scsi/mpath.c
> :===
> :RCS file: /cvs/src/sys/scsi/mpath.c,v
> :retrieving revision 1.41
> :diff -u -p -r1.41 mpath.c
> :--- sys/scsi/mpath.c 23 Aug 2015 01:55:39 -  1.41
> :+++ sys/scsi/mpath.c 10 Feb 2019 15:55:00 -
> :@@ -189,7 +189,7 @@ mpath_cmd(struct scsi_xfer *xs)
> : 
> : #ifdef DIAGNOSTIC
> : if (d == NULL)
> :-panic("mpath_cmd issued against nonexistant device");
> :+panic("mpath_cmd issued against nonexistent device");
> : #endif
> : 
> : if (ISSET(xs->flags, SCSI_POLL)) {
> :@@ -404,7 +404,7 @@ mpath_minphys(struct buf *bp, struct scs
> : 
> : #ifdef DIAGNOSTIC
> : if (d == NULL)
> :-panic("mpath_minphys against nonexistant device");
> :+panic("mpath_minphys against nonexistent device");
> : #endif
> : 
> : mtx_enter(&d->d_mtx);
> :@@ -548,7 +548,7 @@ mpath_path_detach(struct mpath_path *p)
> : 
> : #ifdef DIAGNOSTIC
> : if (g == NULL)
> :-panic("mpath: detaching a path from a nonexistant bus");
> :+panic("mpath: detaching a path from a nonexistent bus");
> : #endif
> : d = g->g_dev;
> : p->p_group = NULL;
> :Index: sys/uvm/uvm_map.c
> :===
> :RCS file: /cvs/src/sys/uvm/uvm_map.c,v
> :retrieving revision 1.239
> :diff -u -p -r1.239 uvm_map.c
> :--- sys/uvm/uvm_map.c31 Oct 2018 08:50:25 -  1.239
> :+++ sys/uvm/uvm_map.c10 Feb 2019 15:55:03 -
> :@@ -1491,7 +1491,7 @@ uvm_mapent_merge(struct vm_map *map, str
> :  * Attempt 

Re: spelling correction

2019-02-10 Thread Peter Hessler
$ grep -c nonexistant /usr/share/dict/words 
0
$ grep -c nonexistent /usr/share/dict/words
2

OK

or if someone else wants to give me an OK I can commit this.



On 2019 Feb 10 (Sun) at 11:13:04 -0500 (-0500), Pamela Mosiejczuk wrote:
:Hi,
:I noticed "non-existant" crop up in an error message and went hunting
:for other examples. This is a possible set of corrections.
:
:Thanks,
:Pamela
:
:
:
:Index: lib/libssl/d1_both.c
:===
:RCS file: /cvs/src/lib/libssl/d1_both.c,v
:retrieving revision 1.56
:diff -u -p -r1.56 d1_both.c
:--- lib/libssl/d1_both.c   8 Nov 2018 22:28:52 -   1.56
:+++ lib/libssl/d1_both.c   10 Feb 2019 15:54:50 -
:@@ -1046,7 +1046,7 @@ dtls1_retransmit_message(SSL *s, unsigne
:   item = pqueue_find(s->d1->sent_messages, seq64be);
:   if (item == NULL) {
: #ifdef DEBUG
:-  fprintf(stderr, "retransmit:  message %d non-existant\n", seq);
:+  fprintf(stderr, "retransmit:  message %d non-existent\n", seq);
: #endif
:   *found = 0;
:   return 0;
:Index: regress/sys/kern/unveil/syscalls.c
:===
:RCS file: /cvs/src/regress/sys/kern/unveil/syscalls.c,v
:retrieving revision 1.20
:diff -u -p -r1.20 syscalls.c
:--- regress/sys/kern/unveil/syscalls.c 17 Jan 2019 03:26:19 -  1.20
:+++ regress/sys/kern/unveil/syscalls.c 10 Feb 2019 15:54:53 -
:@@ -605,8 +605,8 @@ static int
: test_stat2(int do_uv)
: {
:   if (do_uv) {
:-  printf("testing stat components to nonexistant \"rw\"\n");
:-  if (unveil("/usr/share/man/nonexistant", "rw") == -1)
:+  printf("testing stat components to nonexistent \"rw\"\n");
:+  if (unveil("/usr/share/man/nonexistent", "rw") == -1)
:   err(1, "%s:%d - unveil", __FILE__, __LINE__);
:   }
:   struct stat sb;
:@@ -616,7 +616,7 @@ test_stat2(int do_uv)
:   UV_SHOULD_SUCCEED((stat("/usr", &sb) == -1), "stat");
:   UV_SHOULD_SUCCEED((stat("/usr/share", &sb) == -1), "stat");
:   UV_SHOULD_SUCCEED((stat("/usr/share/man", &sb) == -1), "stat");
:-  UV_SHOULD_ENOENT((stat("/usr/share/man/nonexistant", &sb) == -1), 
"stat");
:+  UV_SHOULD_ENOENT((stat("/usr/share/man/nonexistent", &sb) == -1), 
"stat");
:   return 0;
: }
: 
:Index: sys/net/if_pfsync.c
:===
:RCS file: /cvs/src/sys/net/if_pfsync.c,v
:retrieving revision 1.261
:diff -u -p -r1.261 if_pfsync.c
:--- sys/net/if_pfsync.c3 Oct 2018 01:24:14 -   1.261
:+++ sys/net/if_pfsync.c10 Feb 2019 15:55:00 -
:@@ -2062,7 +2062,7 @@ pfsync_update_state_req(struct pf_state 
:   struct pfsync_softc *sc = pfsyncif;
: 
:   if (sc == NULL)
:-  panic("pfsync_update_state_req: nonexistant instance");
:+  panic("pfsync_update_state_req: nonexistent instance");
: 
:   if (ISSET(st->state_flags, PFSTATE_NOSYNC)) {
:   if (st->sync_state != PFSYNC_S_NONE)
:Index: sys/scsi/mpath.c
:===
:RCS file: /cvs/src/sys/scsi/mpath.c,v
:retrieving revision 1.41
:diff -u -p -r1.41 mpath.c
:--- sys/scsi/mpath.c   23 Aug 2015 01:55:39 -  1.41
:+++ sys/scsi/mpath.c   10 Feb 2019 15:55:00 -
:@@ -189,7 +189,7 @@ mpath_cmd(struct scsi_xfer *xs)
: 
: #ifdef DIAGNOSTIC
:   if (d == NULL)
:-  panic("mpath_cmd issued against nonexistant device");
:+  panic("mpath_cmd issued against nonexistent device");
: #endif
: 
:   if (ISSET(xs->flags, SCSI_POLL)) {
:@@ -404,7 +404,7 @@ mpath_minphys(struct buf *bp, struct scs
: 
: #ifdef DIAGNOSTIC
:   if (d == NULL)
:-  panic("mpath_minphys against nonexistant device");
:+  panic("mpath_minphys against nonexistent device");
: #endif
: 
:   mtx_enter(&d->d_mtx);
:@@ -548,7 +548,7 @@ mpath_path_detach(struct mpath_path *p)
: 
: #ifdef DIAGNOSTIC
:   if (g == NULL)
:-  panic("mpath: detaching a path from a nonexistant bus");
:+  panic("mpath: detaching a path from a nonexistent bus");
: #endif
:   d = g->g_dev;
:   p->p_group = NULL;
:Index: sys/uvm/uvm_map.c
:===
:RCS file: /cvs/src/sys/uvm/uvm_map.c,v
:retrieving revision 1.239
:diff -u -p -r1.239 uvm_map.c
:--- sys/uvm/uvm_map.c  31 Oct 2018 08:50:25 -  1.239
:+++ sys/uvm/uvm_map.c  10 Feb 2019 15:55:03 -
:@@ -1491,7 +1491,7 @@ uvm_mapent_merge(struct vm_map *map, str
:  * Attempt forward and backward joining of entry.
:  *
:  * Returns entry after joins.
:- * We are guaranteed that the amap of entry is either non-existant or
:+ * We are guaranteed that the amap of entry is either non-existent or
:  * has never been used.
:  */
: struct vm_map_entry*
:Index: usr.sbin/pkg_add/OpenBSD/PkgDelete.pm
:=

Re: install(1) broken

2019-02-10 Thread Marc Espie
Something similar to this  perhaps ?
Not fully tested yet, but it should avoid the race of trying to 
unlink tempfile several times, and also fix the file name in error messages.

Index: xinstall.c
===
RCS file: /cvs/src/usr.bin/xinstall/xinstall.c,v
retrieving revision 1.68
diff -u -p -r1.68 xinstall.c
--- xinstall.c  8 Feb 2019 12:53:44 -   1.68
+++ xinstall.c  10 Feb 2019 14:53:49 -
@@ -222,6 +222,7 @@ install(char *from_name, char *to_name, 
struct timespec ts[2];
int devnull, from_fd, to_fd, serrno, files_match = 0;
char *p;
+   char *target_name = tempfile;
 
(void)memset((void *)&from_sb, 0, sizeof(from_sb));
(void)memset((void *)&to_sb, 0, sizeof(to_sb));
@@ -311,10 +312,14 @@ install(char *from_name, char *to_name, 
} else {
files_match = 1;
(void)unlink(tempfile);
+   target_name = to_name;
+   (void)close(temp_fd);
}
}
-   (void)close(to_fd);
-   to_fd = temp_fd;
+   if (!files_match) {
+   (void)close(to_fd);
+   to_fd = temp_fd;
+   }
}
 
/*
@@ -333,13 +338,15 @@ install(char *from_name, char *to_name, 
if ((gid != (gid_t)-1 || uid != (uid_t)-1) &&
fchown(to_fd, uid, gid)) {
serrno = errno;
-   (void)unlink(tempfile);
-   errx(1, "%s: chown/chgrp: %s", tempfile, strerror(serrno));
+   if (target_name == tempfile)
+   (void)unlink(tempfile);
+   errx(1, "%s: chown/chgrp: %s", target_name, strerror(serrno));
}
if (fchmod(to_fd, mode)) {
serrno = errno;
-   (void)unlink(tempfile);
-   errx(1, "%s: chmod: %s", tempfile, strerror(serrno));
+   if (target_name == tempfile)
+   (void)unlink(tempfile);
+   errx(1, "%s: chmod: %s", target_name, strerror(serrno));
}
 
/*
@@ -349,7 +356,7 @@ install(char *from_name, char *to_name, 
if (fchflags(to_fd,
flags & SETFLAGS ? fset : from_sb.st_flags & ~UF_NODUMP)) {
if (errno != EOPNOTSUPP || (from_sb.st_flags & ~UF_NODUMP) != 0)
-   warnx("%s: chflags: %s", tempfile, strerror(errno));
+   warnx("%s: chflags: %s", target_name, strerror(errno));
}
 
if (flags & USEFSYNC)



Teach clang that long double == double on powerpc

2019-02-10 Thread Mark Kettenis
On OpenBSD/powerpc long double is the same as double.  The diff below
(from George Koehler for ports llvm) makes it so.

ok?


Index: gnu/llvm/tools/clang/lib/Basic/Targets/PPC.h
===
RCS file: /cvs/src/gnu/llvm/tools/clang/lib/Basic/Targets/PPC.h,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 PPC.h
--- gnu/llvm/tools/clang/lib/Basic/Targets/PPC.h27 Jan 2019 16:43:02 
-  1.1.1.2
+++ gnu/llvm/tools/clang/lib/Basic/Targets/PPC.h10 Feb 2019 13:45:42 
-
@@ -328,9 +328,15 @@ public:
   break;
 }
 
-if (getTriple().getOS() == llvm::Triple::FreeBSD) {
+switch (getTriple().getOS()) {
+case llvm::Triple::FreeBSD:
+case llvm::Triple::NetBSD:
+case llvm::Triple::OpenBSD:
   LongDoubleWidth = LongDoubleAlign = 64;
   LongDoubleFormat = &llvm::APFloat::IEEEdouble();
+  break;
+default:
+  break;
 }
 
 // PPC32 supports atomics up to 4 bytes.



Re: httpd logging X509 cert subject when CA option is used.

2019-02-10 Thread Sebastian Benoit
Karel Gardas(gard...@gmail.com) on 2019.02.10 14:18:00 +0100:
> 
> Any issues with the patch now?

no, i just lost track of it.

commited, thanks!

> Anything I shall improve to get that
> into acceptable/comitable state?
> 
> Thanks,
> Karel
> 
> On Fri, 1 Feb 2019 17:48:46 +0100
> Karel Gardas  wrote:
> 
> > On Fri, 1 Feb 2019 16:53:14 +0100
> > Sebastian Benoit  wrote:
> > 
> > > > +   if (clt->clt_remote_user == NULL &&
> > > > +   clt->clt_tls_ctx != NULL &&
> > > > +   (srv_conf->tls_flags & TLSFLAG_CA) &&
> > > > +   stravis(&user, 
> > > > tls_peer_cert_subject(clt->clt_tls_ctx),
> > > 
> > > tls_peer_cert_subject() can return NULL.
> > 
> > Fixed in patch below.
> > 
> > Thanks,
> > Karel
> > 
> > diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c
> > index 9b13db2bca4..f0f30b93ebc 100644
> > --- a/usr.sbin/httpd/server_http.c
> > +++ b/usr.sbin/httpd/server_http.c
> > @@ -1712,6 +1712,13 @@ server_log_http(struct client *clt, unsigned int 
> > code, size_t len)
> > if (clt->clt_remote_user &&
> > stravis(&user, clt->clt_remote_user, HTTPD_LOGVIS) == -1)
> > goto done;
> > +   if (clt->clt_remote_user == NULL &&
> > +   clt->clt_tls_ctx != NULL &&
> > +   (srv_conf->tls_flags & TLSFLAG_CA) &&
> > +   tls_peer_cert_subject(clt->clt_tls_ctx) != NULL &&
> > +   stravis(&user, tls_peer_cert_subject(clt->clt_tls_ctx),
> > +   HTTPD_LOGVIS) == -1)
> > +   goto done;
> > if (desc->http_version &&
> > stravis(&version, desc->http_version, HTTPD_LOGVIS) == -1)
> > goto done;
> > @@ -1730,7 +1737,7 @@ server_log_http(struct client *clt, unsigned int 
> > code, size_t len)
> > ret = evbuffer_add_printf(clt->clt_log,
> > "%s %s - %s [%s] \"%s %s%s%s%s%s\""
> > " %03d %zu \"%s\" \"%s\"\n",
> > -   srv_conf->name, ip, clt->clt_remote_user == NULL ? "-" :
> > +   srv_conf->name, ip, user == NULL ? "-" :
> > user, tstamp,
> > server_httpmethod_byid(desc->http_method),
> > desc->http_path == NULL ? "" : path,
> 
> 



Re: httpd logging X509 cert subject when CA option is used.

2019-02-10 Thread Karel Gardas


Any issues with the patch now? Anything I shall improve to get that
into acceptable/comitable state?

Thanks,
Karel

On Fri, 1 Feb 2019 17:48:46 +0100
Karel Gardas  wrote:

> On Fri, 1 Feb 2019 16:53:14 +0100
> Sebastian Benoit  wrote:
> 
> > > + if (clt->clt_remote_user == NULL &&
> > > + clt->clt_tls_ctx != NULL &&
> > > + (srv_conf->tls_flags & TLSFLAG_CA) &&
> > > + stravis(&user, tls_peer_cert_subject(clt->clt_tls_ctx),
> > 
> > tls_peer_cert_subject() can return NULL.
> 
> Fixed in patch below.
> 
> Thanks,
> Karel
> 
> diff --git a/usr.sbin/httpd/server_http.c b/usr.sbin/httpd/server_http.c
> index 9b13db2bca4..f0f30b93ebc 100644
> --- a/usr.sbin/httpd/server_http.c
> +++ b/usr.sbin/httpd/server_http.c
> @@ -1712,6 +1712,13 @@ server_log_http(struct client *clt, unsigned int code, 
> size_t len)
>   if (clt->clt_remote_user &&
>   stravis(&user, clt->clt_remote_user, HTTPD_LOGVIS) == -1)
>   goto done;
> + if (clt->clt_remote_user == NULL &&
> + clt->clt_tls_ctx != NULL &&
> + (srv_conf->tls_flags & TLSFLAG_CA) &&
> + tls_peer_cert_subject(clt->clt_tls_ctx) != NULL &&
> + stravis(&user, tls_peer_cert_subject(clt->clt_tls_ctx),
> + HTTPD_LOGVIS) == -1)
> + goto done;
>   if (desc->http_version &&
>   stravis(&version, desc->http_version, HTTPD_LOGVIS) == -1)
>   goto done;
> @@ -1730,7 +1737,7 @@ server_log_http(struct client *clt, unsigned int code, 
> size_t len)
>   ret = evbuffer_add_printf(clt->clt_log,
>   "%s %s - %s [%s] \"%s %s%s%s%s%s\""
>   " %03d %zu \"%s\" \"%s\"\n",
> - srv_conf->name, ip, clt->clt_remote_user == NULL ? "-" :
> + srv_conf->name, ip, user == NULL ? "-" :
>   user, tstamp,
>   server_httpmethod_byid(desc->http_method),
>   desc->http_path == NULL ? "" : path,




Re: install(1) broken

2019-02-10 Thread Marc Espie
On Sat, Feb 09, 2019 at 05:23:09PM -0500, Ted Unangst wrote:
> Marc Espie wrote:
> > hey, your commit to install(1) broke something.
> > 
> > Specifically lang/go-boostrap now produces a broken package which can't
> > be used to build go.
> > 
> > All the go/bootstrap/pkg/tool/openbsd_amd64/*
> > have lost their x bit
> > 
> > Relevant fake install information, it definitely looks like the last line
> > is now a no-op.
> 
> > # These get installed via `find' however we need them to be executable
> > /pobj/go-bootstrap-1.4.20171003/bin/install -d -m 755 
> > /pobj/go-bootstrap-1.4.20171003/fake-amd64/usr/local/go/bootstrap/pkg/tool//openbsd_amd64
> > /pobj/go-bootstrap-1.4.20171003/bin/install -c  -m 755 -p 
> > /pobj/go-bootstrap-1.4.20171003/go/pkg/tool//openbsd_amd64/* 
> > /pobj/go-bootstrap-1.4.20171003/fake-amd64/usr/local/go/bootstrap/pkg/tool//openbsd_amd64
> 
> Yes. This is a weird way to invoke chmod, but that's what it wants.
> 
> I think this was a long standing bug in install? If the files match, we need
> to continue on with to_fd == existing file so that metadata updates work.
> 
> 
> Index: xinstall.c
> ===
> RCS file: /cvs/src/usr.bin/xinstall/xinstall.c,v
> retrieving revision 1.68
> diff -u -p -r1.68 xinstall.c
> --- xinstall.c8 Feb 2019 12:53:44 -   1.68
> +++ xinstall.c9 Feb 2019 22:21:03 -
> @@ -313,8 +313,12 @@ install(char *from_name, char *to_name, 
>   (void)unlink(tempfile);
>   }
>   }
> - (void)close(to_fd);
> - to_fd = temp_fd;
> + if (!files_match) {
> + (void)close(to_fd);
> + to_fd = temp_fd;
> + } else {
> + close(temp_fd);
> + }
>   }
>  
>   /*
I'm afraid this needs to be slightly more complex, probably to put the
remaining code in its own function, or something.

Specifically, the error paths for the fchown and fchmod  will be all bogus
in that case, referring to a tempfile  that's already been removed, and
is not even the target...