Further attempt at removing K4 specific code from the leash executable
authorSam Hartman <hartmans@mit.edu>
Fri, 14 Oct 2011 14:42:37 +0000 (14:42 +0000)
committerSam Hartman <hartmans@mit.edu>
Fri, 14 Oct 2011 14:42:37 +0000 (14:42 +0000)
Updates to leash Makefile.in to make it link on Windows 64

Signed-off-by: Alexey Melnikov <aamelnikov@gmail.com>
leash link fixes: fix mfc library and fix path to wshelper

MFC100D.lib for mscv2010; util\wshelper instead of windows\wshelper

Add ver.rc for leash

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25339 dc483132-0cff-0310-8789-dd5450dbe970

18 files changed:
src/Makefile.in
src/windows/Makefile.in
src/windows/leash/Krb4EditDomainRealmList.cpp
src/windows/leash/KrbConfigOptions.cpp
src/windows/leash/KrbDomainRealmMaintenance.cpp
src/windows/leash/KrbMiscConfigOpt.cpp
src/windows/leash/KrbProperties.cpp
src/windows/leash/KrbProperties.h
src/windows/leash/Leash.cpp
src/windows/leash/Leash.h
src/windows/leash/LeashAboutBox.cpp
src/windows/leash/LeashDebugWindow.cpp
src/windows/leash/LeashProperties.cpp
src/windows/leash/LeashView.cpp
src/windows/leash/LeashView.h
src/windows/leash/Lglobals.h
src/windows/leash/Makefile.in [new file with mode: 0644]
src/windows/leash/ver.rc [new file with mode: 0644]

index c03ddd46cfdbbff4faf2286e421261c053a0a605..625fb58d7bbb3913800acf18281cdd5cc7f6fbe0 100644 (file)
@@ -195,7 +195,8 @@ WINMAKEFILES=Makefile \
        windows\Makefile windows\lib\Makefile \
        windows\cns\Makefile windows\gina\Makefile \
        windows\ms2mit\Makefile \
-       windows\wintel\Makefile windows\kfwlogon\Makefile windows\leashdll\Makefile
+       windows\wintel\Makefile windows\kfwlogon\Makefile \
+       windows\leashdll\Makefile windows\leash\Makefile
 
 ##DOS##Makefile-windows:: $(MKFDEP) $(WINMAKEFILES)
 
@@ -323,6 +324,8 @@ WINMAKEFILES=Makefile \
 ##DOS##        $(WCONFIG) config < $@.in > $@
 ##DOS##windows\leashdll\Makefile: windows\leashdll\Makefile.in $(MKFDEP)
 ##DOS##        $(WCONFIG) config < $@.in > $@
+##DOS##windows\leash\Makefile: windows\leash\Makefile.in $(MKFDEP)
+##DOS##        $(WCONFIG) config < $@.in > $@
 
 clean-windows:: Makefile-windows
 
@@ -367,7 +370,7 @@ WINFILES= \
        ccapi/test/* \
        util/windows/* windows/* windows/wshelper/* windows/lib/* windows/cns/* \
        windows/wintel/* windows/gina/* windows/ms2mit/* \
-       windows/kfwlogon/* windows/leashdll/*
+       windows/kfwlogon/* windows/leashdll/* windows/leash/*
 
 WINBINARYFILES=        windows/*/*.ico windows/*/*.doc windows/*/*.hlp \
        windows/*/*.hpj
index 79fe8160cb9a400e6701cabfb02f8ddb58054ee7..da1427f700b1bb41f4fe478fcdc6d15de44e11ad 100644 (file)
@@ -1,3 +1,3 @@
 BUILDTOP=..
 NO_OUTPRE=1
-SUBDIRS= lib leashdll cns gina ms2mit kfwlogon
+SUBDIRS= lib leashdll leash cns gina ms2mit kfwlogon
index 0470448340961aeec0344264f97db0ebf8158536..e2773bf0f434dd7b7ca1099bc46230b88ad8bbd5 100644 (file)
@@ -42,8 +42,12 @@ CKrb4EditDomainRealmList::CKrb4EditDomainRealmList(LPSTR editItem, CWnd* pParent
          *findSpace = 0;
        else
        {
+////@#+This hack doesn't seem right
+#ifndef NO_KRB4
+
                 LeashErrorBox("This is a defective entry in file",
                                           CKrb4ConfigFileLocation::m_newKrbrealmFile);
+#endif
                 ASSERT(0);
                 m_initDomainHost = m_newDomainHost = editItem;
                 m_initRealm = m_newRealm = _T("");
index 2e1599c289da76708ca2d61dd6cab69174e4ed27..3e69bb0a1239904d3e15e86239557e333b0e6600 100644 (file)
@@ -82,6 +82,7 @@ static char far * near parse_str(char far*buffer,char far*result)
         return buffer;
 }
 
+#ifndef NO_KRB4
 int krb_get_krbhst(char* h, char* r, int n)
 {
        char lbstorage[BUFSIZ];
@@ -139,6 +140,7 @@ int krb_get_krbhst(char* h, char* r, int n)
     (void) fclose(cnffile);
     return(KSUCCESS);
 }
+#endif
 
 BOOL CKrbConfigOptions::OnInitDialog()
 {
@@ -152,6 +154,7 @@ BOOL CKrbConfigOptions::OnInitDialog()
 
     CPropertyPage::OnInitDialog();
 
+#ifndef NO_KRB4
        if (CLeashApp::m_hKrb4DLL && !CLeashApp::m_hKrb5DLL)
        {  // Krb4 NOT krb5
                // Fill in all edit boxes
@@ -200,7 +203,7 @@ BOOL CKrbConfigOptions::OnInitDialog()
 
                                        m_hostServer = krbhst;
 
-                                       // New suff to put realms in Combo Box
+                                       // New stuff to put realms in Combo Box
                                        CStdioFile krbCon;
                                        if (!krbCon.Open(CKrbProperties::m_krbPath, CFile::modeRead))
                                        {
@@ -262,7 +265,9 @@ BOOL CKrbConfigOptions::OnInitDialog()
                        } // end of 'Check for Host' else statement
                } // end of 'place krbRealm in Edit box' else
        }
-       else if (CLeashApp::m_hKrb5DLL)
+       else
+#endif
+       if (CLeashApp::m_hKrb5DLL)
        { // Krb5 OR krb5 AND krb4
                char *realm = NULL;
                pkrb5_get_default_realm(CLeashApp::m_krbv5_context, &realm);
@@ -472,6 +477,7 @@ void CKrbConfigOptions::OnSelchangeEditDefaultRealm()
                                        SetDlgItemText(IDC_EDIT_REALM_HOSTNAME, "No KDC information available");
                        }
                }
+#ifndef NO_KRB4
                else
                {
                        CHAR krbhst[MAX_HSTNM + 1];
@@ -496,6 +502,7 @@ void CKrbConfigOptions::OnSelchangeEditDefaultRealm()
                        if (strlen(krbhst))
                          SetDlgItemText(IDC_EDIT_REALM_HOSTNAME, m_hostServer);
                }
+#endif
        }
 }
 
index cb13137d8785a7553909cf5b08a6d2eae6799a33..da9e883cc714d434085b021a8fa3cd35aa0f5243 100644 (file)
@@ -140,6 +140,7 @@ BOOL CKrbDomainRealmMaintenance::OnApply()
                return TRUE;
        }
 
+#ifndef NO_KRB4
        // Save to Kerberos Four config. file "Krb.con"
        CStdioFile krbrealmCon;
        if (!krbrealmCon.Open(CKrbProperties::m_krbrealmPath, CFile::modeCreate |
@@ -165,6 +166,8 @@ BOOL CKrbDomainRealmMaintenance::OnApply()
        }
 
        krbrealmCon.Close();
+#endif
+
        return TRUE;
 }
 
@@ -190,6 +193,8 @@ void CKrbDomainRealmMaintenance::OnCancel()
 
 void CKrbDomainRealmMaintenance::OnButtonHostAdd()
 {
+////I don't understand why this is doing K4 operations here
+#ifndef NO_KRB4
        CKrb4AddToDomainRealmList addToDomainRealmList;
        if (IDOK == addToDomainRealmList.DoModal())
        {
@@ -239,7 +244,7 @@ void CKrbDomainRealmMaintenance::OnButtonHostAdd()
                        GetDlgItem(IDC_BUTTON_HOST_EDIT)->EnableWindow();
                }
        }
-
+#endif
 }
 
 void CKrbDomainRealmMaintenance::OnButtonHostEdit()
index cdb4c677d7c994877a9331fa459258aac2896125..2c7153ef876c63cfbba12e9aa50f3e2c03075b65 100644 (file)
@@ -282,14 +282,20 @@ BOOL CKrbMiscConfigOpt::OnInitDialog()
         GetDlgItem(IDC_EDIT_RENEW_MAX_M)->EnableWindow(FALSE);
     }
 
-
+#ifndef NO_KRB4
     m_initUseKrb4 = m_newUseKrb4 = (CLeashApp::m_hKrb4DLL ? pLeash_get_default_use_krb4() : 0);
-       CheckDlgButton(IDC_CHECK_REQUEST_KRB4, m_initUseKrb4);
+    CheckDlgButton(IDC_CHECK_REQUEST_KRB4, m_initUseKrb4);
     if ( !CLeashApp::m_hKrb4DLL )
         GetDlgItem(IDC_CHECK_REQUEST_KRB4)->EnableWindow(FALSE);
+#else
+////Or remove these completely?
+    m_initUseKrb4 = m_newUseKrb4 = 0;
+    CheckDlgButton(IDC_CHECK_REQUEST_KRB4, 0);
+    GetDlgItem(IDC_CHECK_REQUEST_KRB4)->EnableWindow(FALSE);
+#endif
 
     m_initKinitPreserve = m_newKinitPreserve = pLeash_get_default_preserve_kinit_settings();
-       CheckDlgButton(IDC_CHECK_PRESERVE_KINIT_OPTIONS, m_initKinitPreserve);
+    CheckDlgButton(IDC_CHECK_PRESERVE_KINIT_OPTIONS, m_initKinitPreserve);
 
     return(TRUE);
 }
@@ -402,9 +408,11 @@ BOOL CKrbMiscConfigOpt::OnApply()
                    "Leash", MB_OK);
     }
 
+#ifndef NO_KRB4
        if ( m_initUseKrb4 != m_newUseKrb4 ) {
                pLeash_set_default_use_krb4(m_newUseKrb4);
        }
+#endif
 
        if ( m_initKinitPreserve != m_newKinitPreserve ) {
                pLeash_set_default_preserve_kinit_settings(m_newKinitPreserve);
index d26987e4af1e65c59d76caffbc15f14251f7821a..0a6414253002f243fef1b3022b2490749066b043 100644 (file)
@@ -59,19 +59,23 @@ CKrbProperties::CKrbProperties(LPCTSTR pszCaption, CWnd* pParentWnd,
        }
 #endif /* COMMENT */
 
+#ifndef NO_KRB4
     CLeashApp::GetKrb4ConFile(m_krbPath,sizeof(m_krbPath));
     CLeashApp::GetKrb4RealmFile(m_krbrealmPath,sizeof(m_krbrealmPath));
-
+#endif
 
        AddPage(&m_configOptions);
        AddPage(&m_miscConfigOpt);
 
+#ifndef NO_KRB4
        if (CLeashApp::m_hKrb4DLL && !CLeashApp::m_hKrb5DLL)
        {
                AddPage(&m_krb4RealmHostMaintenance);
                AddPage(&m_krb4DomainRealmMaintenance);
        }
-       else if (CLeashApp::m_hKrb5DLL)
+       else
+#endif
+       if (CLeashApp::m_hKrb5DLL)
        {
                AddPage(&m_realmHostMaintenance);
                AddPage(&m_domainRealmMaintenance);
index c73ca6e688fff30b5a9f14c393ab6a403ad86363..f476ac1a26721a7aa60a922ef2b986138b9e0c04 100644 (file)
 #include "KrbConfigOptions.h"
 #include "KrbRealmHostMaintenance.h"
 #include "KrbDomainRealmMaintenance.h"
+#ifndef NO_KRB4
 #include "Krb4DomainRealmMaintenance.h"
 #include "Krb4RealmHostMaintenance.h"
+#endif
 #include "KrbMiscConfigOpt.h"
 
 //////////////////////////////////////////////////////////////////////
@@ -40,9 +42,13 @@ private:
 public:
        //CKrbConfigFileLocation m_fileLocation;
        CKrbConfigOptions m_configOptions;
+#ifndef NO_KRB4
        CKrb4RealmHostMaintenance m_krb4RealmHostMaintenance;
+#endif
        CKrbRealmHostMaintenance m_realmHostMaintenance;
+#ifndef NO_KRB4
        CKrb4DomainRealmMaintenance m_krb4DomainRealmMaintenance;
+#endif
        CKrbDomainRealmMaintenance m_domainRealmMaintenance;
     CKrbMiscConfigOpt m_miscConfigOpt;
 
index dbd2fe5134028d5b101b5b2c1249a1252c2de9f9..88ee7356a060a4006d428461912f7df045082614 100644 (file)
@@ -54,7 +54,10 @@ HANDLE m_tgsReqMutex = 0;
 
 HWND CLeashApp::m_hProgram = 0;
 HINSTANCE CLeashApp::m_hLeashDLL = 0;
+////@#+Remove
+#ifndef NO_KRB4
 HINSTANCE CLeashApp::m_hKrb4DLL = 0;
+#endif
 HINSTANCE CLeashApp::m_hKrb5DLL = 0;
 HINSTANCE CLeashApp::m_hKrb5ProfileDLL= 0;
 HINSTANCE CLeashApp::m_hAfsDLL = 0;
@@ -120,7 +123,9 @@ CLeashApp::~CLeashApp()
 #endif
 #endif
        AfxFreeLibrary(m_hLeashDLL);
+#ifndef NO_KRB4
        AfxFreeLibrary(m_hKrb4DLL);
+#endif
        AfxFreeLibrary(m_hKrb5DLL);
        AfxFreeLibrary(m_hKrb5ProfileDLL);
        AfxFreeLibrary(m_hAfsDLL);
@@ -580,6 +585,8 @@ FUNC_INFO leash_fi[] = {
     END_FUNC_INFO
 };
 
+////
+#ifndef NO_KRB4
 // krb4 functions
 DECL_FUNC_PTR(set_krb_debug);
 DECL_FUNC_PTR(set_krb_ap_req_debug);
@@ -609,6 +616,7 @@ FUNC_INFO krb4_fi[] = {
     MAKE_FUNC_INFO(krb_get_tf_realm),
     END_FUNC_INFO
 };
+#endif
 
 
 // psapi functions
@@ -718,7 +726,9 @@ FUNC_INFO profile_fi[] = {
 BOOL CLeashApp::InitDLLs()
 {
     m_hLeashDLL = AfxLoadLibrary(LEASHDLL);
+#ifndef NO_KRB4
     m_hKrb4DLL = AfxLoadLibrary(KERB4DLL);
+#endif
     m_hKrb5DLL = AfxLoadLibrary(KERB5DLL);
     m_hKrb5ProfileDLL = AfxLoadLibrary(KERB5_PPROFILE_DLL);
 
@@ -750,6 +760,8 @@ BOOL CLeashApp::InitDLLs()
         return FALSE;
     }
 
+////
+#ifndef NO_KRB4
     if (m_hKrb4DLL)
     {
         if (!LoadFuncs(KERB4DLL, krb4_fi, 0, 0, 1, 0, 0))
@@ -760,6 +772,7 @@ BOOL CLeashApp::InitDLLs()
                        "Error", MB_OK);
         }
     }
+#endif
 
     if (m_hKrb5DLL)
     {
@@ -1121,6 +1134,8 @@ CLeashApp::ValidateConfigFiles()
             }
 
         }
+////
+#ifndef NO_KRB4
     } else if ( m_hKrb4DLL ) {
         if ( !realm[0] ) {
             /* Open ticket file */
@@ -1164,16 +1179,23 @@ CLeashApp::ValidateConfigFiles()
             } else
                                krbCon.Close();
         }
+#endif
     }
 }
 
+////@#+Should this be just deleted or reworked?
 BOOL
 CLeashApp::GetKrb4ConFile(
     LPSTR confname,
     UINT szConfname
     )
 {
-    if (m_hKrb5DLL && !m_hKrb4DLL)
+    if (m_hKrb5DLL
+////
+#ifndef NO_KRB4
+       && !m_hKrb4DLL
+#endif
+       )
        { // hold krb.con where krb5.ini is located
                CHAR krbConFile[MAX_PATH]="";
            //strcpy(krbConFile, CLeashApp::m_krbv5_profile->first_file->filename);
@@ -1200,6 +1222,8 @@ CLeashApp::GetKrb4ConFile(
                strncpy(confname, krbConFile, szConfname);
         confname[szConfname-1] = '\0';
        }
+////
+#ifndef NO_KRB4
        else if (m_hKrb4DLL)
        {
         unsigned int size = szConfname;
@@ -1214,6 +1238,8 @@ CLeashApp::GetKrb4ConFile(
             confname[szConfname-1] = '\0';
                }
        }
+#endif
+
     return FALSE;
 }
 
@@ -1223,7 +1249,12 @@ CLeashApp::GetKrb4RealmFile(
     UINT szConfname
     )
 {
-    if (m_hKrb5DLL && !m_hKrb4DLL)
+    if (m_hKrb5DLL
+////
+#ifndef NO_KRB4
+       && !m_hKrb4DLL
+#endif
+       )
        { // hold krb.con where krb5.ini is located
                CHAR krbRealmConFile[MAX_PATH];
                //strcpy(krbRealmConFile, CLeashApp::m_krbv5_profile->first_file->filename);
@@ -1250,6 +1281,8 @@ CLeashApp::GetKrb4RealmFile(
                strncpy(confname, krbRealmConFile, szConfname);
         confname[szConfname-1] = '\0';
        }
+////
+#ifndef NO_KRB4
        else if (m_hKrb4DLL)
        {
         unsigned int size = szConfname;
@@ -1265,6 +1298,8 @@ CLeashApp::GetKrb4RealmFile(
             return TRUE;
                }
        }
+#endif
+
     return FALSE;
 }
 
index 74c9d5d0a85e9cd04821012b0ade058ad6f84796..7975987d1f8157c7e91b15c06237d2098d25473d 100644 (file)
@@ -68,7 +68,8 @@
 #define HID_KERBEROS_PROPERTIES_EDITHOST 131271
 #define HID_KERBEROS_PROPERTIES_LISTDOM 131279
 
-#define USE_HTMLHELP
+////@#+This might be problematic with the latest Platform SDK...
+////#define USE_HTMLHELP
 
 #ifdef USE_HTMLHELP
 #if _MSC_VER >= 1300
 #endif
 #endif
 
+////Is this a good place for these defines?
+#if !defined(MAX_HSTNM)
+#define         MAX_HSTNM       100
+#endif
+
+
 #include "resource.h"       // main symbols
 #include "lglobals.h"
 
@@ -98,7 +105,10 @@ private:
 public:
        static HWND                     m_hProgram;
        static HINSTANCE        m_hLeashDLL;
+////
+#ifndef NO_KRB4
        static HINSTANCE        m_hKrb4DLL;
+#endif
        static HINSTANCE        m_hKrb5DLL;
        static HINSTANCE        m_hKrb5ProfileDLL;
        static HINSTANCE        m_hAfsDLL;
index 972514feeb838f8814a534ed4b7a30e0939f0afc..8c6f7f425b5e9646f8cf9ea112be4b39a320f9d4 100644 (file)
@@ -302,8 +302,10 @@ void CLeashAboutBox::OnNotLoadedModules()
 {
     m_LB_DLLsLoaded.ResetContent();
 
+#ifndef NO_KRB4
     if (!CLeashApp::m_hKrb4DLL)
         m_LB_DLLsLoaded.AddString(KERB4DLL);
+#endif
 
     if (!CLeashApp::m_hKrb5DLL)
         m_LB_DLLsLoaded.AddString(KERB5DLL);
index 6e12903aec47030bfba39e3f852ec28b56a68811..e8c4553eea37aaed7d6520c66f129d344f4fc237 100644 (file)
@@ -81,8 +81,8 @@ void CLeashDebugWindow::OnCancel()
                pApp = AfxGetApp();
                pApp->WriteProfileInt("Settings", "DebugWindow", FALSE_FLAG);
                m_pView->PostMessage(WM_GOODBYE, IDCANCEL);     // modeless case
-        pset_krb_debug(OFF);
-           pset_krb_ap_req_debug(OFF);
+////        pset_krb_debug(OFF);
+////       pset_krb_ap_req_debug(OFF);
     }
        else
        {
@@ -109,8 +109,8 @@ BOOL CLeashDebugWindow::OnInitDialog()
        CDialog::OnInitDialog();
 
        // Set Debug flags
-       pset_krb_debug(ON); //(int)m_debugListBox.GetSafeHwnd()
-    pset_krb_ap_req_debug(ON);
+////   pset_krb_debug(ON); //(int)m_debugListBox.GetSafeHwnd()
+////    pset_krb_ap_req_debug(ON);
 
        if (*m_debugFilePath != 0)
          SetDlgItemText(IDC_LOG_FILE_LOCATION_TEXT, m_debugFilePath);
index 2854231739354848ceb4fd6df7b90bffb164cec4..0089baf5aad218655d96a0ac2951c38a1f216483 100644 (file)
 static char THIS_FILE[] = __FILE__;
 #endif
 
+////Some unknown Platform SDK/VC uglines
+#if defined(__HTMLHELP_H__)
+#ifdef HtmlHelp
+#undef HtmlHelp
+#endif
+#endif
+
+
 /////////////////////////////////////////////////////////////////////////////
 // CLeashProperties dialog
 
index e97ab762d2a61c3ea6f6aba5f3546a5943e95ea9..14f9fc1314647ef994908ffce041cb2322411133 100644 (file)
@@ -130,7 +130,10 @@ extern HANDLE m_tgsReqMutex;
 CLeashView::CLeashView():
 CFormView(CLeashView::IDD)
 {
+////@#+Need removing as well!
+#ifndef NO_KRB4
     m_listKrb4 = NULL;
+#endif
     m_listKrb5 = NULL;
     m_listAfs = NULL;
     m_startup = TRUE;
@@ -343,8 +346,14 @@ VOID CLeashView::OnShowWindow(BOOL bShow, UINT nStatus)
 
     SetTimer(1, ONE_SECOND, TimerProc);
 
-    if (!CLeashApp::m_hKrb4DLL && !CLeashApp::m_hKrb5DLL && !CLeashApp::m_hAfsDLL)
+    if (
+////
+#ifndef NO_KRB4
+       !CLeashApp::m_hKrb4DLL &&
+#endif
+       !CLeashApp::m_hKrb5DLL && !CLeashApp::m_hAfsDLL)
     {
+////Update not to mention K4
         AfxMessageBox("Neither Kerberos Four, Kerberos Five nor AFS is loaded!!!"
                    "\r\nYou will not be able to retrieve tickets and/or "
                    "tokens.",
@@ -540,7 +549,12 @@ UINT CLeashView::ImportTicket(void * hWnd)
 #ifndef KRB5_TC_NOTICKET
             ReleaseMutex(m_tgsReqMutex);
 #endif
-            if (!CLeashApp::m_hAfsDLL || !CLeashApp::m_hKrb4DLL)
+            if (!CLeashApp::m_hAfsDLL
+////@#+Need to rework this logic. I am confused what !m_hKrb4DLL means in this case!
+#ifndef NO_KRB4
+               || !CLeashApp::m_hKrb4DLL
+#endif
+               )
                 whatToDo = AfxMessageBox("You are about to replace your existing ticket(s)\n"
                                           "with a ticket imported from the Windows credential cache!",
                                           MB_OKCANCEL, 0);
@@ -829,9 +843,11 @@ VOID CLeashView::OnUpdateDisplay()
 
     TV_INSERTSTRUCT m_tvinsert;
 
+#ifndef NO_KRB4
     INT ticketIconStatusKrb4;
     INT ticketIconStatus_SelectedKrb4;
     INT iconStatusKrb4;
+#endif
 
     INT ticketIconStatusKrb5;
     INT ticketIconStatus_SelectedKrb5;
@@ -841,15 +857,19 @@ VOID CLeashView::OnUpdateDisplay()
     INT ticketIconStatus_SelectedAfs;
     INT iconStatusAfs;
 
+#ifndef NO_KRB4
     LONG krb4Error;
+#endif
     LONG krb5Error;
     LONG afsError;
 
     if (WaitForSingleObject( ticketinfo.lockObj, 100 ) != WAIT_OBJECT_0)
         throw("Unable to lock ticketinfo");
 
+#ifndef NO_KRB4
     // Get Kerb 4 tickets in list
     krb4Error = pLeashKRB4GetTickets(&ticketinfo.Krb4, &m_listKrb4);
+#endif
 
     // Get Kerb 5 tickets in list
     krb5Error = pLeashKRB5GetTickets(&ticketinfo.Krb5, &m_listKrb5,
@@ -889,6 +909,8 @@ VOID CLeashView::OnUpdateDisplay()
      * to select the appropriate Icon for the Parent Node
      */
 
+////Might need to delete dependent stuff as well!!!
+#ifndef NO_KRB4
     /* Krb4 */
     UpdateTicketTime(ticketinfo.Krb4);
     m_ticketStatusKrb4 = GetLowTicketStatus(4);
@@ -918,6 +940,8 @@ VOID CLeashView::OnUpdateDisplay()
         ticketIconStatus_SelectedKrb4 = EXPIRED_CLOCK;
         iconStatusKrb4 = TICKET_NOT_INSTALLED;
     }
+#endif
+
 
     /* Krb5 */
     UpdateTicketTime(ticketinfo.Krb5);
@@ -1005,6 +1029,8 @@ VOID CLeashView::OnUpdateDisplay()
             m_tvinsert.item.iSelectedImage = EXPIRED_PARENT_NODE;
             break;
         }
+////
+#ifndef NO_KRB4
     } else if (CLeashApp::m_hKrb4DLL && m_listKrb4) {
         m_tvinsert.item.pszText = ticketinfo.Krb4.principal;
         switch ( iconStatusKrb4 ) {
@@ -1018,6 +1044,7 @@ VOID CLeashView::OnUpdateDisplay()
             m_tvinsert.item.iSelectedImage = EXPIRED_PARENT_NODE;
             break;
         }
+#endif
     } else {
         m_tvinsert.item.iSelectedImage = NONE_PARENT_NODE;
     }
@@ -1094,6 +1121,7 @@ VOID CLeashView::OnUpdateDisplay()
     // Krb4
     m_tvinsert.hParent = m_hPrincipal;
 
+#ifndef NO_KRB4
     if (CLeashApp::m_hKrb4DLL)
     {
         m_tvinsert.item.pszText = "Kerberos Four Tickets";
@@ -1102,12 +1130,17 @@ VOID CLeashView::OnUpdateDisplay()
     }
     else
     {
+#endif
+////Can this be removed altogether?
         ticketinfo.Krb4.btickets = NO_TICKETS;
         m_tvinsert.item.pszText = "Kerberos Four Tickets (Not Available)";
         m_tvinsert.item.iImage = TICKET_NOT_INSTALLED;
         m_tvinsert.item.iSelectedImage = TICKET_NOT_INSTALLED;
+#ifndef NO_KRB4
     }
+#endif
 
+#ifndef NO_KRB4
     m_hKerb4 = m_pTree ->InsertItem(&m_tvinsert);
 
     if (m_hPrincipalState == NODE_IS_EXPANDED)
@@ -1117,6 +1150,8 @@ VOID CLeashView::OnUpdateDisplay()
     m_tvinsert.item.iImage = ticketIconStatusKrb4;
     m_tvinsert.item.iSelectedImage = ticketIconStatus_SelectedKrb4;
 
+
+////What does the original do?
     tempList = m_listKrb4, *killList;
     while (tempList)
     {
@@ -1129,7 +1164,7 @@ VOID CLeashView::OnUpdateDisplay()
 
     if (m_hKerb4State == NODE_IS_EXPANDED)
         m_pTree->Expand(m_hKerb4, TVE_EXPAND);
-
+#endif
 
     // AFS
     m_tvinsert.hParent = m_hPrincipal;
@@ -1369,10 +1404,13 @@ VOID CLeashView::OnActivateView(BOOL bActivate, CView* pActivateView,
     CFormView::OnActivateView(bActivate, pActivateView, pDeactiveView);
 }
 
+////@#+Is this KRB4 only?
 VOID CLeashView::OnDebugMode()
 {
+#ifndef NO_KRB4
     if (!pset_krb_debug)
         return;
+#endif
 
     if (!m_pDebugWindow)
     {
@@ -1422,8 +1460,11 @@ VOID CLeashView::OnDebugMode()
 
         m_pApp->WriteProfileInt("Settings", "DebugWindow", FALSE_FLAG);
         m_pDebugWindow->DestroyWindow();
+////
+#ifndef NO_KRB4
         pset_krb_debug(OFF);
         pset_krb_ap_req_debug(OFF);
+#endif
         return;
     }
     else
@@ -1616,7 +1657,9 @@ VOID CLeashView::OnUppercaseRealm()
 VOID CLeashView::ResetTreeNodes()
 {
     m_hPrincipalState = 0;
+#ifndef NO_KRB4
     m_hKerb4State = 0;
+#endif
     m_hKerb5State = 0;
     m_hAFSState = 0;
 }
@@ -1666,7 +1709,12 @@ VOID CLeashView::OnUpdateInitTicket(CCmdUI* pCmdUI)
     else
         pCmdUI->SetText("&Get Ticket(s)/Token(s)\tCtrl+T");
 
-    if (!CLeashApp::m_hKrb4DLL && !CLeashApp::m_hKrb5DLL &&
+    if (
+////Is this logic correct?
+#ifndef NO_KRB4
+       !CLeashApp::m_hKrb4DLL &&
+#endif
+       !CLeashApp::m_hKrb5DLL &&
         !CLeashApp::m_hAfsDLL)
         pCmdUI->Enable(FALSE);
     else
@@ -1682,8 +1730,16 @@ VOID CLeashView::OnUpdateRenewTicket(CCmdUI* pCmdUI)
 
     if (WaitForSingleObject( ticketinfo.lockObj, INFINITE ) != WAIT_OBJECT_0)
         throw("Unable to lock ticketinfo");
-    BOOL b_enable = !(ticketinfo.Krb4.btickets || ticketinfo.Krb5.btickets) ||
-                    !CLeashApp::m_hKrb4DLL && !CLeashApp::m_hKrb5DLL && !CLeashApp::m_hAfsDLL;
+    BOOL b_enable = !(
+#ifndef NO_KRB4
+       ticketinfo.Krb4.btickets ||
+#endif
+       ticketinfo.Krb5.btickets) ||
+////Not sure about the boolean logic here
+#ifndef NO_KRB4
+                    !CLeashApp::m_hKrb4DLL &&
+#endif
+                   !CLeashApp::m_hKrb5DLL && !CLeashApp::m_hAfsDLL;
     ReleaseMutex(ticketinfo.lockObj);
 
     if (b_enable)
@@ -1768,8 +1824,16 @@ LRESULT CLeashView::OnTrayIcon(WPARAM wParam, LPARAM lParam)
 #endif
             if (WaitForSingleObject( ticketinfo.lockObj, INFINITE ) != WAIT_OBJECT_0)
                 throw("Unable to lock ticketinfo");
-            if (!(ticketinfo.Krb4.btickets || ticketinfo.Krb5.btickets) ||
-                 !CLeashApp::m_hKrb4DLL && !CLeashApp::m_hKrb5DLL &&
+            if (!(
+#ifndef NO_KRB4
+               ticketinfo.Krb4.btickets ||
+#endif
+               ticketinfo.Krb5.btickets) ||
+////Not entirely sure about the logic
+#ifndef NO_KRB4
+                 !CLeashApp::m_hKrb4DLL &&
+#endif
+                !CLeashApp::m_hKrb5DLL &&
                  !CLeashApp::m_hAfsDLL)
                 nFlags = MF_STRING | MF_GRAYED;
             else
@@ -1850,8 +1914,10 @@ VOID CLeashView::OnItemexpandedTreeview(NMHDR* pNMHDR, LRESULT* pResult)
 
     if (m_hPrincipal == pNMTreeView->itemNew.hItem)
         m_hPrincipalState = pNMTreeView->action;
+#ifndef NO_KRB4
     else if (m_hKerb4 == pNMTreeView->itemNew.hItem)
         m_hKerb4State = pNMTreeView->action;
+#endif
     else if (m_hKerb5 == pNMTreeView->itemNew.hItem)
         m_hKerb5State = pNMTreeView->action;
     else if (m_hAFS ==  pNMTreeView->itemNew.hItem)
@@ -1863,18 +1929,30 @@ VOID CLeashView::OnItemexpandedTreeview(NMHDR* pNMHDR, LRESULT* pResult)
 
 VOID CLeashView::OnUpdateDebugMode(CCmdUI* pCmdUI)
 {
+////
+#ifndef NO_KRB4
     if (!pset_krb_debug)
+#endif
         pCmdUI->Enable(FALSE);
+////
+#ifndef NO_KRB4
     else
         pCmdUI->Enable(TRUE);
+#endif
 }
 
 VOID CLeashView::OnUpdateCfgFiles(CCmdUI* pCmdUI)
 {
+////
+#ifndef NO_KRB4
     if (!pkrb_get_krbconf2)
+#endif
         pCmdUI->Enable(FALSE);
+////
+#ifndef NO_KRB4
     else
         pCmdUI->Enable(TRUE);
+#endif
 }
 
 VOID CLeashView::OnLeashProperties()
@@ -1891,8 +1969,10 @@ VOID CLeashView::OnKrbProperties()
 
 VOID CLeashView::OnKrb4Properties()
 {
+#ifndef NO_KRB4
     CKrb4Properties krb4Properties("Kerberos Four Properties");
     krb4Properties.DoModal();
+#endif
 }
 
 VOID CLeashView::OnKrb5Properties()
@@ -2102,6 +2182,7 @@ BOOL CLeashView::PreTranslateMessage(MSG* pMsg)
             }
             //KRB5
 
+#ifndef NO_KRB4
             if (CLeashApp::m_hKrb4DLL)
             {
                 // KRB4
@@ -2196,6 +2277,8 @@ BOOL CLeashView::PreTranslateMessage(MSG* pMsg)
             }
             else
             {
+#endif
+////Should this be removed altogether?
                 // not installed
                 ticketStatusKrb4.Format("Kerb-4: Not Available");
 
@@ -2204,8 +2287,10 @@ BOOL CLeashView::PreTranslateMessage(MSG* pMsg)
                     CMainFrame::m_wndStatusBar.SetPaneInfo(2, 111111, SBPS_NORMAL, 130);
                     CMainFrame::m_wndStatusBar.SetPaneText(2, ticketStatusKrb4, SBT_POPOUT);
                 }
+#ifndef NO_KRB4
             }
             // KRB4
+#endif
 
             if (CLeashApp::m_hAfsDLL)
             {
@@ -2707,7 +2792,11 @@ VOID CLeashView::AlarmBeep()
 
 VOID CLeashView::OnUpdateProperties(CCmdUI* pCmdUI)
 {
-    if (CLeashApp::m_hKrb5DLL || CLeashApp::m_hKrb4DLL)
+    if (CLeashApp::m_hKrb5DLL
+#ifndef NO_KRB4
+       || CLeashApp::m_hKrb4DLL
+#endif
+       )
         pCmdUI->Enable();
     else
         pCmdUI->Enable(FALSE);
@@ -2715,9 +2804,11 @@ VOID CLeashView::OnUpdateProperties(CCmdUI* pCmdUI)
 
 VOID CLeashView::OnUpdateKrb4Properties(CCmdUI* pCmdUI)
 {
+#ifndef NO_KRB4
     if (CLeashApp::m_hKrb4DLL)
         pCmdUI->Enable();
     else
+#endif
         pCmdUI->Enable(FALSE);
 }
 
@@ -2731,10 +2822,13 @@ VOID CLeashView::OnUpdateKrb5Properties(CCmdUI* pCmdUI)
 
 VOID CLeashView::OnUpdateAfsControlPanel(CCmdUI* pCmdUI)
 {
+////Is the comment even correct?
+#ifndef NO_KRB4
     // need Krb 4 to get AFS tokens
     if (CLeashApp::m_hAfsDLL && CLeashApp::m_hKrb4DLL)
         pCmdUI->Enable();
     else
+#endif
         pCmdUI->m_pMenu->DeleteMenu(pCmdUI->m_nID, MF_BYCOMMAND);
 }
 
index 36d842306df1534f6d4130d5f1c5d55297e7aa9c..e469058ae0393152176c9853aea0e6260e62bf7d 100644 (file)
@@ -70,7 +70,10 @@ class CLeashDebugWindow;
 class CLeashView : public CFormView
 {
 private:
+////@#+Remove
+#ifndef NO_KRB4
     TicketList*         m_listKrb4;
+#endif
     TicketList*         m_listKrb5;
     TicketList*         m_listAfs;
     CLeashDebugWindow* m_pDebugWindow;
@@ -79,7 +82,10 @@ private:
     CTreeCtrl*                 m_pTree;
        CWinApp*                        m_pApp;
        HTREEITEM                       m_hPrincipal;
+////@#+Remove
+#ifndef NO_KRB4
        HTREEITEM                       m_hKerb4;
+#endif
        HTREEITEM                       m_hKerb5;
     HTREEITEM           m_hk5tkt;
        HTREEITEM                       m_hAFS;
@@ -95,7 +101,9 @@ private:
        INT                                     m_largeIcons;
        INT                                     m_lowTicketAlarm;
        INT                                     m_hPrincipalState;
+#ifndef NO_KRB4
        INT                                     m_hKerb4State;
+#endif
        INT                                     m_hKerb5State;
        INT                                     m_hAFSState;
     BOOL                m_bIconAdded;
@@ -103,13 +111,16 @@ private:
 
     static INT                 m_autoRenewTickets;
     static INT          m_ticketStatusAfs;
+////Remove as well?
     static INT          m_ticketStatusKrb4;
     static INT          m_ticketStatusKrb5;
     static INT          m_autoRenewalAttempted;
        static INT                      m_warningOfTicketTimeLeftAfs;
+////Remove as well?
        static INT                      m_warningOfTicketTimeLeftKrb4;
        static INT                      m_warningOfTicketTimeLeftKrb5;
     static INT                 m_warningOfTicketTimeLeftLockAfs;
+////Remove as well?
     static INT                 m_warningOfTicketTimeLeftLockKrb4;
     static INT                 m_warningOfTicketTimeLeftLockKrb5;
     static INT                 m_updateDisplayCount;
index 7407b3b811763fc9913735c69633d62463ae39ae..777e056bb451605cf95a33cadba63451e840e250 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <tlhelp32.h>
 #include <loadfuncs-krb5.h>
-#include <loadfuncs-krb.h>
+////#include <loadfuncs-krb.h>
 #include <loadfuncs-profile.h>
 #include <loadfuncs-leash.h>
 
@@ -151,23 +151,13 @@ extern DECL_FUNC_PTR(Leash_importable);
 extern DECL_FUNC_PTR(Leash_renew);
 extern DECL_FUNC_PTR(Leash_reset_defaults);
 
+////Do we still need this one?
 #define pLeashKRB4GetTickets     pnot_an_API_LeashKRB4GetTickets
 #define pLeashKRB5GetTickets     pnot_an_API_LeashKRB5GetTickets
 #define pLeashAFSGetToken        pnot_an_API_LeashAFSGetToken
 #define pLeashFreeTicketList     pnot_an_API_LeashFreeTicketList
 #define pLeashGetTimeServerName  pnot_an_API_LeashGetTimeServerName
 
-// krb4 functions
-extern DECL_FUNC_PTR(set_krb_debug);
-extern DECL_FUNC_PTR(set_krb_ap_req_debug);
-extern DECL_FUNC_PTR(krb_get_krbconf2);
-extern DECL_FUNC_PTR(krb_get_krbrealm2);
-extern DECL_FUNC_PTR(tkt_string);
-extern DECL_FUNC_PTR(krb_set_tkt_string);
-extern DECL_FUNC_PTR(krb_realmofhost);
-extern DECL_FUNC_PTR(krb_get_lrealm);
-extern DECL_FUNC_PTR(krb_get_krbhst);
-
 // psapi functions
 extern DECL_FUNC_PTR(GetModuleFileNameExA);
 extern DECL_FUNC_PTR(EnumProcessModules);
@@ -235,6 +225,7 @@ extern DECL_FUNC_PTR(profile_release_string);
 #define KRB_FILE               "KRB.CON"
 #define KRBREALM_FILE  "KRBREALM.CON"
 #define TICKET_FILE            "TICKET.KRB"
+////Wow. Why?
 #define WIN95_AUTOEXEC  "C:\\AUTOEXEC.BAT"
 
 #define LEASH_HELP_FILE "leash32.chm"
@@ -263,6 +254,7 @@ public:
 class TicketInfoWrapper {
   public:
     HANDLE     lockObj;
+////Can this be commented out?
     TICKETINFO Krb4;
     TICKETINFO Krb5;
     TICKETINFO Afs;
diff --git a/src/windows/leash/Makefile.in b/src/windows/leash/Makefile.in
new file mode 100644 (file)
index 0000000..1b1ae69
--- /dev/null
@@ -0,0 +1,98 @@
+# makefile: Leash executable
+#
+
+#TODO Fix later:
+NO_AFS=1
+
+!ifndef NO_AFS
+###AFS_BASE=
+AFS_INCLUDES=-I$(AFS_BASE)\Include
+AFS_LIB=$(AFS_BASE)\lib
+AFS_LIBS=$(AFS_LIB)\afsauthent.lib
+!else
+AFS_INCLUDES=
+AFS_LIBS=
+!endif
+
+MFCLIB=MFC100D.LIB
+EXE_NAME=leash32
+WSHELPER=wshelp32
+
+!if ("$(CPU)" == "IA64") || ("$(CPU)" == "AMD64") || ("$(CPU)" == "ALPHA64")
+EXE_NAME=leash64
+WSHELPER=wshelp64
+!endif
+
+OBJS=   \
+       $(OUTPRE)Krb4EditDomainRealmList.obj \
+       $(OUTPRE)CLeashDragListBox.obj \
+       $(OUTPRE)Krb5Properties.obj \
+       $(OUTPRE)KrbAddHostServer.obj \
+       $(OUTPRE)KrbAddRealm.obj \
+       $(OUTPRE)KrbConfigOptions.obj \
+       $(OUTPRE)KrbDomainRealmMaintenance.obj \
+       $(OUTPRE)KrbEditHostServer.obj \
+       $(OUTPRE)KrbEditRealm.obj \
+       $(OUTPRE)KrbProperties.obj \
+       $(OUTPRE)KrbRealmHostMaintenance.obj \
+       $(OUTPRE)Leash.obj \
+       $(OUTPRE)LeashAboutBox.obj \
+       $(OUTPRE)LeashDebugWindow.obj \
+       $(OUTPRE)LeashDoc.obj \
+       $(OUTPRE)LeashFileDialog.obj \
+       $(OUTPRE)LeashFrame.obj \
+       $(OUTPRE)LeashMessageBox.obj \
+       $(OUTPRE)LeashProperties.obj \
+       $(OUTPRE)LeashView.obj \
+       $(OUTPRE)lglobals.obj \
+       $(OUTPRE)MainFrm.obj \
+       $(OUTPRE)StdAfx.obj \
+       $(OUTPRE)AfsProperties.obj \
+       $(OUTPRE)VSroutines.obj \
+       $(OUTPRE)KrbMiscConfigOpt.obj
+
+RESFILE = $(OUTPRE)Leash.res
+XOBJS  = $(RESFILE)
+
+##### Options
+# Set NODEBUG if building release instead of debug
+BUILDTOP=..\..
+
+LOCALINCLUDES= -I$(BUILDTOP) -I$(BUILDTOP)\include -I$(BUILDTOP)\windows\include
+
+##### RC Compiler
+RFLAGS = $(LOCALINCLUDES)
+RCFLAGS        = $(RFLAGS) -D_WIN32 -DLEASH_APP
+
+DEFINES = -DWINSOCK -DWIN32 -DWINDOWS -D_AFXDLL -D_MBCS -DNO_KRB4
+!ifdef NODEBUG
+DEFINES = $(DEFINES)
+!else
+DEFINES = $(DEFINES) -DDBG
+!endif
+
+!ifdef NO_AFS
+DEFINES = $(DEFINES) -DNO_AFS
+!endif
+
+##### Linker
+LINK   = link
+LIBS   = $(GLIB) $(CLIB) $(WLIB)
+SYSLIBS        = kernel32.lib Iphlpapi.lib ws2_32.lib user32.lib gdi32.lib comdlg32.lib comctl32.lib version.lib
+LFLAGS = /nologo $(LOPTS)
+
+all:: Makefile $(OUTPRE)$(EXE_NAME).exe
+
+$(OUTPRE)$(EXE_NAME).exe: $(OBJS) $(XOBJS) $(LIBS)
+       $(LINK) $(LFLAGS) /out:$@ /ENTRY:WinMainCRTStartup $(OBJS) $(XOBJS) \
+         $(LIBS) $(SYSLIBS) $(BUILDTOP)\util\wshelper\$(OUTPRE)$(WSHELPER).lib \
+         ../lib/$(OUTPRE)libwin.lib atl.lib $(MFCLIB) $(SCLIB)
+
+$(RESFILE): ..\version.rc Leash.rc
+
+clean::
+       if exist $(OUTPRE)*.exe del $(OUTPRE)*.exe
+       if exist $(OUTPRE)*.obj del $(OUTPRE)*.obj
+       if exist $(OUTPRE)*.res del $(OUTPRE)*.res
+       if exist $(OUTPRE)*.pdb del $(OUTPRE)*.pdb
+       if exist *.err del *.err
diff --git a/src/windows/leash/ver.rc b/src/windows/leash/ver.rc
new file mode 100644 (file)
index 0000000..b93fcc4
--- /dev/null
@@ -0,0 +1,3 @@
+#define VER_FILEDESCRIPTION_STR        "Leash Application"
+
+#include <kerberos.ver>