Added support for users to enter the GSSAPI target name into the
authorTheodore Tso <tytso@mit.edu>
Thu, 29 Feb 1996 06:25:11 +0000 (06:25 +0000)
committerTheodore Tso <tytso@mit.edu>
Thu, 29 Feb 1996 06:25:11 +0000 (06:25 +0000)
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
src/windows/gss/gss.c
src/windows/gss/gss.rc

index 60ae643f7cdd4d8bc07bfb7fd4717666369f7641..aa59ceea9c26d800b18d7a98fd228cc0cdcafa45 100644 (file)
@@ -1,3 +1,10 @@
+Thu Feb 29 01:23:01 1996  Theodore Y. Ts'o  <tytso@dcl>
+
+       * 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.
index ea7782f093a9c7a5ee11c2b5329d01b1943069c2..4b56e1e7727607dbe55c885e10ddc95132461b57 100644 (file)
 #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;
        }
 
index f7c829d0744d1f63bc73cb74f67edeb8e183f036..9fdffefad612bf47b3139bb2481a62d1bd5f74be 100644 (file)
 
 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