krb5 commit: Remove copyright/version from Get Tickets dialog

Benjamin Kaduk kaduk at MIT.EDU
Mon Aug 27 11:52:22 EDT 2012


https://github.com/krb5/krb5/commit/5a00a830a01f1d0699bd316122a1475a4f92e9fb
commit 5a00a830a01f1d0699bd316122a1475a4f92e9fb
Author: Kevin Wasserman <kevin.wasserman at painless-security.com>
Date:   Thu Jun 28 12:30:40 2012 -0400

    Remove copyright/version from Get Tickets dialog
    
    Signed-off-by: Kevin Wasserman <kevin.wasserman at painless-security.com>
    
    ticket: 7288 (new)
    queue: kfw
    target_version: 1.10.4
    tags: pullup

 src/windows/leashdll/lsh_pwd.c  |  154 ---------------------------------------
 src/windows/leashdll/lsh_pwd.rc |    4 -
 2 files changed, 0 insertions(+), 158 deletions(-)

diff --git a/src/windows/leashdll/lsh_pwd.c b/src/windows/leashdll/lsh_pwd.c
index 369c693..f023cf9 100644
--- a/src/windows/leashdll/lsh_pwd.c
+++ b/src/windows/leashdll/lsh_pwd.c
@@ -1062,157 +1062,6 @@ GetKrb4RealmFile(
     return FALSE;
 }
 
-static BOOL
-FindDLLName(CHAR * filename, UINT len)
-{
-    if ( !filename || len == 0 )
-        return 0;
-
-    filename[0] = 0;
-
-    if ( pEnumProcessModules ) {
-        char checkName[1024];
-        HMODULE hMods[1024];
-        HANDLE hProcess;
-        DWORD cbNeeded;
-        unsigned int i;
-
-        /* Get a list of all the modules in this process. */
-        hProcess = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, GetCurrentProcessId());
-
-        if (pEnumProcessModules(hProcess, hMods, sizeof(hMods), &cbNeeded))
-        {
-            for (i = 0; i < (cbNeeded / sizeof(HMODULE)); i++)
-            {
-                char szModName[2048];
-
-                /* Get the full path to the module's file. */
-                if (pGetModuleFileNameEx(hProcess, hMods[i], szModName, sizeof(szModName)))
-                {
-                    lstrcpyn(checkName, szModName, sizeof(checkName));
-                    strupr(checkName);
-
-                    if (strstr(checkName, "LEASHW32")) {
-                        lstrcpyn(filename, checkName, len);
-                        break;
-                    }
-                }
-            }
-        }
-
-        CloseHandle(hProcess);
-    } else if (pCreateToolhelp32Snapshot && pModule32First && pModule32Next ) {
-        char checkName[1024];
-        MODULEENTRY32 me32 = {0};
-        HANDLE hProcessSnap = NULL;
-
-        hProcessSnap = pCreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
-        if (hProcessSnap == (HANDLE)-1)
-            return FALSE;
-
-        me32.dwSize = sizeof(MODULEENTRY32);
-        if (pModule32First(hProcessSnap, &me32))
-        {
-            do
-            {
-                lstrcpyn(checkName, me32.szExePath, sizeof(checkName));
-                strupr(checkName);
-
-                if (strstr(checkName, "LEASHW32")) {
-                    lstrcpyn(filename, checkName, len);
-                    break;
-                }
-            }
-            while (pModule32Next(hProcessSnap, &me32));
-        }
-    }
-
-    return filename[0] ? 1 : 0;
-}
-
-static DWORD
-SetVersionInfo(
-    HWND hDialog,
-    UINT id_version,
-    UINT id_copyright
-    )
-{
-    CHAR filename[1024];
-    DWORD dwVersionHandle;
-    LPVOID pVersionInfo = 0;
-    DWORD retval = 0;
-    LPDWORD pLangInfo = 0;
-    LPTSTR szVersion = 0;
-    LPTSTR szCopyright = 0;
-    UINT len = 0;
-    CHAR sname_version[] = "FileVersion";
-    CHAR sname_copyright[] = "LegalCopyright";
-    CHAR szVerQ[(sizeof("\\StringFileInfo\\12345678\\") +
-                  max(sizeof(sname_version) / sizeof(CHAR),
-                      sizeof(sname_copyright) / sizeof(CHAR)))];
-    CHAR szVerCopy[128] = "";
-    CHAR * cp = szVerQ;
-    DWORD size;
-
-    if (!FindDLLName(filename, sizeof(filename)))
-        return GetLastError();
-
-    size = GetFileVersionInfoSize(filename, &dwVersionHandle);
-
-    if (!size)
-        return GetLastError();
-
-    pVersionInfo = malloc(size);
-    if (!pVersionInfo)
-        return ERROR_NOT_ENOUGH_MEMORY;
-
-    if (!GetFileVersionInfo(filename, dwVersionHandle, size, pVersionInfo))
-    {
-        retval = GetLastError();
-        goto cleanup;
-    }
-
-    if (!VerQueryValue(pVersionInfo, "\\VarFileInfo\\Translation",
-                       (LPVOID*)&pLangInfo, &len))
-    {
-        retval = GetLastError();
-        goto cleanup;
-    }
-
-
-    cp += wsprintf(szVerQ,
-                   "\\StringFileInfo\\%04x%04x\\",
-                   LOWORD(*pLangInfo), HIWORD(*pLangInfo));
-
-    lstrcpy(cp, sname_version);
-    if (!VerQueryValue(pVersionInfo, szVerQ, (LPVOID*)&szVersion, &len))
-    {
-        retval = GetLastError() || ERROR_NOT_ENOUGH_MEMORY;
-        goto cleanup;
-    }
-
-    lstrcpy(cp, sname_copyright);
-    if (!VerQueryValue(pVersionInfo, szVerQ, (LPVOID*)&szCopyright, &len))
-    {
-        retval = GetLastError() || ERROR_NOT_ENOUGH_MEMORY;
-        goto cleanup;
-    }
-
-    if ( strlen(szVersion) < sizeof(szVerCopy) - 8 ) {
-        wsprintf(szVerCopy, "Version %s", szVersion);
-        szVerCopy[sizeof(szVerCopy) - 1] = 0;
-
-        SetWindowText(GetDlgItem(hDialog,id_version),szVerCopy);
-    }
-    SetWindowText(GetDlgItem(hDialog,id_copyright),szCopyright);
-
- cleanup:
-    if (pVersionInfo)
-        free(pVersionInfo);
-    return retval;
-}
-
-
 int
 readstring(FILE * file, char * buf, int len)
 {
@@ -1504,7 +1353,6 @@ AuthenticateProc(
         hEditCtrl = GetDlgItem(hDialog, IDC_EDIT_PRINCIPAL);
         if (hEditCtrl)
             pAutoComplete = lacInit(hEditCtrl);
-        SetVersionInfo(hDialog,IDC_STATIC_VERSION,IDC_STATIC_COPYRIGHT);
 	hSliderLifetime = GetDlgItem(hDialog, IDC_STATIC_LIFETIME_VALUE);
 	hSliderRenew = GetDlgItem(hDialog, IDC_STATIC_RENEW_TILL_VALUE);
 
@@ -1922,8 +1770,6 @@ NewPasswordProc(
     case WM_INITDIALOG:
 	hDlg = hDialog;
 
-        SetVersionInfo(hDialog,IDC_STATIC_VERSION,IDC_STATIC_COPYRIGHT);
-
         *( (LPLSH_DLGINFO_EX far *)(&lpdi) ) = (LPLSH_DLGINFO_EX)(LPSTR)lParam;
 
 	if ((lpdi->size < LSH_DLGINFO_EX_V3_SZ &&
diff --git a/src/windows/leashdll/lsh_pwd.rc b/src/windows/leashdll/lsh_pwd.rc
index ef37c9b..325cdb4 100644
--- a/src/windows/leashdll/lsh_pwd.rc
+++ b/src/windows/leashdll/lsh_pwd.rc
@@ -121,12 +121,10 @@ BEGIN
     LTEXT           "Flag this ticket as:",IDC_STATIC_KRB5,32,123,56,8
     LTEXT           "HMS",IDC_STATIC_LIFETIME_VALUE,90,87,131,8
     LTEXT           "HMS",IDC_STATIC_RENEW_TILL_VALUE,90,164,141,8
-    LTEXT           "",IDC_STATIC_VERSION,7,228,130,8
     ICON            LEASHICON,IDC_PICTURE_LEASH,21,15,20,20
     LTEXT           "Please Authenticate",
                     IDC_STATIC_NOTICE,51,23,276,8
     RTEXT           "Renewable Lifetime:",IDC_STATIC_RENEW,10,164,79,8
-    LTEXT           "",IDC_STATIC_COPYRIGHT,7,240,323,8
 END
 
 IDD_PASSWORD DIALOG DISCARDABLE  0, 0, 382, 198
@@ -148,13 +146,11 @@ BEGIN
     RTEXT           "Name:",IDC_STATIC_NAME,73,55,21,8
     RTEXT           "Realm:",IDC_STATIC_REALM,72,71,23,8
     RTEXT           "Old Password:",IDC_STATIC_PWD,19,85,74,21
-    LTEXT           "Copyright 2003 MIT",IDC_STATIC_COPYRIGHT,7,183,329,8
     ICON            LEASHICON,IDC_PICTURE_LEASH,15,15,20,20
     LTEXT           "Change your Kerberos password or phrase",
                     IDC_STATIC_NOTICE,48,20,276,8
     RTEXT           "New Password:",IDC_STATIC_PWD2,23,112,74,16
     RTEXT           "New Password (again):",IDC_STATIC_PWD3,22,135,74,18
-    LTEXT           "Version",IDC_STATIC_VERSION,7,170,172,8
 END
 
 


More information about the cvs-krb5 mailing list