Browse Source

fix Windows build - use local functions instead of NSPR - fix compiler warnings

Rich Megginson 21 years ago
parent
commit
454c5dcf11

+ 4 - 0
ldap/admin/lib/dsalib_util.c

@@ -279,6 +279,10 @@ ds_cp_file(char *sfile, char *dfile, int mode)
 DS_EXPORT_SYMBOL char * 
 DS_EXPORT_SYMBOL char * 
 ds_get_tmp_dir()
 ds_get_tmp_dir()
 {
 {
+#if defined( XP_WIN32 )
+	size_t ilen;
+	char pch;
+#endif
 	static char tmpdir[] = "/tmp";
 	static char tmpdir[] = "/tmp";
 	static char tmp[256] = {0};
 	static char tmp[256] = {0};
  	char* instanceDir = ds_get_install_root();
  	char* instanceDir = ds_get_install_root();

+ 2 - 0
ldap/admin/src/Makefile

@@ -121,8 +121,10 @@ endif # SOLARIS
 endif # IRIX
 endif # IRIX
 endif # WINNT
 endif # WINNT
 
 
+ifneq ($(ARCH), WINNT)
 TEMP_EXTRALDFLAGS:=$(EXTRALDFLAGS)
 TEMP_EXTRALDFLAGS:=$(EXTRALDFLAGS)
 EXTRALDFLAGS = -lpthread $(TEMP_EXTRALDFLAGS)
 EXTRALDFLAGS = -lpthread $(TEMP_EXTRALDFLAGS)
+endif
 
 
 ifeq ($(SECURITY),domestic)
 ifeq ($(SECURITY),domestic)
 SECUS_BINS=
 SECUS_BINS=

+ 3 - 0
ldap/admin/src/ds_ldif2db.c

@@ -19,6 +19,9 @@
 #ifdef XP_UNIX
 #ifdef XP_UNIX
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
+#ifdef XP_WIN32
+#include <io.h>
+#endif
 
 
 int main(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
 {

+ 3 - 0
ldap/admin/src/ds_rmdb.c

@@ -20,6 +20,9 @@
 #ifdef XP_UNIX
 #ifdef XP_UNIX
 #include <unistd.h>
 #include <unistd.h>
 #endif
 #endif
+#ifdef XP_WIN32
+#include <direct.h>
+#endif
 #include "nspr.h"
 #include "nspr.h"
 
 
 #ifndef MAXPATHLEN
 #ifndef MAXPATHLEN

+ 1 - 5
ldap/admin/src/instindex.cpp

@@ -22,10 +22,6 @@
 #include <stdlib.h>
 #include <stdlib.h>
 #include <string.h>
 #include <string.h>
 
 
-#ifdef XP_WIN32
-#include "regparms.h"
-#endif
-
 char *ds_salted_sha1_pw_enc(char* pwd);
 char *ds_salted_sha1_pw_enc(char* pwd);
 
 
 
 
@@ -313,7 +309,7 @@ printInfo(int argc, char *argv[], char *envp[], FILE* fp)
 	fprintf(fp, "#####################################\n");
 	fprintf(fp, "#####################################\n");
 }
 }
 
 
-int main(int argc, char *argv[], char */*envp*/[])
+int main(int argc, char *argv[], char * /*envp*/ [])
 {
 {
     char *rm = getenv("REQUEST_METHOD");
     char *rm = getenv("REQUEST_METHOD");
     int status = 0;
     int status = 0;

+ 4 - 2
ldap/admin/src/latest_file.c

@@ -69,12 +69,14 @@ int main (int argc, char **argv)
 		return -1;
 		return -1;
 	}
 	}
 
 
-	PR_snprintf( latest, sizeof(latest), "%s\\%s", dir, fileinfo.name );
+	_snprintf( latest, sizeof(latest), "%s\\%s", dir, fileinfo.name );
+	latest[sizeof(latest)-1] = (char)0;
 	latest_time = fileinfo.time_create;
 	latest_time = fileinfo.time_create;
 
 
 	while( _findnext( hFile, &fileinfo ) == 0 ) {
 	while( _findnext( hFile, &fileinfo ) == 0 ) {
 		if ( fileinfo.time_create > latest_time ) {
 		if ( fileinfo.time_create > latest_time ) {
-			PR_snprintf( latest, sizeof(latest)-1, "%s\\%s", dir, fileinfo.name );
+			_snprintf( latest, sizeof(latest), "%s\\%s", dir, fileinfo.name );
+			latest[sizeof(latest)-1] = (char)0;
 			latest_time = fileinfo.time_create;
 			latest_time = fileinfo.time_create;
 		}
 		}
 	}
 	}

+ 6 - 3
ldap/admin/src/namegen.c

@@ -46,7 +46,8 @@ int main (int argc, char **argv)
 	strftime(szDate, sizeof (szDateFile), "%Y_%m_%d_%H%M%S", 
 	strftime(szDate, sizeof (szDateFile), "%Y_%m_%d_%H%M%S", 
              sCurTime);
              sCurTime);
 
 
-    PR_snprintf (szDateFile, sizeof(szDateFile), "%s.bat", szDate);
+    _snprintf (szDateFile, sizeof(szDateFile), "%s.bat", szDate);
+	szDateFile[sizeof(szDateFile)-1] = (char)0;
 
 
     /* create date batch file */
     /* create date batch file */
     fBatch = fopen (szDateFile, "w");
     fBatch = fopen (szDateFile, "w");
@@ -73,7 +74,8 @@ int main (int argc, char **argv)
         exit (1);
         exit (1);
     }
     }
 
 
-    PR_snprintf (szCmd, sizeof(szCmd), "call %s", szDate);
+    _snprintf (szCmd, sizeof(szCmd), "call %s", szDate);
+	szCmd[sizeof(szCmd)-1] = (char)0;
 
 
     rt = fwrite (szCmd, strlen (szCmd), 1, fBatch);
     rt = fwrite (szCmd, strlen (szCmd), 1, fBatch);
     if (rt != 1)
     if (rt != 1)
@@ -92,7 +94,8 @@ int main (int argc, char **argv)
         exit (1);
         exit (1);
     }
     }
 
 
-    PR_snprintf (szCmd, sizeof(szCmd), "del %s\ndel bstart.bat\nset DATESTR=", szDateFile);
+    _snprintf (szCmd, sizeof(szCmd), "del %s\ndel bstart.bat\nset DATESTR=", szDateFile);
+	szCmd[sizeof(szCmd)-1] = (char)0;
 
 
     rt = fwrite (szCmd, strlen(szCmd), 1, fBatch);
     rt = fwrite (szCmd, strlen(szCmd), 1, fBatch);
     if (rt != 1)
     if (rt != 1)

+ 3 - 1
ldap/admin/src/script-gen.c

@@ -13,7 +13,9 @@
 #include <sys/types.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/stat.h>
 #include "portable.h"
 #include "portable.h"
-
+#if defined( XP_WIN32 )
+#include <io.h>
+#endif
 
 
 /* reads the file on inpath, and rewrites it on outpath.
 /* reads the file on inpath, and rewrites it on outpath.
  * 'table' is a list of string-pairs (terminated by a pair of NULLs) that
  * 'table' is a list of string-pairs (terminated by a pair of NULLs) that

+ 90 - 72
ldap/cm/newinstnt/dsinst.c

@@ -60,6 +60,20 @@ static char *dialogMessage; /* used by shutdownDialogProc */
 #define OLD_VERSION_SIZE 32
 #define OLD_VERSION_SIZE 32
 static char oldVersion[OLD_VERSION_SIZE]; /* used by reinstall */
 static char oldVersion[OLD_VERSION_SIZE]; /* used by reinstall */
 
 
+static int
+my_snprintf(char *s, size_t size, const char *fmt, ...)
+{
+	int rc;
+	va_list ap;
+
+	va_start(ap, s);
+	rc = _vsnprintf(s, size, fmt, ap);
+	va_end(ap);
+	s[size-1] = (char)0;
+
+	return rc;
+}
+
 static void
 static void
 storeUserDirectoryInfo()
 storeUserDirectoryInfo()
 {
 {
@@ -86,7 +100,7 @@ storeUserDirectoryInfo()
 			lstrcpy(mi.m_szUserGroupAdminPW, mi.m_szInstancePassword);
 			lstrcpy(mi.m_szUserGroupAdminPW, mi.m_szInstancePassword);
 
 
 		}
 		}
-		PR_snprintf(mi.m_szUserGroupURL, sizeof(mi.m_szUserGroupURL), "ldap://%s:%d/%s", mi.m_szInstanceHostName,
+		my_snprintf(mi.m_szUserGroupURL, sizeof(mi.m_szUserGroupURL), "ldap://%s:%d/%s", mi.m_szInstanceHostName,
 				mi.m_nInstanceServerPort, mi.m_szInstanceSuffix);	
 				mi.m_nInstanceServerPort, mi.m_szInstanceSuffix);	
 	}
 	}
 
 
@@ -232,7 +246,7 @@ IsValidAdminDomain(
 	int status = FALSE;
 	int status = FALSE;
 	Ldap *ldap = NULL;
 	Ldap *ldap = NULL;
 
 
-	PR_snprintf(ldapurl, sizeof(ldapurl), "ldap://%s:%d/%s", host, port, suffix);
+	my_snprintf(ldapurl, sizeof(ldapurl), "ldap://%s:%d/%s", host, port, suffix);
 	if (createLdap(&ldap, ldapurl, binddn, binddnpwd, 0, 0) == OKAY)
 	if (createLdap(&ldap, ldapurl, binddn, binddnpwd, 0, 0) == OKAY)
 	{
 	{
 		LdapEntry *le = createLdapEntry(ldap);
 		LdapEntry *le = createLdapEntry(ldap);
@@ -590,7 +604,7 @@ void getAdminServInfo()
 
 
   GetEnvironmentVariable("TEMP", szTempDir, sizeof(szTempDir));
   GetEnvironmentVariable("TEMP", szTempDir, sizeof(szTempDir));
 
 
-  PR_snprintf(szCacheFile, sizeof(szCacheFile), "%s\\install.inf", szTempDir);
+  my_snprintf(szCacheFile, sizeof(szCacheFile), "%s\\install.inf", szTempDir);
 
 
   mi.m_nAdminServerPort = GetPrivateProfileInt(pszAdminSection, SLAPD_KEY_ADMIN_SERVER_PORT, 
   mi.m_nAdminServerPort = GetPrivateProfileInt(pszAdminSection, SLAPD_KEY_ADMIN_SERVER_PORT, 
 					       -1, szCacheFile);
 					       -1, szCacheFile);
@@ -616,14 +630,14 @@ BOOL writeINFfile(const char *filename)
       szAdminDN = formAdminDomainDN(mi.m_szAdminDomain);
       szAdminDN = formAdminDomainDN(mi.m_szAdminDomain);
       if (szAdminDN)
       if (szAdminDN)
       {
       {
-        PR_snprintf(mi.m_szInstallDN, sizeof(mi.m_szInstallDN), szAdminDN);
+        my_snprintf(mi.m_szInstallDN, sizeof(mi.m_szInstallDN), szAdminDN);
         nsSetupFree(szAdminDN);
         nsSetupFree(szAdminDN);
       }
       }
       else
       else
       {
       {
         //note probably should fail. 
         //note probably should fail. 
         LogData(NULL, "Warning: Slapd unable to Form Admin Domain, guessing");
         LogData(NULL, "Warning: Slapd unable to Form Admin Domain, guessing");
-        PR_snprintf(mi.m_szInstallDN, sizeof(mi.m_szInstallDN), "ou=%s, o=NetscapeRoot", mi.m_szAdminDomain);
+        my_snprintf(mi.m_szInstallDN, sizeof(mi.m_szInstallDN), "ou=%s, o=NetscapeRoot", mi.m_szAdminDomain);
       }
       }
    }
    }
  
  
@@ -775,9 +789,11 @@ BOOL isValidServerID(char *pszServerIdentifier)
 		/* for now just check registry to see if this server ID exists,
 		/* for now just check registry to see if this server ID exists,
 			in future add might want to add more sanity checks */
 			in future add might want to add more sanity checks */
 
 
-		fullId = PR_smprintf("%s-%s", DS_ID_SERVICE, pszServerIdentifier);
+		size_t len = strlen(DS_ID_SERVICE) + strlen(pszServerIdentifier) + 2;
+		fullId = malloc(len);
+		sprintf(fullId, "%s-%s", DS_ID_SERVICE, pszServerIdentifier);
 
 
-		PR_snprintf(line, sizeof(line), "%s\\%s", KEY_SERVICES, fullId); 
+		my_snprintf(line, sizeof(line), "%s\\%s", KEY_SERVICES, fullId); 
    
    
 		Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
 		Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
 		                      line,
 		                      line,
@@ -796,7 +812,7 @@ BOOL isValidServerID(char *pszServerIdentifier)
 
 
 		}
 		}
 
 
-		PR_smprintf_free(fullId);
+		free(fullId);
 	}
 	}
 
 
 	return bRC;
 	return bRC;
@@ -840,21 +856,21 @@ int set_default_ldap_settings()
 
 
 	/* default admin domain is also derived from the FQDN */
 	/* default admin domain is also derived from the FQDN */
 	++i;
 	++i;
-	PR_snprintf(mi.m_szAdminDomain, sizeof(mi.m_szAdminDomain), "%s", mi.m_szInstanceHostName+i);
+	my_snprintf(mi.m_szAdminDomain, sizeof(mi.m_szAdminDomain), "%s", mi.m_szInstanceHostName+i);
 	
 	
     mi.m_nInstanceServerPort=DEFAULT_SERVER_PORT;
     mi.m_nInstanceServerPort=DEFAULT_SERVER_PORT;
                                     
                                     
-    PR_snprintf(mi.m_szInstanceUnrestrictedUser, sizeof(mi.m_szInstanceUnrestrictedUser), DEFAULT_UNRESTRICTED_USER);
+    my_snprintf(mi.m_szInstanceUnrestrictedUser, sizeof(mi.m_szInstanceUnrestrictedUser), DEFAULT_UNRESTRICTED_USER);
 
 
     mi.m_nCfgSspt = DEFAULT_CONFIG_SSPT;
     mi.m_nCfgSspt = DEFAULT_CONFIG_SSPT;
 
 
-	PR_snprintf(mi.m_szSsptUid, sizeof(mi.m_szSsptUid), DEFAULT_SSPT_USER);
+	my_snprintf(mi.m_szSsptUid, sizeof(mi.m_szSsptUid), DEFAULT_SSPT_USER);
 
 
     /* stevross: don't want default for these in silent mode, user must specify them */
     /* stevross: don't want default for these in silent mode, user must specify them */
     if( SILENTMODE != MODE)
     if( SILENTMODE != MODE)
     {
     {
-        PR_snprintf(mi.m_szSupplierDN, sizeof(mi.m_szSupplierDN), DEFAULT_SUPPLIER_DN);
-        PR_snprintf(mi.m_szChangeLogSuffix, sizeof(mi.m_szChangeLogSuffix), DEFAULT_CHANGELOGSUFFIX);
+        my_snprintf(mi.m_szSupplierDN, sizeof(mi.m_szSupplierDN), DEFAULT_SUPPLIER_DN);
+        my_snprintf(mi.m_szChangeLogSuffix, sizeof(mi.m_szChangeLogSuffix), DEFAULT_CHANGELOGSUFFIX);
 
 
     }
     }
 
 
@@ -885,7 +901,7 @@ int set_default_ldap_settings()
 	mi.m_nMCCPort=DEFAULT_SERVER_PORT;
 	mi.m_nMCCPort=DEFAULT_SERVER_PORT;
 
 
 	mi.m_szMCCBindAs = malloc(MAX_STR_SIZE);
 	mi.m_szMCCBindAs = malloc(MAX_STR_SIZE);
-	PR_snprintf(mi.m_szMCCBindAs, sizeof(mi.m_szMCCBindAs), "%s", DEFAULT_SSPT_USER);
+	my_snprintf(mi.m_szMCCBindAs, sizeof(mi.m_szMCCBindAs), "%s", DEFAULT_SSPT_USER);
 
 
 	lstrcpy(mi.m_szUGSuffix, mi.m_szInstanceSuffix);
 	lstrcpy(mi.m_szUGSuffix, mi.m_szInstanceSuffix);
 	mi.m_nUGPort=DEFAULT_SERVER_PORT;
 	mi.m_nUGPort=DEFAULT_SERVER_PORT;
@@ -948,7 +964,7 @@ void set_ldap_settings()
 		lstrcpy(mi.m_szMCCHost, mi.m_szInstanceHostName);
 		lstrcpy(mi.m_szMCCHost, mi.m_szInstanceHostName);
 		mi.m_nMCCPort = mi.m_nInstanceServerPort;
 		mi.m_nMCCPort = mi.m_nInstanceServerPort;
 		lstrcpy(mi.m_szMCCSuffix, NS_DOMAIN_ROOT);
 		lstrcpy(mi.m_szMCCSuffix, NS_DOMAIN_ROOT);
-		PR_snprintf(mi.m_szMCCBindAs, sizeof(mi.m_szMCCBindAs), "%s", mi.m_szSsptUid);
+		my_snprintf(mi.m_szMCCBindAs, sizeof(mi.m_szMCCBindAs), "%s", mi.m_szSsptUid);
 		lstrcpy(mi.m_szMCCPw, mi.m_szSsptUidPw);
 		lstrcpy(mi.m_szMCCPw, mi.m_szSsptUidPw);
 
 
 	}
 	}
@@ -2227,7 +2243,7 @@ BOOL Verify_UG_Settings()
 				{
 				{
 					/* all settings good */
 					/* all settings good */
 					/* set UG LDAP URL */
 					/* set UG LDAP URL */
-					PR_snprintf(mi.m_szUserGroupURL, sizeof(mi.m_szUserGroupURL), "ldap://%s:%d/%s",
+					my_snprintf(mi.m_szUserGroupURL, sizeof(mi.m_szUserGroupURL), "ldap://%s:%d/%s",
 							mi.m_szUGHost, mi.m_nUGPort, mi.m_szUGSuffix);
 							mi.m_szUGHost, mi.m_nUGPort, mi.m_szUGSuffix);
 				}
 				}
 			}
 			}
@@ -3958,7 +3974,7 @@ Supplier_Replication_DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
 		// and wm_init is called again
 		// and wm_init is called again
 		if( !nInitialized )
 		if( !nInitialized )
 		{
 		{
-			PR_snprintf(mi.m_szChangeLogDbDir, sizeof(mi.m_szChangeLogDbDir),"%s\\%s-%s\\%s", TARGETDIR,  
+			my_snprintf(mi.m_szChangeLogDbDir, sizeof(mi.m_szChangeLogDbDir),"%s\\%s-%s\\%s", TARGETDIR,  
 				      DS_ID_SERVICE, mi.m_szServerIdentifier, DEFAULT_CHANGELOGDIR);
 				      DS_ID_SERVICE, mi.m_szServerIdentifier, DEFAULT_CHANGELOGDIR);
 			nInitialized = 1;
 			nInitialized = 1;
 		}
 		}
@@ -4194,7 +4210,7 @@ Consumer_DN_DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
       // you can perform any one time initialization that you require. 
       // you can perform any one time initialization that you require. 
 	  Setup8bitInputDisplay(hwndDlg, h8bitControls);
 	  Setup8bitInputDisplay(hwndDlg, h8bitControls);
 
 
-	  PR_snprintf(mi.m_szConsumerDN, sizeof(mi.m_szConsumerDN), "%s,%s", DEFAULT_CONSUMER_DN, mi.m_szInstanceSuffix);
+	  my_snprintf(mi.m_szConsumerDN, sizeof(mi.m_szConsumerDN), "%s,%s", DEFAULT_CONSUMER_DN, mi.m_szInstanceSuffix);
 
 
       break;
       break;
 
 
@@ -5093,7 +5109,7 @@ Sample_Entries_Org_DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
 				
 				
 				/* assume by browsing user will want this file so check custom radio button for them
 				/* assume by browsing user will want this file so check custom radio button for them
 				   and set file to be displayed */
 				   and set file to be displayed */
-				PR_snprintf(mi.m_szPopLdifFile, sizeof(mi.m_szPopLdifFile), "%s", szCustomFileName);
+				my_snprintf(mi.m_szPopLdifFile, sizeof(mi.m_szPopLdifFile), "%s", szCustomFileName);
 				CheckRadioButton(hwndDlg, IDC_RADIO_DONT_POPULATE, IDC_RADIO_POPULATE_CUSTOM, IDC_RADIO_POPULATE_CUSTOM);
 				CheckRadioButton(hwndDlg, IDC_RADIO_DONT_POPULATE, IDC_RADIO_POPULATE_CUSTOM, IDC_RADIO_POPULATE_CUSTOM);
 
 
 			default:
 			default:
@@ -5103,14 +5119,14 @@ Sample_Entries_Org_DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
 			  if( BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_RADIO_POPULATE_SAMPLE ) )
 			  if( BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_RADIO_POPULATE_SAMPLE ) )
 			  {
 			  {
 					mi.m_nPopulateSampleEntries = 1;
 					mi.m_nPopulateSampleEntries = 1;
-					PR_snprintf(mi.m_szPopLdifFile, sizeof(mi.m_szPopLdifFile), "%s", szSampleFileName);
+					my_snprintf(mi.m_szPopLdifFile, sizeof(mi.m_szPopLdifFile), "%s", szSampleFileName);
 			  }else if( BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_RADIO_POPULATE_CUSTOM ) ){
 			  }else if( BST_CHECKED == IsDlgButtonChecked(hwndDlg, IDC_RADIO_POPULATE_CUSTOM ) ){
 					mi.m_nPopulateSampleEntries = 0;
 					mi.m_nPopulateSampleEntries = 0;
 					mi.m_nPopulateSampleOrg = 1;
 					mi.m_nPopulateSampleOrg = 1;
-//		     		PR_snprintf(mi.m_szPopLdifFile, sizeof(mi.m_szPopLdifFile), "%s", szCustomFileName);
+//		     		my_snprintf(mi.m_szPopLdifFile, sizeof(mi.m_szPopLdifFile), "%s", szCustomFileName);
 			  }else{
 			  }else{
 					mi.m_nPopulateSampleEntries = 0;
 					mi.m_nPopulateSampleEntries = 0;
-					PR_snprintf(mi.m_szPopLdifFile, sizeof(mi.m_szPopLdifFile), "\0");
+					my_snprintf(mi.m_szPopLdifFile, sizeof(mi.m_szPopLdifFile), "\0");
 			  }
 			  }
 
 
 			  
 			  
@@ -5155,9 +5171,9 @@ Sample_Entries_Org_DialogProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
           }
           }
 		  
 		  
 		  /* warn user about suffix and database import */
 		  /* warn user about suffix and database import */
-		  PR_snprintf(szMustHaveBase, sizeof(szMustHaveBase), "(note: must have base %s)", mi.m_szInstanceSuffix );
+		  my_snprintf(szMustHaveBase, sizeof(szMustHaveBase), "(note: must have base %s)", mi.m_szInstanceSuffix );
 		  SetDlgItemText(hwndDlg, IDC_STATIC_MUST_HAVE_BASE, szMustHaveBase);
 		  SetDlgItemText(hwndDlg, IDC_STATIC_MUST_HAVE_BASE, szMustHaveBase);
-    	  PR_snprintf(szSampleFileName, sizeof(szSampleFileName), "%s\\%s", TARGETDIR, SAMPLE_LDIF);	
+    	  my_snprintf(szSampleFileName, sizeof(szSampleFileName), "%s\\%s", TARGETDIR, SAMPLE_LDIF);	
  
  
 		  if(mi.m_nExistingUG == 0)
 		  if(mi.m_nExistingUG == 0)
 		  {
 		  {
@@ -5706,7 +5722,7 @@ DSINST_PreInstall(LPCSTR lpszInstallPath)
 
 
 	if (mi.m_nReInstall) {
 	if (mi.m_nReInstall) {
 		char infFile[MAX_PATH] = {0};
 		char infFile[MAX_PATH] = {0};
-		PR_snprintf(infFile, sizeof(infFile), "%s\\setup\\slapd\\slapd.inf", TARGETDIR);
+		my_snprintf(infFile, sizeof(infFile), "%s\\setup\\slapd\\slapd.inf", TARGETDIR);
 		GetProductInfoStringWithTok(SETUP_INF_VERSION, "=", oldVersion,
 		GetProductInfoStringWithTok(SETUP_INF_VERSION, "=", oldVersion,
 								OLD_VERSION_SIZE, infFile);
 								OLD_VERSION_SIZE, infFile);
 		myLogData("file %s old version is %s", infFile, oldVersion);
 		myLogData("file %s old version is %s", infFile, oldVersion);
@@ -6056,7 +6072,7 @@ DSINST_WriteGlobalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
 
 
 	/* construct the LDAPURL */
 	/* construct the LDAPURL */
     /* suffix must always be o=netscape root */
     /* suffix must always be o=netscape root */
-	PR_snprintf(mi.m_szLdapURL, sizeof(mi.m_szLdapURL), "ldap://%s:%d/%s", mi.m_szMCCHost, mi.m_nMCCPort, NS_DOMAIN_ROOT);
+	my_snprintf(mi.m_szLdapURL, sizeof(mi.m_szLdapURL), "ldap://%s:%d/%s", mi.m_szMCCHost, mi.m_nMCCPort, NS_DOMAIN_ROOT);
 
 
 	if(mi.m_nExistingUG == 0)
 	if(mi.m_nExistingUG == 0)
 	{
 	{
@@ -6079,7 +6095,7 @@ DSINST_WriteGlobalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
 			lstrcpy(mi.m_szUserGroupAdminPW, mi.m_szInstancePassword);
 			lstrcpy(mi.m_szUserGroupAdminPW, mi.m_szInstancePassword);
 
 
 		}
 		}
-		PR_snprintf(mi.m_szUserGroupURL, sizeof(mi.m_szUserGroupURL), "ldap://%s:%d/%s", mi.m_szInstanceHostName,
+		my_snprintf(mi.m_szUserGroupURL, sizeof(mi.m_szUserGroupURL), "ldap://%s:%d/%s", mi.m_szInstanceHostName,
 								 mi.m_nInstanceServerPort, mi.m_szInstanceSuffix);	
 								 mi.m_nInstanceServerPort, mi.m_szInstanceSuffix);	
 	}
 	}
  
  
@@ -6147,7 +6163,7 @@ DSINST_WriteLocalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_USE_EXISTING_UG, onezero2yesno(mi.m_nExistingUG), 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_USE_EXISTING_UG, onezero2yesno(mi.m_nExistingUG), 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
 
 
-   PR_snprintf(szInt, sizeof(szInt), "%d",  mi.m_nInstanceServerPort);
+   my_snprintf(szInt, sizeof(szInt), "%d",  mi.m_nInstanceServerPort);
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SERVER_PORT, szInt, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SERVER_PORT, szInt, 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
      
      
@@ -6178,7 +6194,7 @@ DSINST_WriteLocalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_ADD_ORG_ENTRIES, onezero2yesno(mi.m_nPopulateSampleOrg), 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_ADD_ORG_ENTRIES, onezero2yesno(mi.m_nPopulateSampleOrg), 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
 
 
-   PR_snprintf(szInt, sizeof(szInt), "%s",  onezero2yesno( ( (NO_REPLICATION != mi.m_nSetupConsumerReplication) || (NO_REPLICATION != mi.m_nSetupSupplierReplication) ) ) );
+   my_snprintf(szInt, sizeof(szInt), "%s",  onezero2yesno( ( (NO_REPLICATION != mi.m_nSetupConsumerReplication) || (NO_REPLICATION != mi.m_nSetupSupplierReplication) ) ) );
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_USE_REPLICATION, szInt, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_USE_REPLICATION, szInt, 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
    
    
@@ -6187,9 +6203,9 @@ DSINST_WriteLocalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
    /* write no instead of number for no replication to be like unix installer */
    /* write no instead of number for no replication to be like unix installer */
    if(NO_REPLICATION != mi.m_nSetupConsumerReplication)
    if(NO_REPLICATION != mi.m_nSetupConsumerReplication)
    {
    {
-		PR_snprintf(szInt, sizeof(szInt), "%d", mi.m_nSetupConsumerReplication);
+		my_snprintf(szInt, sizeof(szInt), "%d", mi.m_nSetupConsumerReplication);
    }else{
    }else{
-	    PR_snprintf(szInt, sizeof(szInt), "no");
+	    my_snprintf(szInt, sizeof(szInt), "no");
    }
    }
 
 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SETUP_CONSUMER, szInt, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SETUP_CONSUMER, szInt, 
@@ -6198,7 +6214,7 @@ DSINST_WriteLocalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_CIR_HOST, mi.m_szConsumerHost, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_CIR_HOST, mi.m_szConsumerHost, 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
 
 
-   PR_snprintf(szInt, sizeof(szInt), "%d", mi.m_nConsumerPort );
+   my_snprintf(szInt, sizeof(szInt), "%d", mi.m_nConsumerPort );
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_CIR_PORT, szInt, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_CIR_PORT, szInt, 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
 
 
@@ -6214,7 +6230,7 @@ DSINST_WriteLocalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_CIR_SECURITY_ON, onezero2yesno(mi.m_nConsumerSSL),
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_CIR_SECURITY_ON, onezero2yesno(mi.m_nConsumerSSL),
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
    
    
-   PR_snprintf(szInt, sizeof(szInt), "%d", mi.m_nCIRInterval );
+   my_snprintf(szInt, sizeof(szInt), "%d", mi.m_nCIRInterval );
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_CIR_INTERVAL, szInt, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_CIR_INTERVAL, szInt, 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
 
 
@@ -6249,9 +6265,9 @@ DSINST_WriteLocalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
    /* write no instead of number for no replication to be like unix installer */
    /* write no instead of number for no replication to be like unix installer */
    if(NO_REPLICATION != mi.m_nSetupSupplierReplication)
    if(NO_REPLICATION != mi.m_nSetupSupplierReplication)
    {
    {
-		PR_snprintf(szInt, sizeof(szInt), "%d", mi.m_nSetupSupplierReplication);
+		my_snprintf(szInt, sizeof(szInt), "%d", mi.m_nSetupSupplierReplication);
    }else{
    }else{
-	    PR_snprintf(szInt, sizeof(szInt), "no");
+	    my_snprintf(szInt, sizeof(szInt), "no");
    }
    }
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SETUP_SUPPLIER, szInt, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SETUP_SUPPLIER, szInt, 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
@@ -6265,7 +6281,7 @@ DSINST_WriteLocalCache(LPCSTR lpszCacheFileName, LPCSTR lpszSectionName)
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SIR_HOST, mi.m_szSupplierHost, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SIR_HOST, mi.m_szSupplierHost, 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
 
 
-   PR_snprintf(szInt, sizeof(szInt), "%d", mi.m_nSupplierPort );
+   my_snprintf(szInt, sizeof(szInt), "%d", mi.m_nSupplierPort );
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SIR_PORT, szInt, 
    WritePrivateProfileString(lpszSectionName, SLAPD_KEY_SIR_PORT, szInt, 
 	                        lpszCacheFileName);
 	                        lpszCacheFileName);
 
 
@@ -6893,12 +6909,12 @@ run_cgi(const char *serverroot, const char *cgipath, const char *args)
 	char netsiteRootEnvVar[MAX_STR_SIZE] = {0};
 	char netsiteRootEnvVar[MAX_STR_SIZE] = {0};
     LPVOID lpMsgBuf;
     LPVOID lpMsgBuf;
 
 
-    PR_snprintf(netsiteRootEnvVar, sizeof(netsiteRootEnvVar), "NETSITE_ROOT=%s", serverroot);
+    my_snprintf(netsiteRootEnvVar, sizeof(netsiteRootEnvVar), "NETSITE_ROOT=%s", serverroot);
     _putenv(netsiteRootEnvVar);
     _putenv(netsiteRootEnvVar);
     if ( getenv("DEBUG_DSINST") )
     if ( getenv("DEBUG_DSINST") )
 		DebugBreak();
 		DebugBreak();
     /* everything is set, start the program */
     /* everything is set, start the program */
-	PR_snprintf(prog, sizeof(prog), "%s\\%s", serverroot, cgipath);
+	my_snprintf(prog, sizeof(prog), "%s\\%s", serverroot, cgipath);
 	if (!FileExists(prog))
 	if (!FileExists(prog))
 	{
 	{
 		lpMsgBuf = getLastErrorMessage();
 		lpMsgBuf = getLastErrorMessage();
@@ -6913,7 +6929,7 @@ run_cgi(const char *serverroot, const char *cgipath, const char *args)
 	}
 	}
 	else
 	else
 	{
 	{
-		PR_snprintf(cmdLine, sizeof(cmdLine), "\"%s\" %s", prog, args);
+		my_snprintf(cmdLine, sizeof(cmdLine), "\"%s\" %s", prog, args);
         
         
 		myLogData("run_cgi: before execution of %s", cmdLine);
 		myLogData("run_cgi: before execution of %s", cmdLine);
 		if ( (procResult = _LaunchAndWait(cmdLine, INFINITE)) != 0)
 		if ( (procResult = _LaunchAndWait(cmdLine, INFINITE)) != 0)
@@ -6968,7 +6984,7 @@ create_slapd_instance(const char *hostname, const char *serverroot)
 
 
 	/* create an .inf file to pass to index */
 	/* create an .inf file to pass to index */
 	/* write the data to a temp file */
 	/* write the data to a temp file */
-	PR_snprintf(INFfile, sizeof(INFfile), "%s\\temp%d.inf", TEMPDIR, _getpid());
+	my_snprintf(INFfile, sizeof(INFfile), "%s\\temp%d.inf", TEMPDIR, _getpid());
 	myLogData("create_slapd_instance: inf file is %s", INFfile);
 	myLogData("create_slapd_instance: inf file is %s", INFfile);
 
 
 	if (TRUE == (status = writeINFfile(INFfile)) )
 	if (TRUE == (status = writeINFfile(INFfile)) )
@@ -6984,9 +7000,9 @@ create_slapd_instance(const char *hostname, const char *serverroot)
 		else
 		else
 		{
 		{
             /* set temp file for admin output */
             /* set temp file for admin output */
-            PR_snprintf(debugFile, sizeof(debugFile), "DEBUG_FILE=%s\\debug.%d", TEMPDIR, _getpid());
+            my_snprintf(debugFile, sizeof(debugFile), "DEBUG_FILE=%s\\debug.%d", TEMPDIR, _getpid());
             _putenv(debugFile);
             _putenv(debugFile);
-			PR_snprintf(szCGIArgs, sizeof(szCGIArgs), "\"%s\\bin\\slapd\\admin\\bin\\Install.pl\"",
+			my_snprintf(szCGIArgs, sizeof(szCGIArgs), "\"%s\\bin\\slapd\\admin\\bin\\Install.pl\"",
 					serverroot);
 					serverroot);
 		    if (mi.m_nReInstall) 
 		    if (mi.m_nReInstall) 
 			{ 
 			{ 
@@ -7033,7 +7049,7 @@ int generate_mcc_bat()
 	return rc;
 	return rc;
     }
     }
 
 
-    PR_snprintf(szFilename, sizeof(szFilename), "%s\\%s-%s\\mcc.bat", TARGETDIR, DS_ID_SERVICE,
+    my_snprintf(szFilename, sizeof(szFilename), "%s\\%s-%s\\mcc.bat", TARGETDIR, DS_ID_SERVICE,
 			mi.m_szServerIdentifier);
 			mi.m_szServerIdentifier);
     fp = fopen(szFilename, "wb");
     fp = fopen(szFilename, "wb");
     if (!fp)
     if (!fp)
@@ -7042,7 +7058,7 @@ int generate_mcc_bat()
 					   ERR_NO_CREATE_FILE, 0, szFilename);
 					   ERR_NO_CREATE_FILE, 0, szFilename);
     	rc = -1;
     	rc = -1;
     }else{
     }else{
-        PR_snprintf(szJavaDir, sizeof(szJavaDir), "%s\\java", TARGETDIR);
+        my_snprintf(szJavaDir, sizeof(szJavaDir), "%s\\java", TARGETDIR);
                               
                               
         fprintf(fp, "pushd \"%s\"\n", szJavaDir);
         fprintf(fp, "pushd \"%s\"\n", szJavaDir);
 
 
@@ -7090,7 +7106,7 @@ int generate_install_ldapctrs_bat()
     CHAR szFilename[MAX_STR_SIZE];
     CHAR szFilename[MAX_STR_SIZE];
     INT rc = 0;
     INT rc = 0;
 
 
-    PR_snprintf(szFilename, sizeof(szFilename), "%s\\%s", TARGETDIR, INSTALL_CTRS_BAT);
+    my_snprintf(szFilename, sizeof(szFilename), "%s\\%s", TARGETDIR, INSTALL_CTRS_BAT);
     fp = fopen(szFilename, "wb");
     fp = fopen(szFilename, "wb");
     if (!fp)
     if (!fp)
     {
     {
@@ -7286,7 +7302,7 @@ updateRegistryKeys(const char *oldVersion, const char *newVersion)
 	// the first place is under
 	// the first place is under
 	// HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Directory\oldVersion
 	// HKEY_LOCAL_MACHINE\SOFTWARE\Netscape\Directory\oldVersion
 	// we need to change oldVersion to newVersion
 	// we need to change oldVersion to newVersion
-	PR_snprintf(newKey, sizeof(newKey), "%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT);
+	my_snprintf(newKey, sizeof(newKey), "%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT);
 	strcpy(oldKey, newKey);
 	strcpy(oldKey, newKey);
 	if (ptr = strstr(oldKey, SVR_VERSION)) {
 	if (ptr = strstr(oldKey, SVR_VERSION)) {
 		strncpy(ptr, oldVersion, strlen(oldVersion));
 		strncpy(ptr, oldVersion, strlen(oldVersion));
@@ -7300,9 +7316,9 @@ updateRegistryKeys(const char *oldVersion, const char *newVersion)
 	// the second place is under
 	// the second place is under
 	// HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\slapdoldVersoin
 	// HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\slapdoldVersoin
 	// we need to change oldVersion to newVersion
 	// we need to change oldVersion to newVersion
-	PR_snprintf(oldKey, sizeof(oldKey), "%s\\%s%s", KEY_SERVICES, PRODUCT_NAME,
+	my_snprintf(oldKey, sizeof(oldKey), "%s\\%s%s", KEY_SERVICES, PRODUCT_NAME,
 			oldVersion);
 			oldVersion);
-	PR_snprintf(newKey, sizeof(newKey), "%s\\%s%s", KEY_SERVICES, PRODUCT_NAME,
+	my_snprintf(newKey, sizeof(newKey), "%s\\%s%s", KEY_SERVICES, PRODUCT_NAME,
 			SVR_VERSION);
 			SVR_VERSION);
 
 
 	CopyAndDeleteKey(HKEY_LOCAL_MACHINE, oldKey, HKEY_LOCAL_MACHINE,
 	CopyAndDeleteKey(HKEY_LOCAL_MACHINE, oldKey, HKEY_LOCAL_MACHINE,
@@ -7402,7 +7418,7 @@ NSPERLINST_PostInstall(VOID)
 
 
   // hack to work around potential bug in setupsdk . . .
   // hack to work around potential bug in setupsdk . . .
   SetCurrentDirectory("../slapd");
   SetCurrentDirectory("../slapd");
-  PR_snprintf(infFile, sizeof(infFile), "slapd.inf");
+  my_snprintf(infFile, sizeof(infFile), "slapd.inf");
   GetProductInfoStringWithTok(NSPERL_POST_INSTALL_PROG, "=", nsPerlPostInstall,
   GetProductInfoStringWithTok(NSPERL_POST_INSTALL_PROG, "=", nsPerlPostInstall,
 			      BUFSIZ, infFile);
 			      BUFSIZ, infFile);
 
 
@@ -7419,7 +7435,7 @@ NSPERLINST_PostInstall(VOID)
   // get the RunPostInstall attribute from the inf; this is the name
   // get the RunPostInstall attribute from the inf; this is the name
   // of the post install program
   // of the post install program
   *p = 0; // p points at last dir sep in the path, so null it
   *p = 0; // p points at last dir sep in the path, so null it
-  PR_snprintf(instDir, sizeof(instDir), "%s\\%s", TARGETDIR, nsPerlPostInstall);
+  my_snprintf(instDir, sizeof(instDir), "%s\\%s", TARGETDIR, nsPerlPostInstall);
   p++;
   p++;
 
 
   // change directory to the directory of the post install program and
   // change directory to the directory of the post install program and
@@ -7440,8 +7456,8 @@ NSPERLINST_PostInstall(VOID)
 
 
   SetCurrentDirectory(szCurrentDir);
   SetCurrentDirectory(szCurrentDir);
 
 
-  PR_snprintf(srcPath, sizeof(srcPath), "%s\\nsperl.exe", instDir);
-  PR_snprintf(destPath, sizeof(destPath), "%s\\%s", TARGETDIR, PERL_EXE);
+  my_snprintf(srcPath, sizeof(srcPath), "%s\\nsperl.exe", instDir);
+  my_snprintf(destPath, sizeof(destPath), "%s\\%s", TARGETDIR, PERL_EXE);
 
 
   if (FALSE == CopyFile(srcPath, destPath, FALSE)) { // FALSE to overwrite file if exists
   if (FALSE == CopyFile(srcPath, destPath, FALSE)) { // FALSE to overwrite file if exists
     myLogError("NSPERLINST_PostInstall: could not copy file %s to %s",
     myLogError("NSPERLINST_PostInstall: could not copy file %s to %s",
@@ -7543,7 +7559,7 @@ static BOOL RemoveSNMPValue(void)
     DWORD sizeof_value_data_buffer;
     DWORD sizeof_value_data_buffer;
 
 
     /* open registry key for Microsoft SNMP service  */
     /* open registry key for Microsoft SNMP service  */
-    PR_snprintf(line, sizeof(line), "%s\\%s", KEY_SERVICES, KEY_SNMP_SERVICE); 
+    my_snprintf(line, sizeof(line), "%s\\%s", KEY_SERVICES, KEY_SNMP_SERVICE); 
     Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
     Result = RegOpenKeyEx(HKEY_LOCAL_MACHINE, 
                           line,
                           line,
                           0,
                           0,
@@ -7554,7 +7570,7 @@ static BOOL RemoveSNMPValue(void)
        for slapd snmp value to remove  */
        for slapd snmp value to remove  */
     if (Result == ERROR_SUCCESS) 
     if (Result == ERROR_SUCCESS) 
     {
     {
-        PR_snprintf(line, sizeof(line),
+        my_snprintf(line, sizeof(line),
                 "%s\\%s\\%s",
                 "%s\\%s\\%s",
                 KEY_SOFTWARE_NETSCAPE, 
                 KEY_SOFTWARE_NETSCAPE, 
                 SVR_KEY_ROOT, 
                 SVR_KEY_ROOT, 
@@ -7573,7 +7589,7 @@ static BOOL RemoveSNMPValue(void)
             for(iterator = 0; iterator <= NumValues; iterator++)
             for(iterator = 0; iterator <= NumValues; iterator++)
             {
             {
                 sizeof_value_data_buffer=MAX_PATH;
                 sizeof_value_data_buffer=MAX_PATH;
-                PR_snprintf(NumValuesBuf, sizeof(NumValuesBuf), "%d", iterator);
+                my_snprintf(NumValuesBuf, sizeof(NumValuesBuf), "%d", iterator);
                 Result = RegQueryValueEx(hServerKey,
                 Result = RegQueryValueEx(hServerKey,
                                          NumValuesBuf,
                                          NumValuesBuf,
                                          NULL,
                                          NULL,
@@ -7603,13 +7619,13 @@ BOOL RemoveSNMPKeys(void)
 
 
     /* open registry key for Directory SNMP s */
     /* open registry key for Directory SNMP s */
      memset(line, '\0', MAX_PATH);
      memset(line, '\0', MAX_PATH);
-     PR_snprintf(line, sizeof(line), "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT, 
+     my_snprintf(line, sizeof(line), "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT, 
                              	 KEY_SNMP_CURRENTVERSION);
                              	 KEY_SNMP_CURRENTVERSION);
     
     
      RegDeleteKey(HKEY_LOCAL_MACHINE, line);
      RegDeleteKey(HKEY_LOCAL_MACHINE, line);
 
 
      memset(line, '\0', MAX_PATH);
      memset(line, '\0', MAX_PATH);
-     PR_snprintf(line, sizeof(line), "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT, 
+     my_snprintf(line, sizeof(line), "%s\\%s\\%s", KEY_SOFTWARE_NETSCAPE, SVR_KEY_ROOT, 
                              	 SNMP_SERVICE_NAME);
                              	 SNMP_SERVICE_NAME);
 
 
      RegDeleteKey(HKEY_LOCAL_MACHINE, line);
      RegDeleteKey(HKEY_LOCAL_MACHINE, line);
@@ -7645,7 +7661,7 @@ BOOL RemoveDirectoryRootKey()
     BOOL  bRC = TRUE;
     BOOL  bRC = TRUE;
 
 
     memset(line, '\0', MAX_PATH);
     memset(line, '\0', MAX_PATH);
-    PR_snprintf(line, sizeof(line), "%s\\%s", KEY_SOFTWARE_NETSCAPE, DS_NAME_SHORT);
+    my_snprintf(line, sizeof(line), "%s\\%s", KEY_SOFTWARE_NETSCAPE, DS_NAME_SHORT);
 
 
     RegDeleteKey(HKEY_LOCAL_MACHINE, line);
     RegDeleteKey(HKEY_LOCAL_MACHINE, line);
   
   
@@ -7806,7 +7822,7 @@ void ControlSlapdInstance(char *pszServiceName, BOOL bOn)
    		LoadString( mi.m_hModule, IDS_STOPPING_SERVICE, szFormat, MAX_STR_SIZE);
    		LoadString( mi.m_hModule, IDS_STOPPING_SERVICE, szFormat, MAX_STR_SIZE);
    }
    }
 
 
-   PR_snprintf(szMessage, sizeof(szMessage), szFormat, shortName);
+   my_snprintf(szMessage, sizeof(szMessage), szFormat, shortName);
 
 
    myLogData(szMessage);
    myLogData(szMessage);
 	ZeroMemory(&shutdownargs, sizeof(shutdownargs));
 	ZeroMemory(&shutdownargs, sizeof(shutdownargs));
@@ -7820,7 +7836,7 @@ void ControlSlapdInstance(char *pszServiceName, BOOL bOn)
 			&& (bOn != (bServerRunning = isServiceRunning( pszServiceName ) ) ) )
 			&& (bOn != (bServerRunning = isServiceRunning( pszServiceName ) ) ) )
 	{
 	{
 		/* try to turn of the server */
 		/* try to turn of the server */
-		PR_snprintf(szLog, sizeof(szLog), szMessage);
+		my_snprintf(szLog, sizeof(szLog), szMessage);
 		LogData(NULL, szLog);
 		LogData(NULL, szLog);
 		myLogData(szLog);
 		myLogData(szLog);
 
 
@@ -7841,7 +7857,7 @@ void ControlSlapdInstance(char *pszServiceName, BOOL bOn)
    				LoadString( mi.m_hModule, IDS_WAIT_SERVICE_STOP, szFormat, MAX_STR_SIZE);
    				LoadString( mi.m_hModule, IDS_WAIT_SERVICE_STOP, szFormat, MAX_STR_SIZE);
 		   }
 		   }
 
 
-	  	   PR_snprintf(szLog, sizeof(szLog), szFormat, shortName);
+	  	   my_snprintf(szLog, sizeof(szLog), szFormat, shortName);
 		   LogData(NULL, szLog);
 		   LogData(NULL, szLog);
 		   myLogData(szLog);
 		   myLogData(szLog);
 
 
@@ -7898,7 +7914,7 @@ static void ConvertPasswordToPin(char *pszServerRoot, char *pszServiceName)
 		return;
 		return;
 	}
 	}
 	/* have to be in the alias directory to run this */
 	/* have to be in the alias directory to run this */
-	PR_snprintf(szNewDir, sizeof(szNewDir), "%s\\alias", pszServerRoot);
+	my_snprintf(szNewDir, sizeof(szNewDir), "%s\\alias", pszServerRoot);
 	/* change current dir to the alias directory */
 	/* change current dir to the alias directory */
 	if (SetCurrentDirectory(szNewDir) == 0)
 	if (SetCurrentDirectory(szNewDir) == 0)
 	{
 	{
@@ -7908,7 +7924,7 @@ static void ConvertPasswordToPin(char *pszServerRoot, char *pszServiceName)
 	}
 	}
 
 
 	/* spawn the perl script which does the conversion */
 	/* spawn the perl script which does the conversion */
-	PR_snprintf(szFormat, sizeof(szFormat), "\"%s\\bin\\slapd\\admin\\bin\\migratePwdFile\" \"%s\" %s",
+	my_snprintf(szFormat, sizeof(szFormat), "\"%s\\bin\\slapd\\admin\\bin\\migratePwdFile\" \"%s\" %s",
 		pszServerRoot, pszServerRoot, pszServiceName);
 		pszServerRoot, pszServerRoot, pszServiceName);
 	run_cgi(pszServerRoot, PERL_EXE, szFormat);
 	run_cgi(pszServerRoot, PERL_EXE, szFormat);
 
 
@@ -7945,7 +7961,7 @@ static void ReinstallUpgradeServer(char *pszServerRoot, char *pszServiceName)
 	}
 	}
 
 
 	/* spawn the perl script which does the conversion */
 	/* spawn the perl script which does the conversion */
-	PR_snprintf(szFormat, sizeof(szFormat), "\"%s\\bin\\slapd\\admin\\bin\\upgradeServer\" \"%s\" %s",
+	my_snprintf(szFormat, sizeof(szFormat), "\"%s\\bin\\slapd\\admin\\bin\\upgradeServer\" \"%s\" %s",
 		pszServerRoot, pszServerRoot, pszServiceName);
 		pszServerRoot, pszServerRoot, pszServiceName);
 	run_cgi(pszServerRoot, PERL_EXE, szFormat);
 	run_cgi(pszServerRoot, PERL_EXE, szFormat);
 
 
@@ -7972,9 +7988,9 @@ BOOL RemoveSlapdInstance(LPCSTR pszServerRoot, char *pszServiceName)
     /* now try to remove the instance */
     /* now try to remove the instance */
 
 
 	/* call remove cgi with inf */
 	/* call remove cgi with inf */
-	PR_snprintf(szINFfile, sizeof(szINFfile), "%s/unin%d.inf", TEMPDIR, _getpid());	
+	my_snprintf(szINFfile, sizeof(szINFfile), "%s/unin%d.inf", TEMPDIR, _getpid());	
 	writeUninstINFfile(	szINFfile, pszServerRoot, pszServiceName);
 	writeUninstINFfile(	szINFfile, pszServerRoot, pszServiceName);
-	PR_snprintf(szCGIArgs, sizeof(szCGIArgs), " -f \"%s\"", szINFfile);
+	my_snprintf(szCGIArgs, sizeof(szCGIArgs), " -f \"%s\"", szINFfile);
 
 
 	/* remove this instance */
 	/* remove this instance */
 	status = run_cgi(pszServerRoot, "bin\\slapd\\admin\\bin\\ds_remove.exe", szCGIArgs);
 	status = run_cgi(pszServerRoot, "bin\\slapd\\admin\\bin\\ds_remove.exe", szCGIArgs);
@@ -8025,7 +8041,7 @@ BOOL RemoveMiscSlapdFiles(pszServerRoot)
     for(i=0; miscFilesList[i] != NULL; i++)
     for(i=0; miscFilesList[i] != NULL; i++)
     {
     {
         memset(szFileName, '\0', MAX_STR_SIZE);
         memset(szFileName, '\0', MAX_STR_SIZE);
-        PR_snprintf(szFileName, sizeof(szFileName), "%s\\%s", pszServerRoot, miscFilesList[i] );
+        my_snprintf(szFileName, sizeof(szFileName), "%s\\%s", pszServerRoot, miscFilesList[i] );
         DeleteRecursively(szFileName);
         DeleteRecursively(szFileName);
     }
     }
 
 
@@ -8200,7 +8216,7 @@ fixURL(char *url)
 		char base[MAX_STR_SIZE];
 		char base[MAX_STR_SIZE];
 		GetURLComponents(url, host, &port, base);
 		GetURLComponents(url, host, &port, base);
 		fixDN(base);
 		fixDN(base);
-		sprintf(url, "ldap://%s:%d/%s", host, port, base);
+		my_snprintf(url, MAX_STR_SIZE, "ldap://%s:%d/%s", host, port, base);
 	}
 	}
 }
 }
 		
 		
@@ -8246,8 +8262,9 @@ DSMessageBox(UINT type, UINT titleKey, UINT msgKey, const char *titlearg, ...)
 		LoadString(mi.m_hModule, titleKey, titleFormat, MAX_STR_SIZE);
 		LoadString(mi.m_hModule, titleKey, titleFormat, MAX_STR_SIZE);
 
 
 	va_start(ap, titlearg);
 	va_start(ap, titlearg);
-	PR_vsnprintf(msg, sizeof(msg), msgFormat, ap);
+	_vsnprintf(msg, sizeof(msg), msgFormat, ap);
 	va_end(ap);
 	va_end(ap);
+	msg[sizeof(msg)-1] = (char)0;
 
 
 	LogData(NULL, msg);
 	LogData(NULL, msg);
 	myLogData(msg);
 	myLogData(msg);
@@ -8255,7 +8272,7 @@ DSMessageBox(UINT type, UINT titleKey, UINT msgKey, const char *titlearg, ...)
 	{
 	{
 		if (titleFormat[0])
 		if (titleFormat[0])
 		{
 		{
-			PR_snprintf(title, sizeof(title), titleFormat, titlearg);
+			my_snprintf(title, sizeof(title), titleFormat, titlearg);
 			retval = NsSetupMessageBox(NULL, msg, title, type);
 			retval = NsSetupMessageBox(NULL, msg, title, type);
 		}
 		}
 		else
 		else
@@ -8291,15 +8308,16 @@ DSMessageBoxOK(UINT titleKey, UINT msgKey, const char *titlearg, ...)
 		LoadString(mi.m_hModule, titleKey, titleFormat, MAX_STR_SIZE);
 		LoadString(mi.m_hModule, titleKey, titleFormat, MAX_STR_SIZE);
 
 
 	va_start(ap, titlearg);
 	va_start(ap, titlearg);
-	PR_vsnprintf(msg, sizeof(msg), msgFormat, ap);
+	_vsnprintf(msg, sizeof(msg), msgFormat, ap);
 	va_end(ap);
 	va_end(ap);
+	msg[sizeof(msg)-1] = (char)0;
 
 
 	LogData(NULL, msg);
 	LogData(NULL, msg);
 	if (MODE != SILENTMODE)
 	if (MODE != SILENTMODE)
 	{
 	{
 		if (titleFormat[0])
 		if (titleFormat[0])
 		{
 		{
-			PR_snprintf(title, sizeof(title), titleFormat, titlearg);
+			my_snprintf(title, sizeof(title), titleFormat, titlearg);
 			retval = NsSetupMessageBox(NULL, msg, title, MB_OK);
 			retval = NsSetupMessageBox(NULL, msg, title, MB_OK);
 		}
 		}
 		else
 		else

+ 3 - 2
ldap/servers/snmp/ntagt/nsldapagt_nt.c

@@ -1004,8 +1004,9 @@ int MagtReadStats(MagtHdrInfo_t *hdrInfo,
    */
    */
   if (hdrInfo != NULL)
   if (hdrInfo != NULL)
   {
   {
-    hdrInfo->versMajor  = pfile_stats->hdr_stats.hdrVersionMjr;
-    hdrInfo->versMinor  = pfile_stats->hdr_stats.hdrVersionMnr;
+/* versMajor and versMinor are no longer used. <03/04/05> */ 
+//	hdrInfo->versMajor  = pfile_stats->hdr_stats.hdrVersionMjr;
+//  hdrInfo->versMinor  = pfile_stats->hdr_stats.hdrVersionMnr;
     hdrInfo->restarted  = pfile_stats->hdr_stats.restarted;
     hdrInfo->restarted  = pfile_stats->hdr_stats.restarted;
     hdrInfo->startTime  = pfile_stats->hdr_stats.startTime;
     hdrInfo->startTime  = pfile_stats->hdr_stats.startTime;
     hdrInfo->updateTime = pfile_stats->hdr_stats.updateTime;
     hdrInfo->updateTime = pfile_stats->hdr_stats.updateTime;

+ 3 - 2
ldap/servers/snmp/ntagt/nsldapagt_nt.h

@@ -94,8 +94,9 @@ typedef struct MagtLDAPInfo
 
 
 typedef struct MagtHdrInfo
 typedef struct MagtHdrInfo
 {
 {
-  int versMajor;
-  int versMinor;
+/* versMajor and versMinor are no longer used. <03/04/05> */
+//  int versMajor;
+//  int versMinor;
   int restarted;
   int restarted;
   time_t startTime;
   time_t startTime;
   time_t updateTime;
   time_t updateTime;