]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
1926. [bug] The Windows installer did not check for empty
authorMark Andrews <marka@isc.org>
Tue, 11 Oct 2005 22:56:47 +0000 (22:56 +0000)
committerMark Andrews <marka@isc.org>
Tue, 11 Oct 2005 22:56:47 +0000 (22:56 +0000)
                        passwords. [RT #15483]

CHANGES
bin/win32/BINDInstall/BINDInstall.rc
bin/win32/BINDInstall/BINDInstallDlg.cpp
bin/win32/BINDInstall/resource.h
lib/isc/win32/include/isc/thread.h

diff --git a/CHANGES b/CHANGES
index 789782d28dc19967a0d4bc82d0b52ab572d70b92..2f47feae432f5fed1e6d4e5488b908638a402177 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+1926.  [bug]           The Windows installer did not check for empty
+                       passwords. [RT #15483]
+
 1925.  [port]          All outer level AC_TRY_RUNs need cross compiling
                        defaults. [RT #15469]
 
index 733591d38a835d11cba7311b4324afeb43570206..8bcb636b2e4eefb76f71f8d1625a350d50d80f6c 100644 (file)
@@ -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
index fb687c328ccae473d627cdaa71875a941063f090..a645b1ebea3251449be47da651cabbebb4ec9fd1 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: BINDInstallDlg.cpp,v 1.15.18.5 2005/09/07 14:25:16 marka Exp $ */
+/* $Id: BINDInstallDlg.cpp,v 1.15.18.6 2005/10/11 22:56:46 marka Exp $ */
 
 /*
  * Copyright (c) 1999-2000 by Nortel Networks Corporation
@@ -386,6 +386,7 @@ void CBINDInstallDlg::OnUninstall() {
  */
 void CBINDInstallDlg::OnInstall() {
        BOOL success = FALSE;
+       int oldlen;
 
        if (CheckBINDService())
                StopBINDService();
@@ -394,18 +395,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;
 
@@ -463,15 +491,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);
index fd142d32d151a40145fcc724b64591ee66dc1388..14b50846aa20e75b072a4235e77b3e3c28d14855 100644 (file)
@@ -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
index e993caf27ca7532d624cd38ca596703185c6aa73..d8577689d564964f8eccecd72a92af7d70387c42 100644 (file)
@@ -15,7 +15,7 @@
  * PERFORMANCE OF THIS SOFTWARE.
  */
 
-/* $Id: thread.h,v 1.16.18.3 2005/09/18 07:58:09 marka Exp $ */
+/* $Id: thread.h,v 1.16.18.4 2005/10/11 22:56:47 marka Exp $ */
 
 #ifndef ISC_THREAD_H
 #define ISC_THREAD_H 1
@@ -87,7 +87,7 @@ int
 isc_thread_key_create(isc_thread_key_t *key, void (*func)(void *));
 
 int
-isc_thread_key_destroy(isc_thread_key_t key);
+isc_thread_key_delete(isc_thread_key_t key);
 
 void *
 isc_thread_key_getspecific(isc_thread_key);