1926. [bug] The Windows installer did not check for empty

passwords. [RT #15483]
This commit is contained in:
Mark Andrews 2005-10-11 22:54:45 +00:00
parent 9de05727e3
commit 9547d3e03b
5 changed files with 44 additions and 11 deletions

View file

@ -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]

View 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

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: BINDInstallDlg.cpp,v 1.20 2005/09/12 02:16:30 marka Exp $ */
/* $Id: BINDInstallDlg.cpp,v 1.21 2005/10/11 22:54:45 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);

View 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

View file

@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: thread.h,v 1.19 2005/09/18 07:16:24 marka Exp $ */
/* $Id: thread.h,v 1.20 2005/10/11 22:54:45 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);