]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
allow multiple Leash options; add -noribbon
authorKevin Wasserman <kevin.wasserman@painless-security.com>
Fri, 20 Jul 2012 15:33:51 +0000 (11:33 -0400)
committerTom Yu <tlyu@mit.edu>
Mon, 27 Aug 2012 23:27:29 +0000 (19:27 -0400)
Change option parsing to allow more than one option to be given.
Use the ribbon UI by default; -noribbon reverts to the old UI.

Signed-off-by: Kevin Wasserman <kevin.wasserman@painless-security.com>
(cherry picked from commit d5cafe2f1016e18ac191528a0c24f8dc6fbeb1f2)

ticket: 7241
status: resolved

src/windows/leash/Leash.cpp
src/windows/leash/Leash.h

index a4469972eaf6ddc8cd17b8379d9a1fe8633b5eb2..0ee617ab57724ddb9c8bde1a6c5a2747f2957ef9 100644 (file)
@@ -68,6 +68,7 @@ HINSTANCE CLeashApp::m_hToolHelp32 = 0;
 krb5_context CLeashApp::m_krbv5_context = 0;
 profile_t CLeashApp::m_krbv5_profile = 0;
 HINSTANCE CLeashApp::m_hKrbLSA = 0;
+int CLeashApp::m_useRibbon = TRUE;
 
 /////////////////////////////////////////////////////////////////////////////
 // CLeashApp
@@ -190,10 +191,12 @@ BOOL CLeashApp::InitInstance()
 
     // Check for args (switches)
     LPCTSTR exeFile            = __targv[0];
-    LPCTSTR optionParam =  __targv[1];
+    for (int argi = 1; argi < __argc; argi++) {
+        LPCTSTR optionParam =  __targv[argi];
+
+        if (!optionParam)
+            continue;
 
-    if (optionParam)
-    {
         if (*optionParam  == '-' || *optionParam  == '/')
         {
             if (0 == stricmp(optionParam+1, "kinit") ||
@@ -312,6 +315,10 @@ BOOL CLeashApp::InitInstance()
             {
                 CreateConsoleEcho();
             }
+            else if (0 == stricmp(optionParam+1, "noribbon"))
+            {
+                m_useRibbon = FALSE;
+            }
             else
             {
                 MessageBox(hMsg,
index 43c7da78a572cbc25265971be3cfae9d6e61a444..13b14381a67ea63f1741c5c2b546db70a62a9590 100644 (file)
@@ -119,6 +119,7 @@ public:
        static krb5_context m_krbv5_context;
        static profile_t    m_krbv5_profile;
        static HINSTANCE    m_hKrbLSA;
+       static int          m_useRibbon; // temporary while ribbon UI in dev
 
        CLeashApp();
        virtual ~CLeashApp();