mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 05:28:00 +00:00
Add check and warning message for Windows 2000 systems not running Service Pack 2 or later
This commit is contained in:
parent
4eaf7590c8
commit
0956e3d607
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: ntservice.h,v 1.1 2001/07/18 03:43:18 mayer Exp $ */
|
/* $Id: ntservice.h,v 1.2 2002/08/03 01:31:48 mayer Exp $ */
|
||||||
|
|
||||||
#ifndef NTSERVICE_H
|
#ifndef NTSERVICE_H
|
||||||
#define NTSERVICE_H
|
#define NTSERVICE_H
|
||||||
@ -31,4 +31,5 @@ void UpdateSCM(DWORD);
|
|||||||
void ServiceControl(DWORD dwCtrlCode);
|
void ServiceControl(DWORD dwCtrlCode);
|
||||||
void
|
void
|
||||||
ntservice_shutdown();
|
ntservice_shutdown();
|
||||||
|
BOOL ntservice_isservice();
|
||||||
#endif
|
#endif
|
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: ntservice.c,v 1.6 2002/02/20 03:33:36 marka Exp $ */
|
/* $Id: ntservice.c,v 1.7 2002/08/03 01:31:48 mayer Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
/* Handle to SCM for updating service status */
|
/* Handle to SCM for updating service status */
|
||||||
static SERVICE_STATUS_HANDLE hServiceStatus = 0;
|
static SERVICE_STATUS_HANDLE hServiceStatus = 0;
|
||||||
static int foreground = FALSE;
|
static BOOL foreground = FALSE;
|
||||||
static char ConsoleTitle[128];
|
static char ConsoleTitle[128];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -122,7 +122,13 @@ void
|
|||||||
ntservice_shutdown() {
|
ntservice_shutdown() {
|
||||||
UpdateSCM(SERVICE_STOPPED);
|
UpdateSCM(SERVICE_STOPPED);
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* Routine to check if this is a service or a foreground program
|
||||||
|
*/
|
||||||
|
BOOL
|
||||||
|
ntservice_isservice() {
|
||||||
|
return(!foreground);
|
||||||
|
}
|
||||||
/*
|
/*
|
||||||
* ServiceControl(): Handles requests from the SCM and passes them on
|
* ServiceControl(): Handles requests from the SCM and passes them on
|
||||||
* to named.
|
* to named.
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* $Id: os.c,v 1.16 2002/08/01 03:25:34 mayer Exp $ */
|
/* $Id: os.c,v 1.17 2002/08/03 01:31:48 mayer Exp $ */
|
||||||
|
|
||||||
#include <config.h>
|
#include <config.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@ -37,8 +37,10 @@
|
|||||||
#include <isc/string.h>
|
#include <isc/string.h>
|
||||||
#include <isc/ntpaths.h>
|
#include <isc/ntpaths.h>
|
||||||
#include <isc/util.h>
|
#include <isc/util.h>
|
||||||
|
#include <isc/win32os.h>
|
||||||
|
|
||||||
#include <named/main.h>
|
#include <named/main.h>
|
||||||
|
#include <named/log.h>
|
||||||
#include <named/os.h>
|
#include <named/os.h>
|
||||||
#include <named/globals.h>
|
#include <named/globals.h>
|
||||||
#include <named/ntservice.h>
|
#include <named/ntservice.h>
|
||||||
@ -48,6 +50,9 @@ static char *pidfile = NULL;
|
|||||||
|
|
||||||
static BOOL Initialized = FALSE;
|
static BOOL Initialized = FALSE;
|
||||||
|
|
||||||
|
static char *version_error =
|
||||||
|
"named requires Windows 2000 Service Pack 2 or later to run correctly";
|
||||||
|
|
||||||
void
|
void
|
||||||
ns_paths_init() {
|
ns_paths_init() {
|
||||||
if (!Initialized)
|
if (!Initialized)
|
||||||
@ -64,6 +69,22 @@ ns_paths_init() {
|
|||||||
Initialized = TRUE;
|
Initialized = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Due to Knowledge base article Q263823 we need to make sure that
|
||||||
|
* Windows 2000 systems have Service Pack 2 or later installed and
|
||||||
|
* warn when it isn't.
|
||||||
|
*/
|
||||||
|
static void
|
||||||
|
version_check(const char *progname) {
|
||||||
|
|
||||||
|
if(isc_win32os_majorversion() < 5)
|
||||||
|
return; /* No problem with Version 4.0 */
|
||||||
|
if(isc_win32os_versioncheck(5, 0, 2, 0) < 0)
|
||||||
|
if (ntservice_isservice())
|
||||||
|
NTReportError(progname, version_error);
|
||||||
|
else
|
||||||
|
fprintf(stderr, "%s\n", version_error);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
setup_syslog(const char *progname) {
|
setup_syslog(const char *progname) {
|
||||||
@ -82,6 +103,7 @@ ns_os_init(const char *progname) {
|
|||||||
ns_paths_init();
|
ns_paths_init();
|
||||||
setup_syslog(progname);
|
setup_syslog(progname);
|
||||||
ntservice_init();
|
ntservice_init();
|
||||||
|
version_check(progname);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user