diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/usr.bin/nc/netcat.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/usr.bin/nc/netcat.c b/src/usr.bin/nc/netcat.c index ae2404bd0d..4c3ed4e97f 100644 --- a/src/usr.bin/nc/netcat.c +++ b/src/usr.bin/nc/netcat.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: netcat.c,v 1.143 2015/11/13 18:13:13 deraadt Exp $ */ | 1 | /* $OpenBSD: netcat.c,v 1.144 2015/11/23 01:23:56 bcook Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> | 3 | * Copyright (c) 2001 Eric Jackson <ericj@monkey.org> |
| 4 | * Copyright (c) 2015 Bob Beck. All rights reserved. | 4 | * Copyright (c) 2015 Bob Beck. All rights reserved. |
| @@ -643,7 +643,7 @@ main(int argc, char *argv[]) | |||
| 643 | int | 643 | int |
| 644 | unix_bind(char *path, int flags) | 644 | unix_bind(char *path, int flags) |
| 645 | { | 645 | { |
| 646 | struct sockaddr_un sun; | 646 | struct sockaddr_un s_un; |
| 647 | int s; | 647 | int s; |
| 648 | 648 | ||
| 649 | /* Create unix domain socket. */ | 649 | /* Create unix domain socket. */ |
| @@ -651,17 +651,17 @@ unix_bind(char *path, int flags) | |||
| 651 | 0)) < 0) | 651 | 0)) < 0) |
| 652 | return (-1); | 652 | return (-1); |
| 653 | 653 | ||
| 654 | memset(&sun, 0, sizeof(struct sockaddr_un)); | 654 | memset(&s_un, 0, sizeof(struct sockaddr_un)); |
| 655 | sun.sun_family = AF_UNIX; | 655 | s_un.sun_family = AF_UNIX; |
| 656 | 656 | ||
| 657 | if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >= | 657 | if (strlcpy(s_un.sun_path, path, sizeof(s_un.sun_path)) >= |
| 658 | sizeof(sun.sun_path)) { | 658 | sizeof(s_un.sun_path)) { |
| 659 | close(s); | 659 | close(s); |
| 660 | errno = ENAMETOOLONG; | 660 | errno = ENAMETOOLONG; |
| 661 | return (-1); | 661 | return (-1); |
| 662 | } | 662 | } |
| 663 | 663 | ||
| 664 | if (bind(s, (struct sockaddr *)&sun, sizeof(sun)) < 0) { | 664 | if (bind(s, (struct sockaddr *)&s_un, sizeof(s_un)) < 0) { |
| 665 | close(s); | 665 | close(s); |
| 666 | return (-1); | 666 | return (-1); |
| 667 | } | 667 | } |
| @@ -737,7 +737,7 @@ tls_setup_server(struct tls *tls_ctx, int connfd, char *host) | |||
| 737 | int | 737 | int |
| 738 | unix_connect(char *path) | 738 | unix_connect(char *path) |
| 739 | { | 739 | { |
| 740 | struct sockaddr_un sun; | 740 | struct sockaddr_un s_un; |
| 741 | int s; | 741 | int s; |
| 742 | 742 | ||
| 743 | if (uflag) { | 743 | if (uflag) { |
| @@ -748,16 +748,16 @@ unix_connect(char *path) | |||
| 748 | return (-1); | 748 | return (-1); |
| 749 | } | 749 | } |
| 750 | 750 | ||
| 751 | memset(&sun, 0, sizeof(struct sockaddr_un)); | 751 | memset(&s_un, 0, sizeof(struct sockaddr_un)); |
| 752 | sun.sun_family = AF_UNIX; | 752 | s_un.sun_family = AF_UNIX; |
| 753 | 753 | ||
| 754 | if (strlcpy(sun.sun_path, path, sizeof(sun.sun_path)) >= | 754 | if (strlcpy(s_un.sun_path, path, sizeof(s_un.sun_path)) >= |
| 755 | sizeof(sun.sun_path)) { | 755 | sizeof(s_un.sun_path)) { |
| 756 | close(s); | 756 | close(s); |
| 757 | errno = ENAMETOOLONG; | 757 | errno = ENAMETOOLONG; |
| 758 | return (-1); | 758 | return (-1); |
| 759 | } | 759 | } |
| 760 | if (connect(s, (struct sockaddr *)&sun, sizeof(sun)) < 0) { | 760 | if (connect(s, (struct sockaddr *)&s_un, sizeof(s_un)) < 0) { |
| 761 | close(s); | 761 | close(s); |
| 762 | return (-1); | 762 | return (-1); |
| 763 | } | 763 | } |
