summaryrefslogtreecommitdiff
path: root/bin/win32/BINDInstall
diff options
context:
space:
mode:
authorInternet Software Consortium, Inc <@isc.org>2007-09-07 14:15:45 -0600
committerLaMont Jones <lamont@debian.org>2007-09-07 14:15:45 -0600
commit4e926eed7fa226680baa6df59f0979a4ec61dc37 (patch)
treed3fde8af0fd8d0eab9474b78f9e97f93602dc9c3 /bin/win32/BINDInstall
parentb839699f526d760de08fdb2c47b37987b3e90e3c (diff)
downloadbind9-4e926eed7fa226680baa6df59f0979a4ec61dc37.tar.gz
9.3.2b2
Diffstat (limited to 'bin/win32/BINDInstall')
-rw-r--r--bin/win32/BINDInstall/BINDInstall.rc4
-rw-r--r--bin/win32/BINDInstall/BINDInstallDlg.cpp44
-rw-r--r--bin/win32/BINDInstall/resource.h2
3 files changed, 40 insertions, 10 deletions
diff --git a/bin/win32/BINDInstall/BINDInstall.rc b/bin/win32/BINDInstall/BINDInstall.rc
index 733591d3..8bcb636b 100644
--- a/bin/win32/BINDInstall/BINDInstall.rc
+++ b/bin/win32/BINDInstall/BINDInstall.rc
@@ -78,7 +78,7 @@ STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION |
WS_SYSMENU
EXSTYLE WS_EX_APPWINDOW
CAPTION "BIND 9 Installer"
-FONT 8, "MS Sans Serif"
+FONT 8, "MS Sans Serif",0,0,0x1
BEGIN
EDITTEXT IDC_TARGETDIR,7,62,196,14,ES_AUTOHSCROLL
EDITTEXT IDC_ACCOUNT_NAME,7,94,196,14,ES_AUTOHSCROLL
@@ -305,6 +305,8 @@ BEGIN
IDS_CREATEACCOUNT_FAILED "Unable to Create Account for the Service."
IDS_ERR_PASSWORD "Passwords entered did not match. Please reenter password."
IDS_ERR_UPDATE_SERVICE "Error updating service\n(%s)"
+ IDS_ERR_NULLPASSWORD "Service account password cannot be null"
+ IDS_ERR_WHITESPACE "Service account password has leading/trailing whitespace"
END
#endif // English (U.S.) resources
diff --git a/bin/win32/BINDInstall/BINDInstallDlg.cpp b/bin/win32/BINDInstall/BINDInstallDlg.cpp
index a9c7e68f..511ab6e8 100644
--- a/bin/win32/BINDInstall/BINDInstallDlg.cpp
+++ b/bin/win32/BINDInstall/BINDInstallDlg.cpp
@@ -1,5 +1,5 @@
/*
- * Portions Copyright (C) 2004 Internet Systems Consortium, Inc. ("ISC")
+ * Portions Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 2001, 2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
-/* $Id: BINDInstallDlg.cpp,v 1.6.2.6.2.10 2004/05/18 01:20:04 marka Exp $ */
+/* $Id: BINDInstallDlg.cpp,v 1.6.2.6.2.12 2005/10/11 23:54:48 marka Exp $ */
/*
* Copyright (c) 1999-2000 by Nortel Networks Corporation
@@ -385,6 +385,7 @@ void CBINDInstallDlg::OnUninstall() {
*/
void CBINDInstallDlg::OnInstall() {
BOOL success = FALSE;
+ int oldlen;
if (CheckBINDService())
StopBINDService();
@@ -393,18 +394,45 @@ void CBINDInstallDlg::OnInstall() {
UpdateData();
- /* Check that the Passwords entered match */
+ /*
+ * Check that the Passwords entered match.
+ */
if (m_accountPassword != m_accountPasswordConfirm) {
MsgBox(IDS_ERR_PASSWORD);
return;
}
- /* Check the entered account name */
+ /*
+ * Check that there is not leading / trailing whitespace.
+ * This is for compatability with the standard password dialog.
+ * Passwords really should be treated as opaque blobs.
+ */
+ oldlen = m_accountPassword.GetLength();
+ m_accountPassword.TrimLeft();
+ m_accountPassword.TrimRight();
+ if (m_accountPassword.GetLength() != oldlen) {
+ MsgBox(IDS_ERR_WHITESPACE);
+ return;
+ }
+
+ /*
+ * Check that the Password is not null.
+ */
+ if (m_accountPassword.GetLength() == 0) {
+ MsgBox(IDS_ERR_NULLPASSWORD);
+ return;
+ }
+
+ /*
+ * Check the entered account name.
+ */
if (ValidateServiceAccount() == FALSE)
return;
- /* For Registration we need to know if account was changed */
+ /*
+ * For Registration we need to know if account was changed.
+ */
if(m_accountName != m_currentAccount)
m_accountUsed = FALSE;
@@ -462,15 +490,13 @@ void CBINDInstallDlg::OnInstall() {
SetCurrent(IDS_ADD_REMOVE);
if (RegCreateKey(HKEY_LOCAL_MACHINE, BIND_UNINSTALL_SUBKEY,
- &hKey) == ERROR_SUCCESS) {
- char winDir[MAX_PATH];
+ &hKey) == ERROR_SUCCESS) {
CString buf(BIND_DISPLAY_NAME);
- GetWindowsDirectory(winDir, MAX_PATH);
RegSetValueEx(hKey, "DisplayName", 0, REG_SZ,
(LPBYTE)(LPCTSTR)buf, buf.GetLength());
- buf.Format("%s\\BINDInstall.exe", winDir);
+ buf.Format("%s\\BINDInstall.exe", m_binDir);
RegSetValueEx(hKey, "UninstallString", 0, REG_SZ,
(LPBYTE)(LPCTSTR)buf, buf.GetLength());
RegCloseKey(hKey);
diff --git a/bin/win32/BINDInstall/resource.h b/bin/win32/BINDInstall/resource.h
index fd142d32..14b50846 100644
--- a/bin/win32/BINDInstall/resource.h
+++ b/bin/win32/BINDInstall/resource.h
@@ -56,6 +56,8 @@
#define IDS_CREATEACCOUNT_FAILED 55
#define IDS_ERR_PASSWORD 56
#define IDS_ERR_UPDATE_SERVICE 57
+#define IDS_ERR_NULLPASSWORD 58
+#define IDS_ERR_WHITESPACE 59
#define IDD_BINDINSTALL_DIALOG 102
#define IDR_MAINFRAME 128
#define IDD_BROWSE 129