From 83920b03268c6802c1a661f2620c8423a8bbcc74 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Thu, 29 Feb 1996 06:25:11 +0000 Subject: [PATCH] Added support for users to enter the GSSAPI target name into the combobox. The syntax is: "host port gssapi_target_name" git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7573 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/gss/changelo | 7 ++++++ src/windows/gss/gss.c | 53 ++++++++++++++++++++++++++-------------- src/windows/gss/gss.rc | 4 +-- 3 files changed, 43 insertions(+), 21 deletions(-) diff --git a/src/windows/gss/changelo b/src/windows/gss/changelo index 60ae643f7..aa59ceea9 100644 --- a/src/windows/gss/changelo +++ b/src/windows/gss/changelo @@ -1,3 +1,10 @@ +Thu Feb 29 01:23:01 1996 Theodore Y. Ts'o + + * gss.rc: + * gss.c: Added support for users to enter the GSSAPI target + name into the combobox. The syntax is: + "host port gssapi_target_name" + Wed Sep 13 11:07:45 1995 Keith Vetter (keithv@fusion.com) * gss-clie.c: turned const_gss_OID into const gss_OID. diff --git a/src/windows/gss/gss.c b/src/windows/gss/gss.c index ea7782f09..4b56e1e77 100644 --- a/src/windows/gss/gss.c +++ b/src/windows/gss/gss.c @@ -20,10 +20,9 @@ #define INI_HOST "Host" // INI file line label #define MAX_HOSTS 9 -char hosts[MAX_HOSTS][128]; - -char szHost[128]; // GSSAPI Host to connect to -char szServiceName[128]; // Service to do +char hosts[MAX_HOSTS][256]; +char szHost[256]; // GSSAPI Host to connect to +char szServiceName[256]; // Service to do int port = 0; // Which port to use static void do_gssapi_test (char *name); @@ -97,8 +96,7 @@ OpenGssapiDlg( HDC hDC; // For getting graphic info DWORD Ext; // Size of dialog int xExt, yExt; // Size broken apart - char hostname[128]; // What the user typed - + char hostname[256]; // What the user typed switch (message) { case WM_INITDIALOG: /* @@ -128,7 +126,7 @@ OpenGssapiDlg( break; case GSS_OK: - GetDlgItemText(hDlg, GSS_CONNECT_NAME, hostname, 128); + GetDlgItemText(hDlg, GSS_CONNECT_NAME, hostname, 256); SendDlgItemMessage(hDlg, GSS_CONNECT_NAME, CB_SHOWDROPDOWN, FALSE, NULL); @@ -161,14 +159,31 @@ OpenGssapiDlg( static void parse_name (char *name) { char *ptr; - - strcpy (szHost, name); - ptr = strchr (szHost, ' '); // Is there a port??? - if (ptr) { // Yep, start parsing it - port = atoi (ptr+1); - *ptr = '\0'; + char seps[] = " ,\t"; + char tempname[256]; + + memset( &tempname[0], '\0', 256 ); + strcpy( tempname, name); + ptr = strtok( tempname, seps); + if (ptr != NULL ){ + strcpy( szHost, ptr ); + } else { + wsprintf( szHost, "k5test" ); + } + if(ptr){ + ptr = strtok( NULL, seps); + } + if( ptr ){ + port = atoi (ptr); + } + if( ptr ){ + ptr = strtok( NULL, seps); + } + if( ptr ){ + strcpy( szServiceName, ptr ); + }else{ + wsprintf (szServiceName, "sample@%s", szHost); // Make the service name } - wsprintf (szServiceName, "host@%s", szHost); // Make the service name } /*+************************************************************************* ** @@ -179,13 +194,13 @@ parse_name (char *name) { ***************************************************************************/ static int read_hosts (void) { - int i; // Index + int i; /* Index */ char buff[10]; - - for (i = 0; MAX_HOSTS; ++i) { // Read this many entries + + for (i = 0; MAX_HOSTS; ++i) { /* Read this many entries */ wsprintf (buff, INI_HOST "%d", i); - GetPrivateProfileString(INI_HOSTS, buff, "", hosts[i], 128, GSSAPI_INI); - if (*hosts[i] == '\0') // No more entries??? + GetPrivateProfileString(INI_HOSTS, buff, "", hosts[i], 256, GSSAPI_INI); + if (*hosts[i] == '\0') /* No more entries??? */ break; } diff --git a/src/windows/gss/gss.rc b/src/windows/gss/gss.rc index f7c829d07..9fdffefad 100644 --- a/src/windows/gss/gss.rc +++ b/src/windows/gss/gss.rc @@ -14,13 +14,13 @@ gss ICON gss.ico -OPENGSSAPIDLG DIALOG 63, 65, 175, 51 +OPENGSSAPIDLG DIALOG 63, 65, 303, 51 STYLE DS_ABSALIGN | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU CAPTION "Open GSSAPI Connection" FONT 8, "MS Sans Serif" BEGIN CONTROL "To Host:", -1, "STATIC", NOT WS_GROUP, 3, 10, 33, 10 - CONTROL "", GSS_CONNECT_NAME, "COMBOBOX", CBS_DROPDOWN | WS_VSCROLL | WS_GROUP | WS_TABSTOP, 42, 9, 128, 60 + CONTROL "", GSS_CONNECT_NAME, "COMBOBOX", CBS_DROPDOWN | WS_VSCROLL | WS_GROUP | WS_TABSTOP, 42, 9, 256, 60 CONTROL "Test", GSS_OK, "BUTTON", WS_GROUP | WS_TABSTOP | BS_DEFPUSHBUTTON, 27, 30, 51, 14 CONTROL "Exit", GSS_CANCEL, "BUTTON", WS_TABSTOP, 97, 30, 51, 14 END -- 2.26.2