diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | configure.ac | 45 | ||||
-rw-r--r-- | contrib/cygwin/README | 14 | ||||
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.c | 24 | ||||
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.h | 3 | ||||
-rw-r--r-- | openbsd-compat/daemon.c | 3 |
6 files changed, 81 insertions, 17 deletions
@@ -1,3 +1,10 @@ | |||
1 | 20011126 | ||
2 | - (tim) [contrib/cygwin/README, openbsd-compat/bsd-cygwin_util.c, | ||
3 | openbsd-compat/bsd-cygwin_util.h, openbsd-compat/daemon.c] | ||
4 | Allow SSHD to install as service under WIndows 9x/Me | ||
5 | [configure.ac] Fix to allow linking against PCRE on Cygwin | ||
6 | Patches by Corinna Vinschen <vinschen@redhat.com> | ||
7 | |||
1 | 20011115 | 8 | 20011115 |
2 | - (djm) Fix IPv4 default in ssh-keyscan. Spotted by Dan Astoorian | 9 | - (djm) Fix IPv4 default in ssh-keyscan. Spotted by Dan Astoorian |
3 | <djast@cs.toronto.edu> Fix from markus@ | 10 | <djast@cs.toronto.edu> Fix from markus@ |
@@ -6912,4 +6919,4 @@ | |||
6912 | - Wrote replacements for strlcpy and mkdtemp | 6919 | - Wrote replacements for strlcpy and mkdtemp |
6913 | - Released 1.0pre1 | 6920 | - Released 1.0pre1 |
6914 | 6921 | ||
6915 | $Id: ChangeLog,v 1.1665 2001/11/15 12:16:50 djm Exp $ | 6922 | $Id: ChangeLog,v 1.1666 2001/11/27 01:19:43 tim Exp $ |
diff --git a/configure.ac b/configure.ac index e1844eb56..d86a2062d 100644 --- a/configure.ac +++ b/configure.ac | |||
@@ -1,4 +1,4 @@ | |||
1 | # $Id: configure.ac,v 1.4 2001/11/03 19:09:33 tim Exp $ | 1 | # $Id: configure.ac,v 1.5 2001/11/27 01:19:43 tim Exp $ |
2 | 2 | ||
3 | AC_INIT | 3 | AC_INIT |
4 | AC_CONFIG_SRCDIR([ssh.c]) | 4 | AC_CONFIG_SRCDIR([ssh.c]) |
@@ -65,7 +65,7 @@ case "$host" in | |||
65 | AC_DEFINE(DISABLE_LASTLOG) | 65 | AC_DEFINE(DISABLE_LASTLOG) |
66 | ;; | 66 | ;; |
67 | *-*-cygwin*) | 67 | *-*-cygwin*) |
68 | LIBS="$LIBS -lregex /usr/lib/textmode.o" | 68 | LIBS="$LIBS /usr/lib/textmode.o" |
69 | AC_DEFINE(HAVE_CYGWIN) | 69 | AC_DEFINE(HAVE_CYGWIN) |
70 | AC_DEFINE(USE_PIPES) | 70 | AC_DEFINE(USE_PIPES) |
71 | AC_DEFINE(DISABLE_SHADOW) | 71 | AC_DEFINE(DISABLE_SHADOW) |
@@ -401,18 +401,43 @@ AC_CHECK_LIB(z, deflate, ,AC_MSG_ERROR([*** zlib missing - please install first | |||
401 | # We don't want to check if we did an pcre override. | 401 | # We don't want to check if we did an pcre override. |
402 | if test -z "$no_comp_check" ; then | 402 | if test -z "$no_comp_check" ; then |
403 | AC_CHECK_FUNC(regcomp, | 403 | AC_CHECK_FUNC(regcomp, |
404 | [ AC_DEFINE(HAVE_REGCOMP)], | ||
405 | [ | 404 | [ |
406 | AC_CHECK_LIB(pcre, pcre_info, | 405 | AC_CHECK_FUNC(regsub, |
406 | [ | ||
407 | has_regcomp=no | ||
408 | ], | ||
409 | [ | ||
410 | AC_DEFINE(HAVE_REGCOMP) | ||
411 | has_regcomp=yes | ||
412 | ] | ||
413 | ) | ||
414 | ], | ||
415 | [ | ||
416 | has_regcomp=no | ||
417 | ] | ||
418 | ) | ||
419 | # Either regcomp wasn't defined or regsub is defined (which means | ||
420 | # that the libc regex is probably an old non-POSIX implementation. | ||
421 | # Now check for -lregex and -lpcreposix to find some usable regex | ||
422 | # implementation. | ||
423 | if test "$has_regcomp" = "no" ; then | ||
424 | AC_CHECK_LIB(regex, regcomp, | ||
407 | [ | 425 | [ |
408 | AC_DEFINE(HAVE_LIBPCRE) | 426 | AC_DEFINE(HAVE_REGCOMP) |
409 | LIBS="$LIBS -lpcreposix -lpcre" | 427 | LIBS="$LIBS -lregex" |
410 | ], | 428 | ], |
411 | [ | 429 | [ |
412 | AC_MSG_ERROR([*** No regex library found.]) | 430 | AC_CHECK_LIB(pcre, pcre_info, |
413 | ]) | 431 | [ |
414 | ] | 432 | AC_DEFINE(HAVE_LIBPCRE) |
415 | ) | 433 | LIBS="$LIBS -lpcreposix -lpcre" |
434 | ], | ||
435 | [ | ||
436 | AC_MSG_ERROR([*** No regex library found.]) | ||
437 | ]) | ||
438 | ] | ||
439 | ) | ||
440 | fi | ||
416 | fi | 441 | fi |
417 | 442 | ||
418 | dnl UnixWare 2.x | 443 | dnl UnixWare 2.x |
diff --git a/contrib/cygwin/README b/contrib/cygwin/README index dfe178679..7f7f9a33c 100644 --- a/contrib/cygwin/README +++ b/contrib/cygwin/README | |||
@@ -1,6 +1,14 @@ | |||
1 | This package is the actual port of OpenSSH to Cygwin 1.3. | 1 | This package is the actual port of OpenSSH to Cygwin 1.3. |
2 | 2 | ||
3 | =========================================================================== | 3 | =========================================================================== |
4 | Important change since 3.0.1p1-2: | ||
5 | |||
6 | This version introduces the ability to register sshd as service on | ||
7 | Windows 9x/Me systems. This is done only when the options -D and/or | ||
8 | -d are not given. | ||
9 | =========================================================================== | ||
10 | |||
11 | =========================================================================== | ||
4 | Important change since 2.9p2: | 12 | Important change since 2.9p2: |
5 | 13 | ||
6 | Since Cygwin is able to switch user context without password beginning | 14 | Since Cygwin is able to switch user context without password beginning |
@@ -162,12 +170,10 @@ configure are used for the Cygwin binary distribution: | |||
162 | 170 | ||
163 | --prefix=/usr \ | 171 | --prefix=/usr \ |
164 | --sysconfdir=/etc \ | 172 | --sysconfdir=/etc \ |
165 | --libexecdir='${exec_prefix}/sbin \ | 173 | --libexecdir='${exec_prefix}/sbin' |
166 | --with-pcre | ||
167 | 174 | ||
168 | You must have installed the zlib, openssl and regex packages to | 175 | You must have installed the zlib, openssl and regex packages to |
169 | be able to build OpenSSH! The `--with-pcre' option requires | 176 | be able to build OpenSSH! |
170 | the installation of the pcre package. | ||
171 | 177 | ||
172 | Please send requests, error reports etc. to cygwin@cygwin.com. | 178 | Please send requests, error reports etc. to cygwin@cygwin.com. |
173 | 179 | ||
diff --git a/openbsd-compat/bsd-cygwin_util.c b/openbsd-compat/bsd-cygwin_util.c index 87f36c0cb..6d6aafa4f 100644 --- a/openbsd-compat/bsd-cygwin_util.c +++ b/openbsd-compat/bsd-cygwin_util.c | |||
@@ -15,7 +15,7 @@ | |||
15 | 15 | ||
16 | #include "includes.h" | 16 | #include "includes.h" |
17 | 17 | ||
18 | RCSID("$Id: bsd-cygwin_util.c,v 1.5 2001/07/18 16:19:49 mouring Exp $"); | 18 | RCSID("$Id: bsd-cygwin_util.c,v 1.6 2001/11/27 01:19:44 tim Exp $"); |
19 | 19 | ||
20 | #ifdef HAVE_CYGWIN | 20 | #ifdef HAVE_CYGWIN |
21 | 21 | ||
@@ -139,4 +139,26 @@ int check_ntsec(const char *filename) | |||
139 | return 0; | 139 | return 0; |
140 | } | 140 | } |
141 | 141 | ||
142 | void register_9x_service(void) | ||
143 | { | ||
144 | HINSTANCE kerneldll; | ||
145 | DWORD (*RegisterServiceProcess)(DWORD, DWORD); | ||
146 | |||
147 | /* The service register mechanism in 9x/Me is pretty different from | ||
148 | * NT/2K/XP. In NT/2K/XP we're using a special service starter | ||
149 | * application to register and control sshd as service. This method | ||
150 | * doesn't play nicely with 9x/Me. For that reason we register here | ||
151 | * as service when running under 9x/Me. This function is only called | ||
152 | * by the child sshd when it's going to daemonize. | ||
153 | */ | ||
154 | if (is_winnt) | ||
155 | return; | ||
156 | if (! (kerneldll = LoadLibrary("KERNEL32.DLL"))) | ||
157 | return; | ||
158 | if (! (RegisterServiceProcess = (DWORD (*)(DWORD, DWORD)) | ||
159 | GetProcAddress(kerneldll, "RegisterServiceProcess"))) | ||
160 | return; | ||
161 | RegisterServiceProcess(0, 1); | ||
162 | } | ||
163 | |||
142 | #endif /* HAVE_CYGWIN */ | 164 | #endif /* HAVE_CYGWIN */ |
diff --git a/openbsd-compat/bsd-cygwin_util.h b/openbsd-compat/bsd-cygwin_util.h index 7879501e0..24063d311 100644 --- a/openbsd-compat/bsd-cygwin_util.h +++ b/openbsd-compat/bsd-cygwin_util.h | |||
@@ -13,7 +13,7 @@ | |||
13 | * binary mode on Windows systems. | 13 | * binary mode on Windows systems. |
14 | */ | 14 | */ |
15 | 15 | ||
16 | /* $Id: bsd-cygwin_util.h,v 1.4 2001/04/13 14:28:43 djm Exp $ */ | 16 | /* $Id: bsd-cygwin_util.h,v 1.5 2001/11/27 01:19:44 tim Exp $ */ |
17 | 17 | ||
18 | #ifndef _BSD_CYGWIN_UTIL_H | 18 | #ifndef _BSD_CYGWIN_UTIL_H |
19 | #define _BSD_CYGWIN_UTIL_H | 19 | #define _BSD_CYGWIN_UTIL_H |
@@ -26,6 +26,7 @@ int binary_open(const char *filename, int flags, ...); | |||
26 | int binary_pipe(int fd[2]); | 26 | int binary_pipe(int fd[2]); |
27 | int check_nt_auth(int pwd_authenticated, uid_t uid); | 27 | int check_nt_auth(int pwd_authenticated, uid_t uid); |
28 | int check_ntsec(const char *filename); | 28 | int check_ntsec(const char *filename); |
29 | void register_9x_service(void); | ||
29 | 30 | ||
30 | #define open binary_open | 31 | #define open binary_open |
31 | #define pipe binary_pipe | 32 | #define pipe binary_pipe |
diff --git a/openbsd-compat/daemon.c b/openbsd-compat/daemon.c index f704a9048..7d23b2467 100644 --- a/openbsd-compat/daemon.c +++ b/openbsd-compat/daemon.c | |||
@@ -49,6 +49,9 @@ daemon(nochdir, noclose) | |||
49 | case -1: | 49 | case -1: |
50 | return (-1); | 50 | return (-1); |
51 | case 0: | 51 | case 0: |
52 | #ifdef HAVE_CYGWIN | ||
53 | register_9x_service(); | ||
54 | #endif | ||
52 | break; | 55 | break; |
53 | default: | 56 | default: |
54 | #ifdef HAVE_CYGWIN | 57 | #ifdef HAVE_CYGWIN |