diff options
Diffstat (limited to 'openbsd-compat')
-rw-r--r-- | openbsd-compat/Makefile.in | 4 | ||||
-rw-r--r-- | openbsd-compat/bsd-cray.c | 4 | ||||
-rw-r--r-- | openbsd-compat/bsd-getpeereid.c | 22 | ||||
-rw-r--r-- | openbsd-compat/bsd-misc.c | 5 | ||||
-rw-r--r-- | openbsd-compat/bsd-poll.c | 117 | ||||
-rw-r--r-- | openbsd-compat/bsd-poll.h | 61 | ||||
-rw-r--r-- | openbsd-compat/getrrsetbyname.c | 8 | ||||
-rw-r--r-- | openbsd-compat/openbsd-compat.h | 3 | ||||
-rw-r--r-- | openbsd-compat/openssl-compat.h | 7 | ||||
-rw-r--r-- | openbsd-compat/port-aix.c | 2 | ||||
-rw-r--r-- | openbsd-compat/port-linux.c | 4 | ||||
-rw-r--r-- | openbsd-compat/port-uw.c | 6 | ||||
-rw-r--r-- | openbsd-compat/port-uw.h | 2 | ||||
-rw-r--r-- | openbsd-compat/regress/closefromtest.c | 2 | ||||
-rw-r--r-- | openbsd-compat/xcrypt.c | 2 | ||||
-rw-r--r-- | openbsd-compat/xmmap.c | 6 |
16 files changed, 231 insertions, 24 deletions
diff --git a/openbsd-compat/Makefile.in b/openbsd-compat/Makefile.in index 9f06605d7..b44a7851e 100644 --- a/openbsd-compat/Makefile.in +++ b/openbsd-compat/Makefile.in | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: Makefile.in,v 1.40 2006/08/30 17:24:41 djm Exp $ | 1 | # $Id: Makefile.in,v 1.41 2007/06/25 12:15:13 dtucker Exp $ |
2 | 2 | ||
3 | sysconfdir=@sysconfdir@ | 3 | sysconfdir=@sysconfdir@ |
4 | piddir=@piddir@ | 4 | piddir=@piddir@ |
@@ -18,7 +18,7 @@ LDFLAGS=-L. @LDFLAGS@ | |||
18 | 18 | ||
19 | OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o strtonum.o strtoll.o strtoul.o vis.o | 19 | OPENBSD=base64.o basename.o bindresvport.o daemon.o dirname.o getcwd.o getgrouplist.o getopt.o getrrsetbyname.o glob.o inet_aton.o inet_ntoa.o inet_ntop.o mktemp.o readpassphrase.o realpath.o rresvport.o setenv.o setproctitle.o sha2.o sigact.o strlcat.o strlcpy.o strmode.o strsep.o strtonum.o strtoll.o strtoul.o vis.o |
20 | 20 | ||
21 | COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-snprintf.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o | 21 | COMPAT=bsd-arc4random.o bsd-asprintf.o bsd-closefrom.o bsd-cray.o bsd-cygwin_util.o bsd-getpeereid.o bsd-misc.o bsd-nextstep.o bsd-openpty.o bsd-poll.o bsd-snprintf.o bsd-waitpid.o fake-rfc2553.o openssl-compat.o xmmap.o xcrypt.o |
22 | 22 | ||
23 | PORTS=port-aix.o port-irix.o port-linux.o port-solaris.o port-tun.o port-uw.o | 23 | PORTS=port-aix.o port-irix.o port-linux.o port-solaris.o port-tun.o port-uw.o |
24 | 24 | ||
diff --git a/openbsd-compat/bsd-cray.c b/openbsd-compat/bsd-cray.c index 1532c991c..f1bbd7dec 100644 --- a/openbsd-compat/bsd-cray.c +++ b/openbsd-compat/bsd-cray.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * $Id: bsd-cray.c,v 1.16 2006/09/01 05:38:41 djm 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 | * |
@@ -751,8 +751,6 @@ cray_job_termination_handler(int sig) | |||
751 | char *login = NULL; | 751 | char *login = NULL; |
752 | struct jtab jtab; | 752 | struct jtab jtab; |
753 | 753 | ||
754 | debug("received signal %d",sig); | ||
755 | |||
756 | if ((jid = waitjob(&jtab)) == -1 || | 754 | if ((jid = waitjob(&jtab)) == -1 || |
757 | (login = uid2nam(jtab.j_uid)) == NULL) | 755 | (login = uid2nam(jtab.j_uid)) == NULL) |
758 | return; | 756 | return; |
diff --git a/openbsd-compat/bsd-getpeereid.c b/openbsd-compat/bsd-getpeereid.c index bdae8b637..5f7e677e5 100644 --- a/openbsd-compat/bsd-getpeereid.c +++ b/openbsd-compat/bsd-getpeereid.c | |||
@@ -37,6 +37,28 @@ getpeereid(int s, uid_t *euid, gid_t *gid) | |||
37 | 37 | ||
38 | return (0); | 38 | return (0); |
39 | } | 39 | } |
40 | #elif defined(HAVE_GETPEERUCRED) | ||
41 | |||
42 | #ifdef HAVE_UCRED_H | ||
43 | # include <ucred.h> | ||
44 | #endif | ||
45 | |||
46 | int | ||
47 | getpeereid(int s, uid_t *euid, gid_t *gid) | ||
48 | { | ||
49 | ucred_t *ucred = NULL; | ||
50 | |||
51 | if (getpeerucred(s, &ucred) == -1) | ||
52 | return (-1); | ||
53 | if ((*euid = ucred_geteuid(ucred)) == -1) | ||
54 | return (-1); | ||
55 | if ((*gid = ucred_getrgid(ucred)) == -1) | ||
56 | return (-1); | ||
57 | |||
58 | ucred_free(ucred); | ||
59 | |||
60 | return (0); | ||
61 | } | ||
40 | #else | 62 | #else |
41 | int | 63 | int |
42 | getpeereid(int s, uid_t *euid, gid_t *gid) | 64 | getpeereid(int s, uid_t *euid, gid_t *gid) |
diff --git a/openbsd-compat/bsd-misc.c b/openbsd-compat/bsd-misc.c index 17d731bd2..55f100ac0 100644 --- a/openbsd-compat/bsd-misc.c +++ b/openbsd-compat/bsd-misc.c | |||
@@ -17,6 +17,7 @@ | |||
17 | 17 | ||
18 | #include "includes.h" | 18 | #include "includes.h" |
19 | 19 | ||
20 | #include <sys/types.h> | ||
20 | #ifdef HAVE_SYS_SELECT_H | 21 | #ifdef HAVE_SYS_SELECT_H |
21 | # include <sys/select.h> | 22 | # include <sys/select.h> |
22 | #endif | 23 | #endif |
@@ -27,6 +28,7 @@ | |||
27 | #include <string.h> | 28 | #include <string.h> |
28 | #include <signal.h> | 29 | #include <signal.h> |
29 | #include <stdlib.h> | 30 | #include <stdlib.h> |
31 | #include <unistd.h> | ||
30 | 32 | ||
31 | #include "xmalloc.h" | 33 | #include "xmalloc.h" |
32 | 34 | ||
@@ -156,7 +158,8 @@ int nanosleep(const struct timespec *req, struct timespec *rem) | |||
156 | tremain.tv_sec = 0; | 158 | tremain.tv_sec = 0; |
157 | tremain.tv_usec = 0; | 159 | tremain.tv_usec = 0; |
158 | } | 160 | } |
159 | TIMEVAL_TO_TIMESPEC(&tremain, rem) | 161 | if (rem != NULL) |
162 | TIMEVAL_TO_TIMESPEC(&tremain, rem) | ||
160 | 163 | ||
161 | return(rc); | 164 | return(rc); |
162 | } | 165 | } |
diff --git a/openbsd-compat/bsd-poll.c b/openbsd-compat/bsd-poll.c new file mode 100644 index 000000000..836882eea --- /dev/null +++ b/openbsd-compat/bsd-poll.c | |||
@@ -0,0 +1,117 @@ | |||
1 | /* $Id: bsd-poll.c,v 1.1 2007/06/25 12:15:13 dtucker Exp $ */ | ||
2 | |||
3 | /* | ||
4 | * Copyright (c) 2004, 2005, 2007 Darren Tucker (dtucker at zip com au). | ||
5 | * | ||
6 | * Permission to use, copy, modify, and distribute this software for any | ||
7 | * purpose with or without fee is hereby granted, provided that the above | ||
8 | * copyright notice and this permission notice appear in all copies. | ||
9 | * | ||
10 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||
11 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||
12 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||
13 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||
14 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||
15 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||
16 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||
17 | */ | ||
18 | |||
19 | #include "includes.h" | ||
20 | #if !defined(HAVE_POLL) && defined(HAVE_SELECT) | ||
21 | |||
22 | #ifdef HAVE_SYS_SELECT_H | ||
23 | # include <sys/select.h> | ||
24 | #endif | ||
25 | |||
26 | #include <errno.h> | ||
27 | #include "bsd-poll.h" | ||
28 | |||
29 | /* | ||
30 | * A minimal implementation of poll(2), built on top of select(2). | ||
31 | * | ||
32 | * Only supports POLLIN and POLLOUT flags in pfd.events, and POLLIN, POLLOUT | ||
33 | * and POLLERR flags in revents. | ||
34 | * | ||
35 | * Supports pfd.fd = -1 meaning "unused" although it's not standard. | ||
36 | */ | ||
37 | |||
38 | int | ||
39 | poll(struct pollfd *fds, nfds_t nfds, int timeout) | ||
40 | { | ||
41 | nfds_t i; | ||
42 | int saved_errno, ret, fd, maxfd = 0; | ||
43 | fd_set *readfds = NULL, *writefds = NULL, *exceptfds = NULL; | ||
44 | size_t nmemb; | ||
45 | struct timeval tv, *tvp = NULL; | ||
46 | |||
47 | for (i = 0; i < nfds; i++) { | ||
48 | if (fd >= FD_SETSIZE) { | ||
49 | errno = EINVAL; | ||
50 | return -1; | ||
51 | } | ||
52 | maxfd = MAX(maxfd, fds[i].fd); | ||
53 | } | ||
54 | |||
55 | nmemb = howmany(maxfd + 1 , NFDBITS); | ||
56 | if ((readfds = calloc(nmemb, sizeof(fd_mask))) == NULL || | ||
57 | (writefds = calloc(nmemb, sizeof(fd_mask))) == NULL || | ||
58 | (exceptfds = calloc(nmemb, sizeof(fd_mask))) == NULL) { | ||
59 | saved_errno = ENOMEM; | ||
60 | ret = -1; | ||
61 | goto out; | ||
62 | } | ||
63 | |||
64 | /* populate event bit vectors for the events we're interested in */ | ||
65 | for (i = 0; i < nfds; i++) { | ||
66 | fd = fds[i].fd; | ||
67 | if (fd == -1) | ||
68 | continue; | ||
69 | if (fds[i].events & POLLIN) { | ||
70 | FD_SET(fd, readfds); | ||
71 | FD_SET(fd, exceptfds); | ||
72 | } | ||
73 | if (fds[i].events & POLLOUT) { | ||
74 | FD_SET(fd, writefds); | ||
75 | FD_SET(fd, exceptfds); | ||
76 | } | ||
77 | } | ||
78 | |||
79 | /* poll timeout is msec, select is timeval (sec + usec) */ | ||
80 | if (timeout >= 0) { | ||
81 | tv.tv_sec = timeout / 1000; | ||
82 | tv.tv_usec = (timeout % 1000) * 1000; | ||
83 | tvp = &tv; | ||
84 | } | ||
85 | |||
86 | ret = select(maxfd + 1, readfds, writefds, exceptfds, tvp); | ||
87 | saved_errno = errno; | ||
88 | |||
89 | /* scan through select results and set poll() flags */ | ||
90 | for (i = 0; i < nfds; i++) { | ||
91 | fd = fds[i].fd; | ||
92 | fds[i].revents = 0; | ||
93 | if (fd == -1) | ||
94 | continue; | ||
95 | if (FD_ISSET(fd, readfds)) { | ||
96 | fds[i].revents |= POLLIN; | ||
97 | } | ||
98 | if (FD_ISSET(fd, writefds)) { | ||
99 | fds[i].revents |= POLLOUT; | ||
100 | } | ||
101 | if (FD_ISSET(fd, exceptfds)) { | ||
102 | fds[i].revents |= POLLERR; | ||
103 | } | ||
104 | } | ||
105 | |||
106 | out: | ||
107 | if (readfds != NULL) | ||
108 | free(readfds); | ||
109 | if (writefds != NULL) | ||
110 | free(writefds); | ||
111 | if (exceptfds != NULL) | ||
112 | free(exceptfds); | ||
113 | if (ret == -1) | ||
114 | errno = saved_errno; | ||
115 | return ret; | ||
116 | } | ||
117 | #endif | ||
diff --git a/openbsd-compat/bsd-poll.h b/openbsd-compat/bsd-poll.h new file mode 100644 index 000000000..dcbb9ca40 --- /dev/null +++ b/openbsd-compat/bsd-poll.h | |||
@@ -0,0 +1,61 @@ | |||
1 | /* $OpenBSD: poll.h,v 1.11 2003/12/10 23:10:08 millert Exp $ */ | ||
2 | |||
3 | /* | ||
4 | * Copyright (c) 1996 Theo de Raadt | ||
5 | * All rights reserved. | ||
6 | * | ||
7 | * Redistribution and use in source and binary forms, with or without | ||
8 | * modification, are permitted provided that the following conditions | ||
9 | * are met: | ||
10 | * 1. Redistributions of source code must retain the above copyright | ||
11 | * notice, this list of conditions and the following disclaimer. | ||
12 | * 2. Redistributions in binary form must reproduce the above copyright | ||
13 | * notice, this list of conditions and the following disclaimer in the | ||
14 | * documentation and/or other materials provided with the distribution. | ||
15 | * | ||
16 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR | ||
17 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES | ||
18 | * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. | ||
19 | * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
20 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
21 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
22 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
23 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
24 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
25 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
26 | */ | ||
27 | |||
28 | /* OPENBSD ORIGINAL: sys/sys/poll.h */ | ||
29 | |||
30 | #if !defined(HAVE_POLL) && !defined(HAVE_POLL_H) | ||
31 | #ifndef _COMPAT_POLL_H_ | ||
32 | #define _COMPAT_POLL_H_ | ||
33 | |||
34 | typedef struct pollfd { | ||
35 | int fd; | ||
36 | short events; | ||
37 | short revents; | ||
38 | } pollfd_t; | ||
39 | |||
40 | typedef unsigned int nfds_t; | ||
41 | |||
42 | #define POLLIN 0x0001 | ||
43 | #define POLLOUT 0x0004 | ||
44 | #define POLLERR 0x0008 | ||
45 | #if 0 | ||
46 | /* the following are currently not implemented */ | ||
47 | #define POLLPRI 0x0002 | ||
48 | #define POLLHUP 0x0010 | ||
49 | #define POLLNVAL 0x0020 | ||
50 | #define POLLRDNORM 0x0040 | ||
51 | #define POLLNORM POLLRDNORM | ||
52 | #define POLLWRNORM POLLOUT | ||
53 | #define POLLRDBAND 0x0080 | ||
54 | #define POLLWRBAND 0x0100 | ||
55 | #endif | ||
56 | |||
57 | #define INFTIM (-1) /* not standard */ | ||
58 | |||
59 | int poll(struct pollfd *, nfds_t, int); | ||
60 | #endif /* !_COMPAT_POLL_H_ */ | ||
61 | #endif /* !HAVE_POLL_H */ | ||
diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c index 07231d005..80af3f542 100644 --- a/openbsd-compat/getrrsetbyname.c +++ b/openbsd-compat/getrrsetbyname.c | |||
@@ -67,13 +67,9 @@ extern int h_errno; | |||
67 | #endif | 67 | #endif |
68 | #define _THREAD_PRIVATE(a,b,c) (c) | 68 | #define _THREAD_PRIVATE(a,b,c) (c) |
69 | 69 | ||
70 | /* to avoid conflicts where a platform already has _res */ | 70 | #ifndef HAVE__RES_EXTERN |
71 | #ifdef _res | ||
72 | # undef _res | ||
73 | #endif | ||
74 | #define _res _compat_res | ||
75 | |||
76 | struct __res_state _res; | 71 | struct __res_state _res; |
72 | #endif | ||
77 | 73 | ||
78 | /* Necessary functions and macros */ | 74 | /* Necessary functions and macros */ |
79 | 75 | ||
diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h index aac2e6cbc..6406af19d 100644 --- a/openbsd-compat/openbsd-compat.h +++ b/openbsd-compat/openbsd-compat.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openbsd-compat.h,v 1.42 2006/09/03 12:44:50 dtucker Exp $ */ | 1 | /* $Id: openbsd-compat.h,v 1.43 2007/06/25 12:15:13 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 1999-2003 Damien Miller. All rights reserved. | 4 | * Copyright (c) 1999-2003 Damien Miller. All rights reserved. |
@@ -140,6 +140,7 @@ int writev(int, struct iovec *, int); | |||
140 | /* Home grown routines */ | 140 | /* Home grown routines */ |
141 | #include "bsd-misc.h" | 141 | #include "bsd-misc.h" |
142 | #include "bsd-waitpid.h" | 142 | #include "bsd-waitpid.h" |
143 | #include "bsd-poll.h" | ||
143 | 144 | ||
144 | #ifndef HAVE_GETPEEREID | 145 | #ifndef HAVE_GETPEEREID |
145 | int getpeereid(int , uid_t *, gid_t *); | 146 | int getpeereid(int , uid_t *, gid_t *); |
diff --git a/openbsd-compat/openssl-compat.h b/openbsd-compat/openssl-compat.h index 9b5ccff5f..f1d2f19fc 100644 --- a/openbsd-compat/openssl-compat.h +++ b/openbsd-compat/openssl-compat.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: openssl-compat.h,v 1.7 2007/03/05 07:25:20 dtucker Exp $ */ | 1 | /* $Id: openssl-compat.h,v 1.10 2007/06/14 13:47:31 dtucker Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> | 4 | * Copyright (c) 2005 Darren Tucker <dtucker@zip.com.au> |
@@ -29,6 +29,11 @@ | |||
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #ifdef USE_BUILTIN_RIJNDAEL | 31 | #ifdef USE_BUILTIN_RIJNDAEL |
32 | # include "rijndael.h" | ||
33 | # define AES_KEY rijndael_ctx | ||
34 | # define AES_BLOCK_SIZE 16 | ||
35 | # define AES_encrypt(a, b, c) rijndael_encrypt(c, a, b) | ||
36 | # define AES_set_encrypt_key(a, b, c) rijndael_set_key(c, (char *)a, b, 1) | ||
32 | # define EVP_aes_128_cbc evp_rijndael | 37 | # define EVP_aes_128_cbc evp_rijndael |
33 | # define EVP_aes_192_cbc evp_rijndael | 38 | # define EVP_aes_192_cbc evp_rijndael |
34 | # define EVP_aes_256_cbc evp_rijndael | 39 | # define EVP_aes_256_cbc evp_rijndael |
diff --git a/openbsd-compat/port-aix.c b/openbsd-compat/port-aix.c index b9fabf61f..94faec670 100644 --- a/openbsd-compat/port-aix.c +++ b/openbsd-compat/port-aix.c | |||
@@ -240,7 +240,7 @@ sys_auth_allowed_user(struct passwd *pw, Buffer *loginmsg) | |||
240 | 240 | ||
241 | /* | 241 | /* |
242 | * Don't perform checks for root account (PermitRootLogin controls | 242 | * Don't perform checks for root account (PermitRootLogin controls |
243 | * logins via * ssh) or if running as non-root user (since | 243 | * logins via ssh) or if running as non-root user (since |
244 | * loginrestrictions will always fail due to insufficient privilege). | 244 | * loginrestrictions will always fail due to insufficient privilege). |
245 | */ | 245 | */ |
246 | if (pw->pw_uid == 0 || geteuid() != 0) { | 246 | if (pw->pw_uid == 0 || geteuid() != 0) { |
diff --git a/openbsd-compat/port-linux.c b/openbsd-compat/port-linux.c index 77f3a1c17..2f697e7d9 100644 --- a/openbsd-compat/port-linux.c +++ b/openbsd-compat/port-linux.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $Id: port-linux.c,v 1.3 2006/09/01 05:38:41 djm Exp $ */ | 1 | /* $Id: port-linux.c,v 1.4 2007/06/27 22:48:03 djm Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2005 Daniel Walsh <dwalsh@redhat.com> | 4 | * Copyright (c) 2005 Daniel Walsh <dwalsh@redhat.com> |
@@ -79,6 +79,7 @@ ssh_selinux_getctxbyname(char *pwname) | |||
79 | case 0: | 79 | case 0: |
80 | error("%s: Failed to get default SELinux security " | 80 | error("%s: Failed to get default SELinux security " |
81 | "context for %s", __func__, pwname); | 81 | "context for %s", __func__, pwname); |
82 | break; | ||
82 | default: | 83 | default: |
83 | fatal("%s: Failed to get default SELinux security " | 84 | fatal("%s: Failed to get default SELinux security " |
84 | "context for %s (in enforcing mode)", | 85 | "context for %s (in enforcing mode)", |
@@ -115,6 +116,7 @@ ssh_selinux_setup_exec_context(char *pwname) | |||
115 | case 0: | 116 | case 0: |
116 | error("%s: Failed to set SELinux execution " | 117 | error("%s: Failed to set SELinux execution " |
117 | "context for %s", __func__, pwname); | 118 | "context for %s", __func__, pwname); |
119 | break; | ||
118 | default: | 120 | default: |
119 | fatal("%s: Failed to set SELinux execution context " | 121 | fatal("%s: Failed to set SELinux execution context " |
120 | "for %s (in enforcing mode)", __func__, pwname); | 122 | "for %s (in enforcing mode)", __func__, pwname); |
diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c index 6f3523902..ebc229a6a 100644 --- a/openbsd-compat/port-uw.c +++ b/openbsd-compat/port-uw.c | |||
@@ -79,7 +79,7 @@ sys_auth_passwd(Authctxt *authctxt, const char *password) | |||
79 | #endif /* UNIXWARE_LONG_PASSWORDS */ | 79 | #endif /* UNIXWARE_LONG_PASSWORDS */ |
80 | result = (strcmp(xcrypt(password, salt), pw_password) == 0); | 80 | result = (strcmp(xcrypt(password, salt), pw_password) == 0); |
81 | 81 | ||
82 | #if !defined(BROKEN_LIBIAF) | 82 | #ifdef USE_LIBIAF |
83 | if (authctxt->valid) | 83 | if (authctxt->valid) |
84 | free(pw_password); | 84 | free(pw_password); |
85 | #endif | 85 | #endif |
@@ -127,7 +127,7 @@ nischeck(char *namep) | |||
127 | functions that call shadow_pw() will need to free | 127 | functions that call shadow_pw() will need to free |
128 | */ | 128 | */ |
129 | 129 | ||
130 | #if !defined(BROKEN_LIBIAF) | 130 | #ifdef USE_LIBIAF |
131 | char * | 131 | char * |
132 | get_iaf_password(struct passwd *pw) | 132 | get_iaf_password(struct passwd *pw) |
133 | { | 133 | { |
@@ -144,6 +144,6 @@ get_iaf_password(struct passwd *pw) | |||
144 | else | 144 | else |
145 | fatal("ia_openinfo: Unable to open the shadow passwd file"); | 145 | fatal("ia_openinfo: Unable to open the shadow passwd file"); |
146 | } | 146 | } |
147 | #endif /* !BROKEN_LIBIAF */ | 147 | #endif /* USE_LIBIAF */ |
148 | #endif /* HAVE_LIBIAF */ | 148 | #endif /* HAVE_LIBIAF */ |
149 | 149 | ||
diff --git a/openbsd-compat/port-uw.h b/openbsd-compat/port-uw.h index 3589b2e44..263d8b5a7 100644 --- a/openbsd-compat/port-uw.h +++ b/openbsd-compat/port-uw.h | |||
@@ -24,7 +24,7 @@ | |||
24 | 24 | ||
25 | #include "includes.h" | 25 | #include "includes.h" |
26 | 26 | ||
27 | #if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) | 27 | #ifdef USE_LIBIAF |
28 | char * get_iaf_password(struct passwd *pw); | 28 | char * get_iaf_password(struct passwd *pw); |
29 | #endif | 29 | #endif |
30 | 30 | ||
diff --git a/openbsd-compat/regress/closefromtest.c b/openbsd-compat/regress/closefromtest.c index feb1b567d..bb129fa16 100644 --- a/openbsd-compat/regress/closefromtest.c +++ b/openbsd-compat/regress/closefromtest.c | |||
@@ -38,7 +38,7 @@ main(void) | |||
38 | char buf[512]; | 38 | char buf[512]; |
39 | 39 | ||
40 | for (i = 0; i < NUM_OPENS; i++) | 40 | for (i = 0; i < NUM_OPENS; i++) |
41 | if ((fds[i] = open("/dev/null", "r")) == -1) | 41 | if ((fds[i] = open("/dev/null", O_RDONLY)) == -1) |
42 | exit(0); /* can't test */ | 42 | exit(0); /* can't test */ |
43 | max = i - 1; | 43 | max = i - 1; |
44 | 44 | ||
diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c index 14899321f..d8636bb39 100644 --- a/openbsd-compat/xcrypt.c +++ b/openbsd-compat/xcrypt.c | |||
@@ -98,7 +98,7 @@ shadow_pw(struct passwd *pw) | |||
98 | pw_password = spw->sp_pwdp; | 98 | pw_password = spw->sp_pwdp; |
99 | # endif | 99 | # endif |
100 | 100 | ||
101 | #if defined(HAVE_LIBIAF) && !defined(BROKEN_LIBIAF) | 101 | #ifdef USE_LIBIAF |
102 | return(get_iaf_password(pw)); | 102 | return(get_iaf_password(pw)); |
103 | #endif | 103 | #endif |
104 | 104 | ||
diff --git a/openbsd-compat/xmmap.c b/openbsd-compat/xmmap.c index 0fb23269b..23efe3888 100644 --- a/openbsd-compat/xmmap.c +++ b/openbsd-compat/xmmap.c | |||
@@ -23,7 +23,7 @@ | |||
23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | /* $Id: xmmap.c,v 1.12 2006/08/24 09:58:36 dtucker Exp $ */ | 26 | /* $Id: xmmap.c,v 1.14 2007/06/11 02:52:24 djm Exp $ */ |
27 | 27 | ||
28 | #include "includes.h" | 28 | #include "includes.h" |
29 | 29 | ||
@@ -38,12 +38,14 @@ | |||
38 | #endif | 38 | #endif |
39 | #include <errno.h> | 39 | #include <errno.h> |
40 | #include <stdarg.h> | 40 | #include <stdarg.h> |
41 | #include <stdlib.h> | ||
41 | #include <string.h> | 42 | #include <string.h> |
42 | #include <unistd.h> | 43 | #include <unistd.h> |
43 | 44 | ||
44 | #include "log.h" | 45 | #include "log.h" |
45 | 46 | ||
46 | void *xmmap(size_t size) | 47 | void * |
48 | xmmap(size_t size) | ||
47 | { | 49 | { |
48 | #ifdef HAVE_MMAP | 50 | #ifdef HAVE_MMAP |
49 | void *address; | 51 | void *address; |