summaryrefslogtreecommitdiff
path: root/openbsd-compat
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2004-05-01 11:41:25 +0000
committerColin Watson <cjwatson@debian.org>2004-05-01 11:41:25 +0000
commit915bfea2af69a3bb352a9b4e98e3434b8425124d (patch)
treeef732498a75f2e13a7a9827edc833dc58bc2a2af /openbsd-compat
parent89e7a2dfe6044f3980098911a7470d401ff70eb1 (diff)
parent16f1d21ea191deaaeeba719d01c0ad82aa044653 (diff)
Merge 3.8.1p1 to the trunk, minus RFC.nroff (#211640).
Diffstat (limited to 'openbsd-compat')
-rw-r--r--openbsd-compat/bsd-cygwin_util.c12
-rw-r--r--openbsd-compat/bsd-misc.h6
-rw-r--r--openbsd-compat/fake-rfc2553.h5
-rw-r--r--openbsd-compat/setenv.c8
-rw-r--r--openbsd-compat/xcrypt.c4
5 files changed, 25 insertions, 10 deletions
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c
index a87cf3c97..92cdba6e0 100644
--- a/openbsd-compat/bsd-cygwin_util.c
+++ b/openbsd-compat/bsd-cygwin_util.c
@@ -29,7 +29,7 @@
29 29
30#include "includes.h" 30#include "includes.h"
31 31
32RCSID("$Id: bsd-cygwin_util.c,v 1.11 2003/08/07 06:23:43 dtucker Exp $"); 32RCSID("$Id: bsd-cygwin_util.c,v 1.12 2004/04/18 11:15:45 djm Exp $");
33 33
34#ifdef HAVE_CYGWIN 34#ifdef HAVE_CYGWIN
35 35
@@ -77,6 +77,7 @@ binary_pipe(int fd[2])
77 77
78#define HAS_CREATE_TOKEN 1 78#define HAS_CREATE_TOKEN 1
79#define HAS_NTSEC_BY_DEFAULT 2 79#define HAS_NTSEC_BY_DEFAULT 2
80#define HAS_CREATE_TOKEN_WO_NTSEC 3
80 81
81static int 82static int
82has_capability(int what) 83has_capability(int what)
@@ -84,6 +85,7 @@ has_capability(int what)
84 static int inited; 85 static int inited;
85 static int has_create_token; 86 static int has_create_token;
86 static int has_ntsec_by_default; 87 static int has_ntsec_by_default;
88 static int has_create_token_wo_ntsec;
87 89
88 /* 90 /*
89 * has_capability() basically calls uname() and checks if 91 * has_capability() basically calls uname() and checks if
@@ -113,6 +115,9 @@ has_capability(int what)
113 has_create_token = 1; 115 has_create_token = 1;
114 if (api_major_version > 0 || api_minor_version >= 56) 116 if (api_major_version > 0 || api_minor_version >= 56)
115 has_ntsec_by_default = 1; 117 has_ntsec_by_default = 1;
118 if (major_high > 1 ||
119 (major_high == 1 && major_low >= 5))
120 has_create_token_wo_ntsec = 1;
116 inited = 1; 121 inited = 1;
117 } 122 }
118 } 123 }
@@ -121,6 +126,8 @@ has_capability(int what)
121 return (has_create_token); 126 return (has_create_token);
122 case HAS_NTSEC_BY_DEFAULT: 127 case HAS_NTSEC_BY_DEFAULT:
123 return (has_ntsec_by_default); 128 return (has_ntsec_by_default);
129 case HAS_CREATE_TOKEN_WO_NTSEC:
130 return (has_create_token_wo_ntsec);
124 } 131 }
125 return (0); 132 return (0);
126} 133}
@@ -151,7 +158,8 @@ check_nt_auth(int pwd_authenticated, struct passwd *pw)
151 if (has_capability(HAS_CREATE_TOKEN) && 158 if (has_capability(HAS_CREATE_TOKEN) &&
152 (ntsec_on(cygwin) || 159 (ntsec_on(cygwin) ||
153 (has_capability(HAS_NTSEC_BY_DEFAULT) && 160 (has_capability(HAS_NTSEC_BY_DEFAULT) &&
154 !ntsec_off(cygwin)))) 161 !ntsec_off(cygwin)) ||
162 has_capability(HAS_CREATE_TOKEN_WO_NTSEC)))
155 has_create_token = 1; 163 has_create_token = 1;
156 } 164 }
157 if (has_create_token < 1 && 165 if (has_create_token < 1 &&
diff --git a/openbsd-compat/bsd-misc.h b/openbsd-compat/bsd-misc.h
index c8073942c..009739b14 100644
--- a/openbsd-compat/bsd-misc.h
+++ b/openbsd-compat/bsd-misc.h
@@ -1,4 +1,4 @@
1/* $Id: bsd-misc.h,v 1.14 2004/02/17 05:49:55 djm Exp $ */ 1/* $Id: bsd-misc.h,v 1.15 2004/03/08 11:59:03 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org> 4 * Copyright (c) 1999-2004 Damien Miller <djm@mindrot.org>
@@ -89,6 +89,10 @@ pid_t tcgetpgrp(int);
89int tcsendbreak(int, int); 89int tcsendbreak(int, int);
90#endif 90#endif
91 91
92#ifndef HAVE_UNSETENV
93void unsetenv(const char *);
94#endif
95
92/* wrapper for signal interface */ 96/* wrapper for signal interface */
93typedef void (*mysig_t)(int); 97typedef void (*mysig_t)(int);
94mysig_t mysignal(int sig, mysig_t act); 98mysig_t mysignal(int sig, mysig_t act);
diff --git a/openbsd-compat/fake-rfc2553.h b/openbsd-compat/fake-rfc2553.h
index eb88605fa..baea07038 100644
--- a/openbsd-compat/fake-rfc2553.h
+++ b/openbsd-compat/fake-rfc2553.h
@@ -1,4 +1,4 @@
1/* $Id: fake-rfc2553.h,v 1.8 2004/02/10 02:05:41 dtucker Exp $ */ 1/* $Id: fake-rfc2553.h,v 1.9 2004/03/10 10:06:33 dtucker Exp $ */
2 2
3/* 3/*
4 * Copyright (C) 2000-2003 Damien Miller. All rights reserved. 4 * Copyright (C) 2000-2003 Damien Miller. All rights reserved.
@@ -133,6 +133,9 @@ struct addrinfo {
133#endif /* !HAVE_STRUCT_ADDRINFO */ 133#endif /* !HAVE_STRUCT_ADDRINFO */
134 134
135#ifndef HAVE_GETADDRINFO 135#ifndef HAVE_GETADDRINFO
136#ifdef getaddrinfo
137# undef getaddrinfo
138#endif
136#define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d)) 139#define getaddrinfo(a,b,c,d) (ssh_getaddrinfo(a,b,c,d))
137int getaddrinfo(const char *, const char *, 140int getaddrinfo(const char *, const char *,
138 const struct addrinfo *, struct addrinfo **); 141 const struct addrinfo *, struct addrinfo **);
diff --git a/openbsd-compat/setenv.c b/openbsd-compat/setenv.c
index b7ba0ce83..c3a86c651 100644
--- a/openbsd-compat/setenv.c
+++ b/openbsd-compat/setenv.c
@@ -30,7 +30,7 @@
30 */ 30 */
31 31
32#include "includes.h" 32#include "includes.h"
33#ifndef HAVE_SETENV 33#if !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV)
34 34
35#if defined(LIBC_SCCS) && !defined(lint) 35#if defined(LIBC_SCCS) && !defined(lint)
36static char *rcsid = "$OpenBSD: setenv.c,v 1.6 2003/06/02 20:18:38 millert Exp $"; 36static char *rcsid = "$OpenBSD: setenv.c,v 1.6 2003/06/02 20:18:38 millert Exp $";
@@ -77,6 +77,7 @@ __findenv(name, offset)
77 return (NULL); 77 return (NULL);
78} 78}
79 79
80#ifndef HAVE_SETENV
80/* 81/*
81 * setenv -- 82 * setenv --
82 * Set the value of the environmental variable "name" to be 83 * Set the value of the environmental variable "name" to be
@@ -138,7 +139,9 @@ setenv(name, value, rewrite)
138 ; 139 ;
139 return (0); 140 return (0);
140} 141}
142#endif /* HAVE_SETENV */
141 143
144#ifndef HAVE_UNSETENV
142/* 145/*
143 * unsetenv(name) -- 146 * unsetenv(name) --
144 * Delete environmental variable "name". 147 * Delete environmental variable "name".
@@ -157,5 +160,6 @@ unsetenv(name)
157 if (!(*P = *(P + 1))) 160 if (!(*P = *(P + 1)))
158 break; 161 break;
159} 162}
163#endif /* HAVE_UNSETENV */
160 164
161#endif /* HAVE_SETENV */ 165#endif /* !defined(HAVE_SETENV) || !defined(HAVE_UNSETENV) */
diff --git a/openbsd-compat/xcrypt.c b/openbsd-compat/xcrypt.c
index a0fe6c620..c3cea3c86 100644
--- a/openbsd-compat/xcrypt.c
+++ b/openbsd-compat/xcrypt.c
@@ -24,8 +24,6 @@
24 24
25#include "includes.h" 25#include "includes.h"
26 26
27#if !defined(HAVE_OSF_SIA)
28
29# ifdef HAVE_CRYPT_H 27# ifdef HAVE_CRYPT_H
30# include <crypt.h> 28# include <crypt.h>
31# endif 29# endif
@@ -108,5 +106,3 @@ shadow_pw(struct passwd *pw)
108 106
109 return pw_password; 107 return pw_password;
110} 108}
111
112#endif /* !defined(HAVE_OSF_SIA) */