-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
434 changed files
with
15,946 additions
and
3,307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
2.9.2.1 | ||
3.0.2.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: netcat.c,v 1.203 2019/02/26 17:32:47 jsing Exp $ */ | ||
/* $OpenBSD: netcat.c,v 1.206 2019/08/08 16:49:35 mestre Exp $ */ | ||
/* | ||
* Copyright (c) 2001 Eric Jackson <[email protected]> | ||
* Copyright (c) 2015 Bob Beck. All rights reserved. | ||
|
@@ -393,6 +393,7 @@ main(int argc, char *argv[]) | |
err(1, "unveil"); | ||
} | ||
} else { | ||
/* no filesystem visibility */ | ||
if (unveil("/", "") == -1) | ||
err(1, "unveil"); | ||
} | ||
|
@@ -578,7 +579,7 @@ main(int argc, char *argv[]) | |
close(s); | ||
s = local_listen(host, uport, hints); | ||
} | ||
if (s < 0) | ||
if (s == -1) | ||
err(1, NULL); | ||
if (uflag && kflag) { | ||
/* | ||
|
@@ -600,11 +601,11 @@ main(int argc, char *argv[]) | |
len = sizeof(z); | ||
rv = recvfrom(s, buf, sizeof(buf), MSG_PEEK, | ||
(struct sockaddr *)&z, &len); | ||
if (rv < 0) | ||
if (rv == -1) | ||
err(1, "recvfrom"); | ||
|
||
rv = connect(s, (struct sockaddr *)&z, len); | ||
if (rv < 0) | ||
if (rv == -1) | ||
err(1, "connect"); | ||
|
||
if (vflag) | ||
|
@@ -638,7 +639,7 @@ main(int argc, char *argv[]) | |
tls_free(tls_cctx); | ||
} | ||
if (family == AF_UNIX && uflag) { | ||
if (connect(s, NULL, 0) < 0) | ||
if (connect(s, NULL, 0) == -1) | ||
err(1, "connect"); | ||
} | ||
|
||
|
@@ -749,7 +750,7 @@ unix_bind(char *path, int flags) | |
|
||
/* Create unix domain socket. */ | ||
if ((s = socket(AF_UNIX, flags | (uflag ? SOCK_DGRAM : SOCK_STREAM), | ||
0)) < 0) | ||
0)) == -1) | ||
return -1; | ||
|
||
memset(&s_un, 0, sizeof(struct sockaddr_un)); | ||
|
@@ -762,7 +763,7 @@ unix_bind(char *path, int flags) | |
return -1; | ||
} | ||
|
||
if (bind(s, (struct sockaddr *)&s_un, sizeof(s_un)) < 0) { | ||
if (bind(s, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) { | ||
save_errno = errno; | ||
close(s); | ||
errno = save_errno; | ||
|
@@ -872,10 +873,10 @@ unix_connect(char *path) | |
int s, save_errno; | ||
|
||
if (uflag) { | ||
if ((s = unix_bind(unix_dg_tmp_socket, SOCK_CLOEXEC)) < 0) | ||
if ((s = unix_bind(unix_dg_tmp_socket, SOCK_CLOEXEC)) == -1) | ||
return -1; | ||
} else { | ||
if ((s = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) < 0) | ||
if ((s = socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)) == -1) | ||
return -1; | ||
} | ||
|
||
|
@@ -888,7 +889,7 @@ unix_connect(char *path) | |
errno = ENAMETOOLONG; | ||
return -1; | ||
} | ||
if (connect(s, (struct sockaddr *)&s_un, sizeof(s_un)) < 0) { | ||
if (connect(s, (struct sockaddr *)&s_un, sizeof(s_un)) == -1) { | ||
save_errno = errno; | ||
close(s); | ||
errno = save_errno; | ||
|
@@ -907,9 +908,9 @@ unix_listen(char *path) | |
{ | ||
int s; | ||
|
||
if ((s = unix_bind(path, 0)) < 0) | ||
if ((s = unix_bind(path, 0)) == -1) | ||
return -1; | ||
if (listen(s, 5) < 0) { | ||
if (listen(s, 5) == -1) { | ||
close(s); | ||
return -1; | ||
} | ||
|
@@ -939,7 +940,7 @@ remote_connect(const char *host, const char *port, struct addrinfo hints) | |
|
||
for (res = res0; res; res = res->ai_next) { | ||
if ((s = socket(res->ai_family, res->ai_socktype | | ||
SOCK_NONBLOCK, res->ai_protocol)) < 0) | ||
SOCK_NONBLOCK, res->ai_protocol)) == -1) | ||
continue; | ||
|
||
/* Bind to a local port or source address if specified. */ | ||
|
@@ -959,7 +960,7 @@ remote_connect(const char *host, const char *port, struct addrinfo hints) | |
errx(1, "getaddrinfo: %s", gai_strerror(error)); | ||
|
||
if (bind(s, (struct sockaddr *)ares->ai_addr, | ||
ares->ai_addrlen) < 0) | ||
ares->ai_addrlen) == -1) | ||
err(1, "bind failed"); | ||
freeaddrinfo(ares); | ||
} | ||
|
@@ -1041,7 +1042,7 @@ local_listen(const char *host, const char *port, struct addrinfo hints) | |
|
||
for (res = res0; res; res = res->ai_next) { | ||
if ((s = socket(res->ai_family, res->ai_socktype, | ||
res->ai_protocol)) < 0) | ||
res->ai_protocol)) == -1) | ||
continue; | ||
|
||
#ifdef SO_REUSEPORT | ||
|
@@ -1063,7 +1064,7 @@ local_listen(const char *host, const char *port, struct addrinfo hints) | |
} | ||
|
||
if (!uflag && s != -1) { | ||
if (listen(s, 1) < 0) | ||
if (listen(s, 1) == -1) | ||
err(1, "listen"); | ||
} | ||
if (vflag && s != -1) { | ||
|
@@ -1473,12 +1474,12 @@ build_ports(char *p) | |
for (x = 0; x <= hi - lo; x++) { | ||
cp = arc4random_uniform(x + 1); | ||
portlist[x] = portlist[cp]; | ||
if (asprintf(&portlist[cp], "%d", x + lo) < 0) | ||
if (asprintf(&portlist[cp], "%d", x + lo) == -1) | ||
err(1, "asprintf"); | ||
} | ||
} else { /* Load ports sequentially. */ | ||
for (cp = lo; cp <= hi; cp++) { | ||
if (asprintf(&portlist[x], "%d", cp) < 0) | ||
if (asprintf(&portlist[x], "%d", cp) == -1) | ||
err(1, "asprintf"); | ||
x++; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $Id: http.c,v 1.11 2018/11/29 14:25:07 tedu Exp $ */ | ||
/* $Id: http.c,v 1.12 2019/06/28 13:32:49 deraadt Exp $ */ | ||
/* | ||
* Copyright (c) 2016 Kristaps Dzonsons <[email protected]> | ||
* | ||
|
@@ -72,7 +72,7 @@ dosysread(char *buf, size_t sz, const struct http *http) | |
ssize_t rc; | ||
|
||
rc = read(http->fd, buf, sz); | ||
if (rc < 0) | ||
if (rc == -1) | ||
warn("%s: read", http->src.ip); | ||
return rc; | ||
} | ||
|
@@ -83,7 +83,7 @@ dosyswrite(const void *buf, size_t sz, const struct http *http) | |
ssize_t rc; | ||
|
||
rc = write(http->fd, buf, sz); | ||
if (rc < 0) | ||
if (rc == -1) | ||
warn("%s: write", http->src.ip); | ||
return rc; | ||
} | ||
|
@@ -97,7 +97,7 @@ dotlsread(char *buf, size_t sz, const struct http *http) | |
rc = tls_read(http->ctx, buf, sz); | ||
} while (rc == TLS_WANT_POLLIN || rc == TLS_WANT_POLLOUT); | ||
|
||
if (rc < 0) | ||
if (rc == -1) | ||
warnx("%s: tls_read: %s", http->src.ip, | ||
tls_error(http->ctx)); | ||
return rc; | ||
|
@@ -112,7 +112,7 @@ dotlswrite(const void *buf, size_t sz, const struct http *http) | |
rc = tls_write(http->ctx, buf, sz); | ||
} while (rc == TLS_WANT_POLLIN || rc == TLS_WANT_POLLOUT); | ||
|
||
if (rc < 0) | ||
if (rc == -1) | ||
warnx("%s: tls_write: %s", http->src.ip, | ||
tls_error(http->ctx)); | ||
return rc; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* $OpenBSD: ocspcheck.c,v 1.24 2017/12/01 14:42:23 visa Exp $ */ | ||
/* $OpenBSD: ocspcheck.c,v 1.25 2019/05/15 13:44:18 bcook Exp $ */ | ||
|
||
/* | ||
* Copyright (c) 2017 Bob Beck <[email protected]> | ||
|
@@ -670,7 +670,9 @@ main(int argc, char **argv) | |
* write out the DER format response to the staplefd | ||
*/ | ||
if (staplefd >= 0) { | ||
(void) ftruncate(staplefd, 0); | ||
while (ftruncate(staplefd, 0) < 0) | ||
if (errno != EINTR && errno != EAGAIN) | ||
err(1, "Write of OCSP response failed"); | ||
w = 0; | ||
written = 0; | ||
while (written < instaplesz) { | ||
|
Oops, something went wrong.