summaryrefslogtreecommitdiff
path: root/openbsd-compat
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2016-08-02 09:44:25 +1000
committerDarren Tucker <dtucker@zip.com.au>2016-08-02 09:44:25 +1000
commitc20dccb5614c5714f4155dda01bcdebf97cfae7e (patch)
tree52a7fb54f19aae274f12f1c9db7eaeb1922137aa /openbsd-compat
parent30f9bd1c0963c23bfba8468dfd26aa17609ba42f (diff)
Strip trailing whitespace.
Mechanically strip trailing whitespace on files not synced with OpenBSD (or in the case of bsd-snprint.c, rsync).
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/Makefile.in2
-rw-r--r--openbsd-compat/base64.h2
-rw-r--r--openbsd-compat/bsd-asprintf.c2
-rw-r--r--openbsd-compat/bsd-cray.c22
-rw-r--r--openbsd-compat/bsd-cray.h2
-rw-r--r--openbsd-compat/bsd-cygwin_util.c4
-rw-r--r--openbsd-compat/bsd-misc.c12
-rw-r--r--openbsd-compat/bsd-misc.h2
-rw-r--r--openbsd-compat/bsd-nextstep.c2
-rw-r--r--openbsd-compat/bsd-openpty.c4
-rw-r--r--openbsd-compat/bsd-waitpid.c6
-rw-r--r--openbsd-compat/fake-rfc2553.c36
-rw-r--r--openbsd-compat/fake-rfc2553.h10
-rw-r--r--openbsd-compat/openbsd-compat.h14
-rw-r--r--openbsd-compat/openssl-compat.c2
-rw-r--r--openbsd-compat/port-aix.c6
-rw-r--r--openbsd-compat/port-tun.c2
-rw-r--r--openbsd-compat/setproctitle.c10
-rw-r--r--openbsd-compat/xcrypt.c4
-rw-r--r--openbsd-compat/xmmap.c2
20 files changed, 73 insertions, 73 deletions
diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in
index aca9eba75..7f7368aa3 100644
--- a/openbsd-compat/Makefile.in
+++ b/openbsd-compat/Makefile.in
@@ -36,7 +36,7 @@ libopenbsd-compat.a: $(COMPAT) $(OPENBSD) $(PORTS)
36 $(RANLIB) $@ 36 $(RANLIB) $@
37 37
38clean: 38clean:
39 rm -f *.o *.a core 39 rm -f *.o *.a core
40 40
41distclean: clean 41distclean: clean
42 rm -f Makefile *~ 42 rm -f Makefile *~
diff --git a/openbsd-compat/base64.h b/openbsd-compat/base64.h
index 732c6b3f8..0774ce2aa 100644
--- a/openbsd-compat/base64.h
+++ b/openbsd-compat/base64.h
@@ -49,7 +49,7 @@
49 49
50#ifndef HAVE___B64_NTOP 50#ifndef HAVE___B64_NTOP
51# ifndef HAVE_B64_NTOP 51# ifndef HAVE_B64_NTOP
52int b64_ntop(u_char const *src, size_t srclength, char *target, 52int b64_ntop(u_char const *src, size_t srclength, char *target,
53 size_t targsize); 53 size_t targsize);
54# endif /* !HAVE_B64_NTOP */ 54# endif /* !HAVE_B64_NTOP */
55# define __b64_ntop(a,b,c,d) b64_ntop(a,b,c,d) 55# define __b64_ntop(a,b,c,d) b64_ntop(a,b,c,d)
diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c
index 7b83448ca..822367154 100644
--- a/openbsd-compat/bsd-asprintf.c
+++ b/openbsd-compat/bsd-asprintf.c
@@ -78,7 +78,7 @@ int asprintf(char **str, const char *fmt, ...)
78{ 78{
79 va_list ap; 79 va_list ap;
80 int ret; 80 int ret;
81 81
82 *str = NULL; 82 *str = NULL;
83 va_start(ap, fmt); 83 va_start(ap, fmt);
84 ret = vasprintf(str, fmt, ap); 84 ret = vasprintf(str, fmt, ap);
diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c
index f1bbd7dec..1528ab6e1 100644
--- a/openbsd-compat/bsd-cray.c
+++ b/openbsd-compat/bsd-cray.c
@@ -1,10 +1,10 @@
1/* 1/*
2 * $Id: bsd-cray.c,v 1.17 2007/08/15 09:17:43 dtucker Exp $ 2 * $Id: bsd-cray.c,v 1.17 2007/08/15 09:17:43 dtucker Exp $
3 * 3 *
4 * bsd-cray.c 4 * bsd-cray.c
5 * 5 *
6 * Copyright (c) 2002, Cray Inc. (Wendy Palm <wendyp@cray.com>) 6 * Copyright (c) 2002, Cray Inc. (Wendy Palm <wendyp@cray.com>)
7 * Significant portions provided by 7 * Significant portions provided by
8 * Wayne Schroeder, SDSC <schroeder@sdsc.edu> 8 * Wayne Schroeder, SDSC <schroeder@sdsc.edu>
9 * William Jones, UTexas <jones@tacc.utexas.edu> 9 * William Jones, UTexas <jones@tacc.utexas.edu>
10 * 10 *
@@ -268,7 +268,7 @@ cray_setup (uid_t uid, char *username, const char *command)
268 usent.uname = username; 268 usent.uname = username;
269 usent.host = hostname; 269 usent.host = hostname;
270 usent.ttyn = ttyn; 270 usent.ttyn = ttyn;
271 usent.caller = IA_SSHD; 271 usent.caller = IA_SSHD;
272 usent.pswdlist = &pwdacm; 272 usent.pswdlist = &pwdacm;
273 usent.ueptr = &ue; 273 usent.ueptr = &ue;
274 usent.flags = IA_INTERACTIVE | IA_FFLAG; 274 usent.flags = IA_INTERACTIVE | IA_FFLAG;
@@ -352,7 +352,7 @@ cray_setup (uid_t uid, char *username, const char *command)
352 /* 352 /*
353 * These are failed return codes from ia_user() 353 * These are failed return codes from ia_user()
354 */ 354 */
355 switch (ia_rcode) 355 switch (ia_rcode)
356 { 356 {
357 case IA_BADAUTH: 357 case IA_BADAUTH:
358 printf("Bad authorization, access denied.\n"); 358 printf("Bad authorization, access denied.\n");
@@ -407,7 +407,7 @@ cray_setup (uid_t uid, char *username, const char *command)
407 */ 407 */
408 ia_failure(&fsent, &fret); 408 ia_failure(&fsent, &fret);
409 409
410 exit(1); 410 exit(1);
411 } 411 }
412 412
413 ia_mlsrcode = IA_NORMAL; 413 ia_mlsrcode = IA_NORMAL;
@@ -441,7 +441,7 @@ cray_setup (uid_t uid, char *username, const char *command)
441 * There is no return because ia_failure exits. 441 * There is no return because ia_failure exits.
442 */ 442 */
443 ia_failure(&fsent,&fret); 443 ia_failure(&fsent,&fret);
444 exit(1); 444 exit(1);
445 } 445 }
446 446
447 /* Provide login status information */ 447 /* Provide login status information */
@@ -526,7 +526,7 @@ cray_setup (uid_t uid, char *username, const char *command)
526 break; 526 break;
527 default: 527 default:
528 valid_acct = nam2acid(acct_name); 528 valid_acct = nam2acid(acct_name);
529 if (valid_acct == -1) 529 if (valid_acct == -1)
530 printf( 530 printf(
531 "Account id not found for" 531 "Account id not found for"
532 " account name \"%s\"\n\n", 532 " account name \"%s\"\n\n",
@@ -576,9 +576,9 @@ cray_setup (uid_t uid, char *username, const char *command)
576 exit(1); 576 exit(1);
577 } 577 }
578 578
579 /* 579 /*
580 * Now set shares, quotas, limits, including CPU time for the 580 * Now set shares, quotas, limits, including CPU time for the
581 * (interactive) job and process, and set up permissions 581 * (interactive) job and process, and set up permissions
582 * (for chown etc), etc. 582 * (for chown etc), etc.
583 */ 583 */
584 if (setshares(ue.ue_uid, valid_acct, printf, 0, 0)) { 584 if (setshares(ue.ue_uid, valid_acct, printf, 0, 0)) {
@@ -656,7 +656,7 @@ drop_cray_privs()
656 usrv.sv_minlvl = sysv.sy_minlvl; 656 usrv.sv_minlvl = sysv.sy_minlvl;
657 usrv.sv_actlvl = sysv.sy_minlvl; 657 usrv.sv_actlvl = sysv.sy_minlvl;
658 usrv.sv_maxlvl = sysv.sy_maxlvl; 658 usrv.sv_maxlvl = sysv.sy_maxlvl;
659 } 659 }
660 usrv.sv_actcmp = 0; 660 usrv.sv_actcmp = 0;
661 usrv.sv_valcmp = sysv.sy_valcmp; 661 usrv.sv_valcmp = sysv.sy_valcmp;
662 662
diff --git a/openbsd-compat/bsd-cray.h b/openbsd-compat/bsd-cray.h
index 774eceb5a..bc2e22134 100644
--- a/openbsd-compat/bsd-cray.h
+++ b/openbsd-compat/bsd-cray.h
@@ -2,7 +2,7 @@
2 2
3/* 3/*
4 * Copyright (c) 2002, Cray Inc. (Wendy Palm <wendyp@cray.com>) 4 * Copyright (c) 2002, Cray Inc. (Wendy Palm <wendyp@cray.com>)
5 * Significant portions provided by 5 * Significant portions provided by
6 * Wayne Schroeder, SDSC <schroeder@sdsc.edu> 6 * Wayne Schroeder, SDSC <schroeder@sdsc.edu>
7 * William Jones, UTexas <jones@tacc.utexas.edu> 7 * William Jones, UTexas <jones@tacc.utexas.edu>
8 * 8 *
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c
index 8672ccf7f..398a5f617 100644
--- a/openbsd-compat/bsd-cygwin_util.c
+++ b/openbsd-compat/bsd-cygwin_util.c
@@ -39,12 +39,12 @@
39 39
40#include "xmalloc.h" 40#include "xmalloc.h"
41 41
42int 42int
43binary_open(const char *filename, int flags, ...) 43binary_open(const char *filename, int flags, ...)
44{ 44{
45 va_list ap; 45 va_list ap;
46 mode_t mode; 46 mode_t mode;
47 47
48 va_start(ap, flags); 48 va_start(ap, flags);
49 mode = va_arg(ap, mode_t); 49 mode = va_arg(ap, mode_t);
50 va_end(ap); 50 va_end(ap);
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c
index 18bf62dd8..f11731630 100644
--- a/openbsd-compat/bsd-misc.c
+++ b/openbsd-compat/bsd-misc.c
@@ -70,7 +70,7 @@ int setlogin(const char *name)
70#endif /* !HAVE_SETLOGIN */ 70#endif /* !HAVE_SETLOGIN */
71 71
72#ifndef HAVE_INNETGR 72#ifndef HAVE_INNETGR
73int innetgr(const char *netgroup, const char *host, 73int innetgr(const char *netgroup, const char *host,
74 const char *user, const char *domain) 74 const char *user, const char *domain)
75{ 75{
76 return (0); 76 return (0);
@@ -96,7 +96,7 @@ const char *strerror(int e)
96{ 96{
97 extern int sys_nerr; 97 extern int sys_nerr;
98 extern char *sys_errlist[]; 98 extern char *sys_errlist[];
99 99
100 if ((e >= 0) && (e < sys_nerr)) 100 if ((e >= 0) && (e < sys_nerr))
101 return (sys_errlist[e]); 101 return (sys_errlist[e]);
102 102
@@ -111,10 +111,10 @@ int utimes(char *filename, struct timeval *tvp)
111 111
112 ub.actime = tvp[0].tv_sec; 112 ub.actime = tvp[0].tv_sec;
113 ub.modtime = tvp[1].tv_sec; 113 ub.modtime = tvp[1].tv_sec;
114 114
115 return (utime(filename, &ub)); 115 return (utime(filename, &ub));
116} 116}
117#endif 117#endif
118 118
119#ifndef HAVE_TRUNCATE 119#ifndef HAVE_TRUNCATE
120int truncate(const char *path, off_t length) 120int truncate(const char *path, off_t length)
@@ -149,9 +149,9 @@ int nanosleep(const struct timespec *req, struct timespec *rem)
149 saverrno = errno; 149 saverrno = errno;
150 (void) gettimeofday (&tstop, NULL); 150 (void) gettimeofday (&tstop, NULL);
151 errno = saverrno; 151 errno = saverrno;
152 tremain.tv_sec = time2wait.tv_sec - 152 tremain.tv_sec = time2wait.tv_sec -
153 (tstop.tv_sec - tstart.tv_sec); 153 (tstop.tv_sec - tstart.tv_sec);
154 tremain.tv_usec = time2wait.tv_usec - 154 tremain.tv_usec = time2wait.tv_usec -
155 (tstop.tv_usec - tstart.tv_usec); 155 (tstop.tv_usec - tstart.tv_usec);
156 tremain.tv_sec += tremain.tv_usec / 1000000L; 156 tremain.tv_sec += tremain.tv_usec / 1000000L;
157 tremain.tv_usec %= 1000000L; 157 tremain.tv_usec %= 1000000L;
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index 27abb2e92..6084de8d6 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -49,7 +49,7 @@ int setegid(uid_t);
49 49
50#if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR) 50#if !defined(HAVE_STRERROR) && defined(HAVE_SYS_ERRLIST) && defined(HAVE_SYS_NERR)
51const char *strerror(int); 51const char *strerror(int);
52#endif 52#endif
53 53
54#if !defined(HAVE_SETLINEBUF) 54#if !defined(HAVE_SETLINEBUF)
55#define setlinebuf(a) (setvbuf((a), NULL, _IOLBF, 0)) 55#define setlinebuf(a) (setvbuf((a), NULL, _IOLBF, 0))
diff --git a/openbsd-compat/bsd-nextstep.c b/openbsd-compat/bsd-nextstep.c
index 8195af88a..d52443f6d 100644
--- a/openbsd-compat/bsd-nextstep.c
+++ b/openbsd-compat/bsd-nextstep.c
@@ -29,7 +29,7 @@
29#include <sys/wait.h> 29#include <sys/wait.h>
30#include "bsd-nextstep.h" 30#include "bsd-nextstep.h"
31 31
32pid_t 32pid_t
33posix_wait(int *status) 33posix_wait(int *status)
34{ 34{
35 union wait statusp; 35 union wait statusp;
diff --git a/openbsd-compat/bsd-openpty.c b/openbsd-compat/bsd-openpty.c
index 9777eb556..b28235860 100644
--- a/openbsd-compat/bsd-openpty.c
+++ b/openbsd-compat/bsd-openpty.c
@@ -122,7 +122,7 @@ openpty(int *amaster, int *aslave, char *name, struct termios *termp,
122 } 122 }
123 123
124 /* 124 /*
125 * Try to push the appropriate streams modules, as described 125 * Try to push the appropriate streams modules, as described
126 * in Solaris pts(7). 126 * in Solaris pts(7).
127 */ 127 */
128 ioctl(*aslave, I_PUSH, "ptem"); 128 ioctl(*aslave, I_PUSH, "ptem");
@@ -184,7 +184,7 @@ openpty(int *amaster, int *aslave, char *name, struct termios *termp,
184 struct termios tio; 184 struct termios tio;
185 185
186 for (i = 0; i < num_ptys; i++) { 186 for (i = 0; i < num_ptys; i++) {
187 snprintf(ptbuf, sizeof(ptbuf), "/dev/pty%c%c", 187 snprintf(ptbuf, sizeof(ptbuf), "/dev/pty%c%c",
188 ptymajors[i / num_minors], ptyminors[i % num_minors]); 188 ptymajors[i / num_minors], ptyminors[i % num_minors]);
189 snprintf(ttbuf, sizeof(ttbuf), "/dev/tty%c%c", 189 snprintf(ttbuf, sizeof(ttbuf), "/dev/tty%c%c",
190 ptymajors[i / num_minors], ptyminors[i % num_minors]); 190 ptymajors[i / num_minors], ptyminors[i % num_minors]);
diff --git a/openbsd-compat/bsd-waitpid.c b/openbsd-compat/bsd-waitpid.c
index 40e6ffaa8..c21fbe911 100644
--- a/openbsd-compat/bsd-waitpid.c
+++ b/openbsd-compat/bsd-waitpid.c
@@ -24,7 +24,7 @@
24 24
25#include "includes.h" 25#include "includes.h"
26 26
27#ifndef HAVE_WAITPID 27#ifndef HAVE_WAITPID
28#include <errno.h> 28#include <errno.h>
29#include <sys/wait.h> 29#include <sys/wait.h>
30#include "bsd-waitpid.h" 30#include "bsd-waitpid.h"
@@ -45,9 +45,9 @@ waitpid(int pid, int *stat_loc, int options)
45 } 45 }
46 wait_pid = wait4(pid, &statusp, options, NULL); 46 wait_pid = wait4(pid, &statusp, options, NULL);
47 if (stat_loc) 47 if (stat_loc)
48 *stat_loc = (int) statusp.w_status; 48 *stat_loc = (int) statusp.w_status;
49 49
50 return (wait_pid); 50 return (wait_pid);
51} 51}
52 52
53#endif /* !HAVE_WAITPID */ 53#endif /* !HAVE_WAITPID */
diff --git a/openbsd-compat/fake-rfc2553.c b/openbsd-compat/fake-rfc2553.c
index 096d9e092..55c95625e 100644
--- a/openbsd-compat/fake-rfc2553.c
+++ b/openbsd-compat/fake-rfc2553.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (C) 2000-2003 Damien Miller. All rights reserved. 2 * Copyright (C) 2000-2003 Damien Miller. All rights reserved.
3 * Copyright (C) 1999 WIDE Project. All rights reserved. 3 * Copyright (C) 1999 WIDE Project. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
@@ -13,7 +13,7 @@
13 * 3. Neither the name of the project nor the names of its contributors 13 * 3. Neither the name of the project nor the names of its contributors
14 * may be used to endorse or promote products derived from this software 14 * may be used to endorse or promote products derived from this software
15 * without specific prior written permission. 15 * without specific prior written permission.
16 * 16 *
17 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 17 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -44,7 +44,7 @@
44#include <arpa/inet.h> 44#include <arpa/inet.h>
45 45
46#ifndef HAVE_GETNAMEINFO 46#ifndef HAVE_GETNAMEINFO
47int getnameinfo(const struct sockaddr *sa, size_t salen, char *host, 47int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
48 size_t hostlen, char *serv, size_t servlen, int flags) 48 size_t hostlen, char *serv, size_t servlen, int flags)
49{ 49{
50 struct sockaddr_in *sin = (struct sockaddr_in *)sa; 50 struct sockaddr_in *sin = (struct sockaddr_in *)sa;
@@ -67,11 +67,11 @@ int getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
67 else 67 else
68 return (0); 68 return (0);
69 } else { 69 } else {
70 hp = gethostbyaddr((char *)&sin->sin_addr, 70 hp = gethostbyaddr((char *)&sin->sin_addr,
71 sizeof(struct in_addr), AF_INET); 71 sizeof(struct in_addr), AF_INET);
72 if (hp == NULL) 72 if (hp == NULL)
73 return (EAI_NODATA); 73 return (EAI_NODATA);
74 74
75 if (strlcpy(host, hp->h_name, hostlen) >= hostlen) 75 if (strlcpy(host, hp->h_name, hostlen) >= hostlen)
76 return (EAI_MEMORY); 76 return (EAI_MEMORY);
77 else 77 else
@@ -102,7 +102,7 @@ gai_strerror(int err)
102 default: 102 default:
103 return ("unknown/invalid error."); 103 return ("unknown/invalid error.");
104 } 104 }
105} 105}
106#endif /* !HAVE_GAI_STRERROR */ 106#endif /* !HAVE_GAI_STRERROR */
107 107
108#ifndef HAVE_FREEADDRINFO 108#ifndef HAVE_FREEADDRINFO
@@ -128,9 +128,9 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
128 ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in)); 128 ai = malloc(sizeof(*ai) + sizeof(struct sockaddr_in));
129 if (ai == NULL) 129 if (ai == NULL)
130 return (NULL); 130 return (NULL);
131 131
132 memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in)); 132 memset(ai, '\0', sizeof(*ai) + sizeof(struct sockaddr_in));
133 133
134 ai->ai_addr = (struct sockaddr *)(ai + 1); 134 ai->ai_addr = (struct sockaddr *)(ai + 1);
135 /* XXX -- ssh doesn't use sa_len */ 135 /* XXX -- ssh doesn't use sa_len */
136 ai->ai_addrlen = sizeof(struct sockaddr_in); 136 ai->ai_addrlen = sizeof(struct sockaddr_in);
@@ -138,7 +138,7 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
138 138
139 ((struct sockaddr_in *)(ai)->ai_addr)->sin_port = port; 139 ((struct sockaddr_in *)(ai)->ai_addr)->sin_port = port;
140 ((struct sockaddr_in *)(ai)->ai_addr)->sin_addr.s_addr = addr; 140 ((struct sockaddr_in *)(ai)->ai_addr)->sin_addr.s_addr = addr;
141 141
142 /* XXX: the following is not generally correct, but does what we want */ 142 /* XXX: the following is not generally correct, but does what we want */
143 if (hints->ai_socktype) 143 if (hints->ai_socktype)
144 ai->ai_socktype = hints->ai_socktype; 144 ai->ai_socktype = hints->ai_socktype;
@@ -152,7 +152,7 @@ addrinfo *malloc_ai(int port, u_long addr, const struct addrinfo *hints)
152} 152}
153 153
154int 154int
155getaddrinfo(const char *hostname, const char *servname, 155getaddrinfo(const char *hostname, const char *servname,
156 const struct addrinfo *hints, struct addrinfo **res) 156 const struct addrinfo *hints, struct addrinfo **res)
157{ 157{
158 struct hostent *hp; 158 struct hostent *hp;
@@ -183,29 +183,29 @@ getaddrinfo(const char *hostname, const char *servname,
183 if (hostname && inet_aton(hostname, &in) != 0) 183 if (hostname && inet_aton(hostname, &in) != 0)
184 addr = in.s_addr; 184 addr = in.s_addr;
185 *res = malloc_ai(port, addr, hints); 185 *res = malloc_ai(port, addr, hints);
186 if (*res == NULL) 186 if (*res == NULL)
187 return (EAI_MEMORY); 187 return (EAI_MEMORY);
188 return (0); 188 return (0);
189 } 189 }
190 190
191 if (!hostname) { 191 if (!hostname) {
192 *res = malloc_ai(port, htonl(0x7f000001), hints); 192 *res = malloc_ai(port, htonl(0x7f000001), hints);
193 if (*res == NULL) 193 if (*res == NULL)
194 return (EAI_MEMORY); 194 return (EAI_MEMORY);
195 return (0); 195 return (0);
196 } 196 }
197 197
198 if (inet_aton(hostname, &in)) { 198 if (inet_aton(hostname, &in)) {
199 *res = malloc_ai(port, in.s_addr, hints); 199 *res = malloc_ai(port, in.s_addr, hints);
200 if (*res == NULL) 200 if (*res == NULL)
201 return (EAI_MEMORY); 201 return (EAI_MEMORY);
202 return (0); 202 return (0);
203 } 203 }
204 204
205 /* Don't try DNS if AI_NUMERICHOST is set */ 205 /* Don't try DNS if AI_NUMERICHOST is set */
206 if (hints && hints->ai_flags & AI_NUMERICHOST) 206 if (hints && hints->ai_flags & AI_NUMERICHOST)
207 return (EAI_NONAME); 207 return (EAI_NONAME);
208 208
209 hp = gethostbyname(hostname); 209 hp = gethostbyname(hostname);
210 if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) { 210 if (hp && hp->h_name && hp->h_name[0] && hp->h_addr_list[0]) {
211 struct addrinfo *cur, *prev; 211 struct addrinfo *cur, *prev;
@@ -229,7 +229,7 @@ getaddrinfo(const char *hostname, const char *servname,
229 } 229 }
230 return (0); 230 return (0);
231 } 231 }
232 232
233 return (EAI_NODATA); 233 return (EAI_NODATA);
234} 234}
235#endif /* !HAVE_GETADDRINFO */ 235#endif /* !HAVE_GETADDRINFO */
diff --git a/openbsd-compat/fake-rfc2553.h b/openbsd-compat/fake-rfc2553.h
index 6426f7bf6..bd520d4b1 100644
--- a/openbsd-compat/fake-rfc2553.h
+++ b/openbsd-compat/fake-rfc2553.h
@@ -3,7 +3,7 @@
3/* 3/*
4 * Copyright (C) 2000-2003 Damien Miller. All rights reserved. 4 * Copyright (C) 2000-2003 Damien Miller. All rights reserved.
5 * Copyright (C) 1999 WIDE Project. All rights reserved. 5 * Copyright (C) 1999 WIDE Project. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
@@ -15,7 +15,7 @@
15 * 3. Neither the name of the project nor the names of its contributors 15 * 3. Neither the name of the project nor the names of its contributors
16 * may be used to endorse or promote products derived from this software 16 * may be used to endorse or promote products derived from this software
17 * without specific prior written permission. 17 * without specific prior written permission.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND 19 * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
@@ -47,7 +47,7 @@
47#endif 47#endif
48 48
49/* 49/*
50 * First, socket and INET6 related definitions 50 * First, socket and INET6 related definitions
51 */ 51 */
52#ifndef HAVE_STRUCT_SOCKADDR_STORAGE 52#ifndef HAVE_STRUCT_SOCKADDR_STORAGE
53# define _SS_MAXSIZE 128 /* Implementation specific max size */ 53# define _SS_MAXSIZE 128 /* Implementation specific max size */
@@ -154,7 +154,7 @@ struct addrinfo {
154# undef getaddrinfo 154# undef getaddrinfo
155#endif 155#endif
156#define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d)) 156#define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d))
157int getaddrinfo(const char *, const char *, 157int getaddrinfo(const char *, const char *,
158 const struct addrinfo *, struct addrinfo **); 158 const struct addrinfo *, struct addrinfo **);
159#endif /* !HAVE_GETADDRINFO */ 159#endif /* !HAVE_GETADDRINFO */
160 160
@@ -170,7 +170,7 @@ void freeaddrinfo(struct addrinfo *);
170 170
171#ifndef HAVE_GETNAMEINFO 171#ifndef HAVE_GETNAMEINFO
172#define getnameinfo(a,b,c,d,e,f,g) (ssh_getnameinfo(a,b,c,d,e,f,g)) 172#define getnameinfo(a,b,c,d,e,f,g) (ssh_getnameinfo(a,b,c,d,e,f,g))
173int getnameinfo(const struct sockaddr *, size_t, char *, size_t, 173int getnameinfo(const struct sockaddr *, size_t, char *, size_t,
174 char *, size_t, int); 174 char *, size_t, int);
175#endif /* !HAVE_GETNAMEINFO */ 175#endif /* !HAVE_GETNAMEINFO */
176 176
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
index 37d2064cd..4e7629a91 100644
--- a/openbsd-compat/openbsd-compat.h
+++ b/openbsd-compat/openbsd-compat.h
@@ -64,7 +64,7 @@ void closefrom(int);
64 64
65#ifndef HAVE_GETCWD 65#ifndef HAVE_GETCWD
66char *getcwd(char *pt, size_t size); 66char *getcwd(char *pt, size_t size);
67#endif 67#endif
68 68
69#ifndef HAVE_REALLOCARRAY 69#ifndef HAVE_REALLOCARRAY
70void *reallocarray(void *, size_t, size_t); 70void *reallocarray(void *, size_t, size_t);
@@ -94,7 +94,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz);
94#ifndef HAVE_STRLCAT 94#ifndef HAVE_STRLCAT
95/* #include <sys/types.h> XXX Still needed? */ 95/* #include <sys/types.h> XXX Still needed? */
96size_t strlcat(char *dst, const char *src, size_t siz); 96size_t strlcat(char *dst, const char *src, size_t siz);
97#endif 97#endif
98 98
99#ifndef HAVE_SETENV 99#ifndef HAVE_SETENV
100int setenv(register const char *name, register const char *value, int rewrite); 100int setenv(register const char *name, register const char *value, int rewrite);
@@ -113,11 +113,11 @@ char *strptime(const char *buf, const char *fmt, struct tm *tm);
113int mkstemps(char *path, int slen); 113int mkstemps(char *path, int slen);
114int mkstemp(char *path); 114int mkstemp(char *path);
115char *mkdtemp(char *path); 115char *mkdtemp(char *path);
116#endif 116#endif
117 117
118#ifndef HAVE_DAEMON 118#ifndef HAVE_DAEMON
119int daemon(int nochdir, int noclose); 119int daemon(int nochdir, int noclose);
120#endif 120#endif
121 121
122#ifndef HAVE_DIRNAME 122#ifndef HAVE_DIRNAME
123char *dirname(const char *path); 123char *dirname(const char *path);
@@ -142,7 +142,7 @@ const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
142 142
143#ifndef HAVE_INET_ATON 143#ifndef HAVE_INET_ATON
144int inet_aton(const char *cp, struct in_addr *addr); 144int inet_aton(const char *cp, struct in_addr *addr);
145#endif 145#endif
146 146
147#ifndef HAVE_STRSEP 147#ifndef HAVE_STRSEP
148char *strsep(char **stringp, const char *delim); 148char *strsep(char **stringp, const char *delim);
@@ -199,7 +199,7 @@ u_int32_t arc4random_uniform(u_int32_t);
199 199
200#ifndef HAVE_ASPRINTF 200#ifndef HAVE_ASPRINTF
201int asprintf(char **, const char *, ...); 201int asprintf(char **, const char *, ...);
202#endif 202#endif
203 203
204#ifndef HAVE_OPENPTY 204#ifndef HAVE_OPENPTY
205# include <sys/ioctl.h> /* for struct winsize */ 205# include <sys/ioctl.h> /* for struct winsize */
@@ -210,7 +210,7 @@ int openpty(int *, int *, char *, struct termios *, struct winsize *);
210 210
211#ifndef HAVE_SNPRINTF 211#ifndef HAVE_SNPRINTF
212int snprintf(char *, size_t, SNPRINTF_CONST char *, ...); 212int snprintf(char *, size_t, SNPRINTF_CONST char *, ...);
213#endif 213#endif
214 214
215#ifndef HAVE_STRTOLL 215#ifndef HAVE_STRTOLL
216long long strtoll(const char *, char **, int); 216long long strtoll(const char *, char **, int);
diff --git a/openbsd-compat/openssl-compat.c b/openbsd-compat/openssl-compat.c
index 63a660c7a..8c6b116f9 100644
--- a/openbsd-compat/openssl-compat.c
+++ b/openbsd-compat/openssl-compat.c
@@ -55,7 +55,7 @@ ssh_compatible_openssl(long headerver, long libver)
55 mask = 0xfffff00fL; /* major,minor,fix,status */ 55 mask = 0xfffff00fL; /* major,minor,fix,status */
56 return (headerver & mask) == (libver & mask); 56 return (headerver & mask) == (libver & mask);
57 } 57 }
58 58
59 /* 59 /*
60 * For versions >= 1.0.0, major,minor,status must match and library 60 * For versions >= 1.0.0, major,minor,status must match and library
61 * fix version must be equal to or newer than the header. 61 * fix version must be equal to or newer than the header.
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c
index 8da367d48..c2970c4db 100644
--- a/openbsd-compat/port-aix.c
+++ b/openbsd-compat/port-aix.c
@@ -179,7 +179,7 @@ sys_auth_passwd(Authctxt *ctxt, const char *password)
179 do { 179 do {
180 result = authenticate((char *)name, (char *)password, &reenter, 180 result = authenticate((char *)name, (char *)password, &reenter,
181 &authmsg); 181 &authmsg);
182 aix_remove_embedded_newlines(authmsg); 182 aix_remove_embedded_newlines(authmsg);
183 debug3("AIX/authenticate result %d, authmsg %.100s", result, 183 debug3("AIX/authenticate result %d, authmsg %.100s", result,
184 authmsg); 184 authmsg);
185 } while (reenter); 185 } while (reenter);
@@ -337,11 +337,11 @@ aix_setauthdb(const char *user)
337 debug3("%s: Could not open userdb to read", __func__); 337 debug3("%s: Could not open userdb to read", __func__);
338 return; 338 return;
339 } 339 }
340 340
341 if (getuserattr((char *)user, S_REGISTRY, &registry, SEC_CHAR) == 0) { 341 if (getuserattr((char *)user, S_REGISTRY, &registry, SEC_CHAR) == 0) {
342 if (setauthdb(registry, old_registry) == 0) 342 if (setauthdb(registry, old_registry) == 0)
343 debug3("AIX/setauthdb set registry '%s'", registry); 343 debug3("AIX/setauthdb set registry '%s'", registry);
344 else 344 else
345 debug3("AIX/setauthdb set registry '%s' failed: %s", 345 debug3("AIX/setauthdb set registry '%s' failed: %s",
346 registry, strerror(errno)); 346 registry, strerror(errno));
347 } else 347 } else
diff --git a/openbsd-compat/port-tun.c b/openbsd-compat/port-tun.c
index 49e7b4d99..a444adf1d 100644
--- a/openbsd-compat/port-tun.c
+++ b/openbsd-compat/port-tun.c
@@ -68,7 +68,7 @@ sys_tun_open(int tun, int mode)
68 return (-1); 68 return (-1);
69 } 69 }
70 70
71 bzero(&ifr, sizeof(ifr)); 71 bzero(&ifr, sizeof(ifr));
72 72
73 if (mode == SSH_TUNMODE_ETHERNET) { 73 if (mode == SSH_TUNMODE_ETHERNET) {
74 ifr.ifr_flags = IFF_TAP; 74 ifr.ifr_flags = IFF_TAP;
diff --git a/openbsd-compat/setproctitle.c b/openbsd-compat/setproctitle.c
index 9f7ca14c2..2b15c6e00 100644
--- a/openbsd-compat/setproctitle.c
+++ b/openbsd-compat/setproctitle.c
@@ -76,7 +76,7 @@ compat_init_setproctitle(int argc, char *argv[])
76 76
77 /* 77 /*
78 * NB: This assumes that argv has already been copied out of the 78 * NB: This assumes that argv has already been copied out of the
79 * way. This is true for sshd, but may not be true for other 79 * way. This is true for sshd, but may not be true for other
80 * programs. Beware. 80 * programs. Beware.
81 */ 81 */
82 82
@@ -92,7 +92,7 @@ compat_init_setproctitle(int argc, char *argv[])
92 } 92 }
93 93
94 /* 94 /*
95 * Find the last argv string or environment variable within 95 * Find the last argv string or environment variable within
96 * our process memory area. 96 * our process memory area.
97 */ 97 */
98 for (i = 0; i < argc; i++) { 98 for (i = 0; i < argc; i++) {
@@ -108,8 +108,8 @@ compat_init_setproctitle(int argc, char *argv[])
108 argv_start = argv[0]; 108 argv_start = argv[0];
109 argv_env_len = lastargv - argv[0] - 1; 109 argv_env_len = lastargv - argv[0] - 1;
110 110
111 /* 111 /*
112 * Copy environment 112 * Copy environment
113 * XXX - will truncate env on strdup fail 113 * XXX - will truncate env on strdup fail
114 */ 114 */
115 for (i = 0; envp[i] != NULL; i++) 115 for (i = 0; envp[i] != NULL; i++)
@@ -156,7 +156,7 @@ setproctitle(const char *fmt, ...)
156 pst.pst_command = ptitle; 156 pst.pst_command = ptitle;
157 pstat(PSTAT_SETCMD, pst, strlen(ptitle), 0, 0); 157 pstat(PSTAT_SETCMD, pst, strlen(ptitle), 0, 0);
158#elif SPT_TYPE == SPT_REUSEARGV 158#elif SPT_TYPE == SPT_REUSEARGV
159/* debug("setproctitle: copy \"%s\" into len %d", 159/* debug("setproctitle: copy \"%s\" into len %d",
160 buf, argv_env_len); */ 160 buf, argv_env_len); */
161 len = strlcpy(argv_start, ptitle, argv_env_len); 161 len = strlcpy(argv_start, ptitle, argv_env_len);
162 for(; len < argv_env_len; len++) 162 for(; len < argv_env_len; len++)
diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c
index cf6a9b99f..532154f7f 100644
--- a/openbsd-compat/xcrypt.c
+++ b/openbsd-compat/xcrypt.c
@@ -42,7 +42,7 @@
42# include <sys/security.h> 42# include <sys/security.h>
43# include <sys/audit.h> 43# include <sys/audit.h>
44# include <prot.h> 44# include <prot.h>
45# endif 45# endif
46 46
47# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW) 47# if defined(HAVE_SHADOW_H) && !defined(DISABLE_SHADOW)
48# include <shadow.h> 48# include <shadow.h>
@@ -121,7 +121,7 @@ xcrypt(const char *password, const char *salt)
121 crypted = bigcrypt(password, salt); 121 crypted = bigcrypt(password, salt);
122# else 122# else
123 crypted = crypt(password, salt); 123 crypted = crypt(password, salt);
124# endif 124# endif
125 125
126 return crypted; 126 return crypted;
127} 127}
diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c
index 04c6babc2..fee676e4e 100644
--- a/openbsd-compat/xmmap.c
+++ b/openbsd-compat/xmmap.c
@@ -1,7 +1,7 @@
1/* 1/*
2 * Copyright (c) 2002 Tim Rice. All rights reserved. 2 * Copyright (c) 2002 Tim Rice. All rights reserved.
3 * MAP_FAILED code by Solar Designer. 3 * MAP_FAILED code by Solar Designer.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met: