diff options
author | Tim Rice <tim@multitalents.net> | 2001-11-26 17:19:43 -0800 |
---|---|---|
committer | Tim Rice <tim@multitalents.net> | 2001-11-26 17:19:43 -0800 |
commit | fe1d100ffdf3595f3aaddc02efbf0b49a265d90c (patch) | |
tree | b2657508f6c2bec9b1912d6dc8d881895572db37 /openbsd-compat/bsd-cygwin_util.c | |
parent | f7c6f95682684856db063d104be88a6e3b22a828 (diff) |
[contrib/cygwin/README, openbsd-compat/bsd-cygwin_util.c,
openbsd-compat/bsd-cygwin_util.h, openbsd-compat/daemon.c]
Allow SSHD to install as service under WIndows 9x/Me
[configure.ac] Fix to allow linking against PCRE on Cygwin
Patches by Corinna Vinschen <vinschen@redhat.com>
Diffstat (limited to 'openbsd-compat/bsd-cygwin_util.c')
-rw-r--r-- | openbsd-compat/bsd-cygwin_util.c | 24 |
1 files changed, 23 insertions, 1 deletions
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 */ |