Bug fixes or better error handling for the following 4 Windows bugs
authorKeith Vetter <keithv@fusion.com>
Thu, 6 Apr 1995 03:49:47 +0000 (03:49 +0000)
committerKeith Vetter <keithv@fusion.com>
Thu, 6 Apr 1995 03:49:47 +0000 (03:49 +0000)
(note, these changes haven't yet been tested on the PC which were
failing so no guarantee that they fully work):

a) GUI to cns improved so that you don't need a resize for the widgets to
   align properly, and so the interaction of typing: "username cr password
   cr" is all you need to do to get you a ticket.

b) cns uses krb5_us_gettimeofday instead of krb5_timeofday because the
   former is more accurate and handles timezones.  Probably should make
   the latter just call the former.

c) Added SOCKET_INIT and SOCKET_DESTROY around krb5_sendto_kdc to prevent
   some tcp/ip stacks from locking up after 8 uses.

d) Added a new error message and better error handling to give more
   precision as to why one PC was getting the error 'Cannot find KDC
   for requested realm.'

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5342 dc483132-0cff-0310-8789-dd5450dbe970

26 files changed:
src/include/krb5/ChangeLog
src/include/krb5/base-defs.h
src/include/krb5/func-proto.h
src/include/krb5/los-proto.h
src/lib/ChangeLog
src/lib/krb5/error_tables/ChangeLog
src/lib/krb5/error_tables/krb5_err.et
src/lib/krb5/os/ChangeLog
src/lib/krb5/os/get_krbhst.c
src/lib/krb5/os/locate_kdc.c
src/lib/krb5/os/sendto_kdc.c
src/lib/libkrb5.def
src/util/et/ChangeLog
src/util/et/com_err.h
src/windows/changelo
src/windows/cns/changelo
src/windows/cns/cns.c
src/windows/cns/cns.def
src/windows/cns/cns.h
src/windows/cns/cns.rc
src/windows/readme
src/windows/wintel/changelo
src/windows/wintel/dialog.h
src/windows/wintel/screen.c
src/windows/wintel/screen.h
src/windows/wintel/telnet.rc

index fd6533dea58ad2cead8a84858003c3f8880bec14..bdafb01f66a276da9d9ed4dd59b57553fe8203c0 100644 (file)
@@ -1,3 +1,11 @@
+Wed Apr 5 16:41:41 1995 Keith Vetter (keithv@fusion.com)
+
+       * los-proto.h, func-proto.h: moved krb5_us_timeofday and 
+           krb5_sname_to_principal from the former to the latter.
+        * base-def.h: added FAR to pointer types for the PC.
+        * func-proto.h: added FAR to pointer types in prototypes but
+           only for functions which are exported.
+
 Fri Mar 31 19:34:47 1995 Keith Vetter (keithv@fusion.com)
 
        * k5-config.h: defined dup to _dup for STDC stuff on Windows
index 77fc54179a235c7007c3bd90ee55790c0ae2b3d6..2929c7cab5d333d893615473e3eb768c288bb9ae 100644 (file)
@@ -57,7 +57,7 @@ typedef krb5_error_code       krb5_magic;
 typedef struct _krb5_data {
     krb5_magic magic;
     int length;
-    char *data;
+    char FAR *data;
 } krb5_data;
 
 /* make const & volatile available without effect */
@@ -70,11 +70,11 @@ typedef struct _krb5_data {
 #endif
 
 #if defined(__STDC__) || defined(HAS_VOID_TYPE)
-typedef        void * krb5_pointer;
-typedef void const * krb5_const_pointer;
+typedef        void FAR * krb5_pointer;
+typedef void const FAR * krb5_const_pointer;
 #else
-typedef char * krb5_pointer;
-typedef char const * krb5_const_pointer;
+typedef char FAR * krb5_pointer;
+typedef char const FAR * krb5_const_pointer;
 #endif
 
 #if defined(__STDC__) || defined(KRB5_PROVIDE_PROTOTYPES)
@@ -98,12 +98,12 @@ typedef char const * krb5_const_pointer;
 typedef struct krb5_principal_data {
     krb5_magic magic;
     krb5_data realm;
-    krb5_data *data;           /* An array of strings */
+    krb5_data FAR *data;               /* An array of strings */
     krb5_int32 length;
     krb5_int32 type;
 } krb5_principal_data;
 
-typedef        krb5_principal_data *krb5_principal;
+typedef        krb5_principal_data FAR * krb5_principal;
 
 /*
  * Per V5 spec on definition of principal types
@@ -123,7 +123,7 @@ typedef     krb5_principal_data *krb5_principal;
 #define KRB5_NT_UID            5
 
 /* constant version thereof: */
-typedef const krb5_principal_data *krb5_const_principal;
+typedef const krb5_principal_data FAR *krb5_const_principal;
 
 #define krb5_princ_realm(context, princ) (&(princ)->realm)
 #define krb5_princ_set_realm(context, princ,value) ((princ)->realm = *(value))
index a28e9d12614463292d8f7fde0c037682aadafbf3..ce1c9280b07e062979c8859c6b6f5e76a4ccb4d6 100644 (file)
@@ -28,7 +28,7 @@
 #define KRB5_FUNC_PROTO__
 
 krb5_error_code INTERFACE krb5_init_context
-       PROTOTYPE((krb5_context *));
+       PROTOTYPE((krb5_context FAR *));
 void INTERFACE krb5_free_context
        PROTOTYPE((krb5_context));
 
@@ -80,8 +80,8 @@ krb5_error_code INTERFACE krb5_get_credentials
        PROTOTYPE((krb5_context,
                   const krb5_flags,
                   krb5_ccache,
-                  krb5_creds *,
-                  krb5_creds **));
+                  krb5_creds FAR *,
+                  krb5_creds FAR * FAR *));
 krb5_error_code        INTERFACE krb5_get_for_creds
        PROTOTYPE((krb5_context,
                   const krb5_cksumtype,
@@ -101,20 +101,20 @@ krb5_error_code INTERFACE krb5_mk_req
                   krb5_data * ));
 krb5_error_code INTERFACE krb5_mk_req_extended
        PROTOTYPE((krb5_context,
-                  krb5_auth_context **,
+                  krb5_auth_context FAR * FAR *,
                   const krb5_flags,
-                  krb5_data *,
-                  krb5_creds *,
-                  krb5_data * ));
+                  krb5_data FAR *,
+                  krb5_creds FAR *,
+                  krb5_data FAR * ));
 krb5_error_code INTERFACE krb5_mk_rep
        PROTOTYPE((krb5_context,
                   krb5_auth_context *,
                   krb5_data *));
 krb5_error_code INTERFACE krb5_rd_rep
        PROTOTYPE((krb5_context,
-                  krb5_auth_context *,
-                  const krb5_data *,
-                  krb5_ap_rep_enc_part **));
+                  krb5_auth_context FAR *,
+                  const krb5_data FAR *,
+                  krb5_ap_rep_enc_part FAR * FAR *));
 krb5_error_code INTERFACE krb5_mk_error
        PROTOTYPE((krb5_context,
                   const krb5_error *,
@@ -137,12 +137,12 @@ krb5_error_code INTERFACE krb5_rd_priv
                   krb5_replay_data *));
 krb5_error_code INTERFACE krb5_parse_name
        PROTOTYPE((krb5_context,
-                  const char *,
-                  krb5_principal * ));
+                  const char FAR *,
+                  krb5_principal FAR * ));
 krb5_error_code INTERFACE krb5_unparse_name
        PROTOTYPE((krb5_context,
                   krb5_const_principal,
-                  char ** ));
+                  char FAR * FAR * ));
 krb5_error_code INTERFACE krb5_unparse_name_ext
        PROTOTYPE((krb5_context,
                   krb5_const_principal,
@@ -222,7 +222,7 @@ krb5_error_code INTERFACE krb5_get_server_rcache
        PROTOTYPE((krb5_context,
                   const krb5_data *, krb5_rcache *));
 krb5_error_code INTERFACE_C krb5_build_principal_ext
-       STDARG_P((krb5_context, krb5_principal *, int, const char *, ...));
+       STDARG_P((krb5_context, krb5_principal FAR *, int, const char FAR *, ...));
 krb5_error_code INTERFACE_C krb5_build_principal
        STDARG_P((krb5_context, krb5_principal *, int, const char *, ...));
 #ifdef va_start
@@ -298,7 +298,7 @@ char * INTERFACE krb5_cc_default_name
        PROTOTYPE((krb5_context));
 krb5_error_code INTERFACE krb5_cc_default
        PROTOTYPE((krb5_context,
-                  krb5_ccache *));
+                  krb5_ccache FAR *));
 unsigned int INTERFACE krb5_get_notification_message
    PROTOTYPE((void));
 
@@ -324,7 +324,7 @@ void INTERFACE krb5_free_authenticator_contents
                   krb5_authenticator * ));
 void INTERFACE krb5_free_addresses
        PROTOTYPE((krb5_context,
-                  krb5_address ** ));
+                  krb5_address FAR * FAR * ));
 void INTERFACE krb5_free_address
        PROTOTYPE((krb5_context,
                   krb5_address * ));
@@ -378,10 +378,10 @@ void INTERFACE krb5_free_cred
          krb5_cred *));
 void INTERFACE krb5_free_creds
        PROTOTYPE((krb5_context,
-                  krb5_creds *));
+                  krb5_creds FAR *));
 void INTERFACE krb5_free_cred_contents
        PROTOTYPE((krb5_context,
-                  krb5_creds *));
+                  krb5_creds FAR *));
 void INTERFACE krb5_free_cred_enc_part
    PROTOTYPE((krb5_context,
          krb5_cred_enc_part *));
@@ -396,7 +396,7 @@ void INTERFACE krb5_free_pa_data
                   krb5_pa_data **));
 void INTERFACE krb5_free_ap_rep_enc_part
        PROTOTYPE((krb5_context,
-                  krb5_ap_rep_enc_part *));
+                  krb5_ap_rep_enc_part FAR *));
 void INTERFACE krb5_free_tkt_authent
        PROTOTYPE((krb5_context,
                   krb5_tkt_authent *));
@@ -408,15 +408,25 @@ void INTERFACE krb5_free_pwd_sequences
          passwd_phrase_element **));
 
 /* From krb5/os but needed but by the outside world */
+krb5_error_code INTERFACE krb5_us_timeofday
+       PROTOTYPE((krb5_context,
+                  krb5_int32 FAR *,
+                  krb5_int32 FAR * ));
 krb5_error_code INTERFACE krb5_timeofday
        PROTOTYPE((krb5_context,
-                  krb5_int32 * ));
+                  krb5_int32 FAR * ));
                 /* get all the addresses of this host */
 krb5_error_code INTERFACE krb5_os_localaddr
-       PROTOTYPE((krb5_address ***));
+       PROTOTYPE((krb5_address FAR * FAR * FAR *));
 krb5_error_code INTERFACE krb5_get_default_realm
        PROTOTYPE((krb5_context,
-                   char ** ));
+                   char FAR * FAR * ));
+krb5_error_code INTERFACE krb5_sname_to_principal
+        PROTOTYPE((krb5_context,
+                  const char FAR *,
+                   const char FAR *,
+                   krb5_int32,
+                   krb5_principal FAR *));
 
 /* Only put things which don't have pointers to the narrow types in this
    section */
@@ -468,13 +478,13 @@ krb5_error_code INTERFACE krb5_get_in_tkt
 krb5_error_code INTERFACE krb5_get_in_tkt_with_password
        PROTOTYPE((krb5_context,
                   const krb5_flags,
-                  krb5_address * const *,
-                  krb5_enctype *,
-                  krb5_preauthtype *,
-                  const char *,
+                  krb5_address FAR * const FAR *,
+                  krb5_enctype FAR *,
+                  krb5_preauthtype FAR *,
+                  const char FAR *,
                   krb5_ccache,
-                  krb5_creds *,
-                  krb5_kdc_rep ** ));
+                  krb5_creds FAR *,
+                  krb5_kdc_rep FAR * FAR * ));
 
 krb5_error_code INTERFACE krb5_get_in_tkt_with_skey
        PROTOTYPE((krb5_context,
@@ -679,8 +689,6 @@ krb5_error_code INTERFACE krb5_auth_con_getremotesubkey
          krb5_auth_context *,
          krb5_keyblock **));
 
-
-
 #define KRB5_REALM_BRANCH_CHAR '.'
 
 #endif /* KRB5_FUNC_PROTO__ */
index f66170e8fcfaa40d5a205edf688ff7d13557c52d..202f6a1400bcfc57b431fd87ca4df8e2d09177be 100644 (file)
@@ -50,10 +50,6 @@ krb5_error_code INTERFACE krb5_unlock_file
        PROTOTYPE((krb5_context,
                   FILE *,
                   char * ));
-krb5_error_code INTERFACE krb5_us_timeofday
-       PROTOTYPE((krb5_context,
-                  krb5_int32 *,
-                  krb5_int32 * ));
 int INTERFACE krb5_net_read
        PROTOTYPE((krb5_context,
                   int ,
@@ -125,13 +121,6 @@ krb5_error_code INTERFACE krb5_write_message
                   krb5_pointer, 
                   krb5_data *));
 
-krb5_error_code INTERFACE krb5_sname_to_principal
-        PROTOTYPE((krb5_context,
-                  const char *,
-                   const char *,
-                   krb5_int32,
-                   krb5_principal *));
-
 krb5_error_code INTERFACE krb5_os_init_context
         PROTOTYPE((krb5_context));
 
index 6dd26c2a6db850671c79f99ee28ccec782c65adb..5bb0712bb96bfed85c2f44d803d3ddf7233af5fb 100644 (file)
@@ -1,3 +1,7 @@
+Wed Apr 5 16:27:53 1995 Keith Vetter (keithv@fusion.com)
+
+       * libkrb5.def: added krb5_us_timeofday to export list
+
 Fri Mar 31 16:15:59 1995  Theodore Y. Ts'o  (tytso@dcl)
 
        * Makefile.in, configure.in: Move the dependency which causes
index 49562dc95985336f43e881fc8fd318fc3537e77a..8938b0daa7efa1f5eaa5c92b5ce06490dcee7815 100644 (file)
@@ -1,3 +1,8 @@
+Wed Apr 5 16:29:25 1995 Keith Vetter (keithv@fusion.com)
+
+       * krb5_err.et: added KRB5_REALM_CANT_RESOLVE for more precise 
+           handling of not finding KDC.
+
 Fri Mar 31 16:06:21 1995  Theodore Y. Ts'o  (tytso@dcl)
 
        * Makefile.in (BUILDTOP2, etc): Back out previous change so that
index 9e7b3a15c847e06bf85cf4dfa0142e74b7362f14..1be16712f80330690bd0134b3d23ba59e5cce0a4 100644 (file)
@@ -290,4 +290,5 @@ error_code KRB5_ERR_HOST_REALM_UNKNOWN,     "Cannot determine realm for host"
 error_code KRB5_SNAME_UNSUPP_NAMETYPE, "Conversion to service principal undefined for name type"
 
 error_code KRB5KRB_AP_ERR_V4_REPLY, "Initial Ticket response appears to be Version 4 error"
+error_code KRB5_REALM_CANT_RESOLVE,    "Cannot resolve KDC for requested realm"
 end
index 0571ee818542949ac6585a3628ef7cea016c0314..58e9fe6453b41296f6a81943a7e125e41bf01b8c 100644 (file)
@@ -1,3 +1,13 @@
+Wed Apr 5 16:32:07 1995 Keith Vetter (keithv@fusion.com)
+
+       * get_krbh.c: better error handling--old return values were 
+           being overwritten.
+        * locate_kdc.c: added new error code KRB5_REALM_CANT_RESOLVE for
+           when we have realm names but can't find their addresses.
+           Also, fixed up indenting of an if clause.
+        * sendto_kdc.c: added winsock init/destroy calls because some
+            PC tcp/ip stacks seem to need it.
+
 Fri Mar 31 16:30:03 1995  Theodore Y. Ts'o  (tytso@dcl)
 
        * realm_dom.c (krb5_get_realm_domain): Don't indent #ifdef's!
index 0a02a3805401f0f0b2112096c0140eb0847ebed9..d41b80a37bbd08e0179f9cb1a39a96787dba746f 100644 (file)
@@ -85,7 +85,10 @@ krb5_get_krbhst(context, realm, hostlist)
     else {
        retval = 0;
        rethlist = (char **)calloc(hlsize, sizeof (*rethlist));
-       for (;;) {
+        if (rethlist == NULL)
+            retval = ENOMEM;
+
+       while (retval == 0) {
            if (fgets(filebuf, sizeof(filebuf), config_file) == NULL)
                break;
            if (strncmp(filebuf, realm->data, realm->length))
@@ -144,7 +147,8 @@ krb5_get_krbhst(context, realm, hostlist)
     if (hlindex == 0) {
        krb5_xfree(rethlist);
        rethlist = 0;
-       retval = KRB5_REALM_UNKNOWN;
+        if (retval == 0)
+           retval = KRB5_REALM_UNKNOWN;
     }
     *hostlist = rethlist;
 
index e9ef69b099c4b7638f39460f6d2675fccb84ab19..61abc2cef1835d649b022d37bd704a25d50ec2a4 100644 (file)
@@ -97,33 +97,34 @@ krb5_locate_kdc(context, realm, addr_pp, naddrs)
            switch (hp->h_addrtype) {
 #ifdef KRB5_USE_INET
            case AF_INET:
-               if (udpport)            /* must have gotten a port # */
-               for (j=0; hp->h_addr_list[j]; j++) {
-                   sin_p = (struct sockaddr_in *) &addr_p[out++];
-                   memset ((char *)sin_p, 0, sizeof(struct sockaddr));
-                   sin_p->sin_family = hp->h_addrtype;
-                   sin_p->sin_port = udpport;
-                   memcpy((char *)&sin_p->sin_addr,
-                          (char *)hp->h_addr_list[j],
-                          sizeof(struct in_addr));
-                   if (out >= count) {
-                       count *= 2;
-                       addr_p = (struct sockaddr *)
-                           realloc ((char *)addr_p,
-                                    sizeof(struct sockaddr) * count);
-                   }
-                   if (sec_udpport) {
-                       addr_p[out] = addr_p[out-1];
-                       sin_p = (struct sockaddr_in *) &addr_p[out++];
-                       sin_p->sin_port = sec_udpport;
-                       if (out >= count) {
+               if (udpport) {          /* must have gotten a port # */
+                   for (j=0; hp->h_addr_list[j]; j++) {
+                       sin_p = (struct sockaddr_in *) &addr_p[out++];
+                       memset ((char *)sin_p, 0, sizeof(struct sockaddr));
+                       sin_p->sin_family = hp->h_addrtype;
+                       sin_p->sin_port = udpport;
+                       memcpy((char *)&sin_p->sin_addr,
+                              (char *)hp->h_addr_list[j],
+                              sizeof(struct in_addr));
+                       if (out >= count) {
                            count *= 2;
                            addr_p = (struct sockaddr *)
-                                   realloc ((char *)addr_p,
-                                            sizeof(struct sockaddr) * count);
-                       }
+                               realloc ((char *)addr_p,
+                                        sizeof(struct sockaddr) * count);
+                       }
+                       if (sec_udpport) {
+                           addr_p[out] = addr_p[out-1];
+                           sin_p = (struct sockaddr_in *) &addr_p[out++];
+                           sin_p->sin_port = sec_udpport;
+                           if (out >= count) {
+                               count *= 2;
+                               addr_p = (struct sockaddr *)
+                                       realloc ((char *)addr_p,
+                                                sizeof(struct sockaddr) * count);
+                           }
+                       }
                    }
-               }
+                }
                break;
 #endif
            default:
@@ -134,11 +135,12 @@ krb5_locate_kdc(context, realm, addr_pp, naddrs)
        hostlist[i] = 0;
     }
     free ((char *)hostlist);
-                               /*
-                                * XXX need to distinguish between
-                                * "can't resolve KDC name" and
-                                * "can't find any KDC names"
-                                */
+
+    if (out == 0) {     /* Couldn't resolve any KDC names */
+        free (addr_p);
+        return KRB5_REALM_CANT_RESOLVE;
+    }
+
     *addr_pp = addr_p;
     *naddrs = out;
     return 0;
index 0a534b356eb5a0b29a0b8ee881a5379ef1821286..f4fffee9ba8fa68e27ceabf12b3a56f40fc26534 100644 (file)
@@ -85,7 +85,6 @@ krb5_sendto_kdc (context, message, realm, reply)
     socklist = (SOCKET *)malloc(naddr * sizeof(SOCKET));
     if (socklist == NULL) {
        krb5_xfree(addr);
-       krb5_xfree(socklist);
        return ENOMEM;
     }
     for (i = 0; i < naddr; i++)
@@ -98,6 +97,13 @@ krb5_sendto_kdc (context, message, realm, reply)
     }
     reply->length = krb5_max_dgram_size;
 
+    if (SOCKET_INITIALIZE()) {  /* PC needs this for some tcp/ip stacks */
+       krb5_xfree(addr);
+       krb5_xfree(socklist);
+       free(reply->data);
+        return SOCKET_ERRNO;
+    }
+
     /*
      * do exponential backoff.
      */
@@ -197,6 +203,7 @@ krb5_sendto_kdc (context, message, realm, reply)
     }
     retval = KRB5_KDC_UNREACH;
  out:
+    SOCKET_CLEANUP();                           /* Done with sockets for now */
     for (i = 0; i < naddr; i++)
        if (socklist[i] != INVALID_SOCKET)
            (void) closesocket (socklist[i]);
index 3afbd0c4aa0c84e8246f3cff83929cd3e700f8f7..7f668c6182f17c7b57a974ec4acaf3e529fdddeb 100644 (file)
@@ -31,6 +31,7 @@ EXPORTS
        KRB5_RD_REP
        KRB5_SNAME_TO_PRINCIPAL
        KRB5_TIMEOFDAY
+       KRB5_US_TIMEOFDAY
        KRB5_UNPARSE_NAME
 ;Com_err routines
         _com_err
index dc7212715e02139357aea54b29c9da40a4ff4e17..ea43dcd247e5e0ed73de882c2632c9cf75d8cc29 100644 (file)
@@ -1,3 +1,7 @@
+Wed Apr 5 16:25:35 1995 Keith Vetter (keithv@fusion.com)
+
+       * com_err.h: added FAR to pointers in prototypes.
+
 Wed Mar 29 08:56:47 1995  John Gilmore  (gnu at toad.com)
 
        * Makefile.in:  Fix up Mac makefile.
index e85965573dd3fcec438d56a86c8185f3da056bf4..749ee05d99274bfcf2184c19dbae97b6f31974c6 100644 (file)
@@ -41,8 +41,8 @@
 
 #if defined(__STDC__) || defined(_WINDOWS)
 /* ANSI C -- use prototypes etc */
-extern void INTERFACE_C com_err (const char *, long, const char *, ...);
-extern char const * INTERFACE error_message (long);
+extern void INTERFACE_C com_err (const char FAR *, long, const char FAR *, ...);
+extern char const FAR * INTERFACE error_message (long);
 extern void (*com_err_hook) (const char *, long, const char *, va_list);
 extern void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list)))
     (const char *, long, const char *, va_list);
index cbd9f7b202ba118ada8b12595a2f91d3861d1d7a..73fb984faa221c2a648e9d942d0389864a581b3d 100644 (file)
@@ -1,3 +1,7 @@
+Wed Apr 5 16:14:49 1995 Keith Vetter (keithv@fusion.com)
+
+       * readme: updated about realms, conf files and telnet port.
+
 Tue Mar 28 12:00:00  1995 Keith Vetter (keithv@fusion.com)
 
        * ChangeLog renamed to changelo to avoid having to always rename it.
index a2d9b87e6ff72f62e5613624f9b75a5b51941ba9..eb98d9a9062b19265cbea598162cfaef13ebd013 100644 (file)
@@ -1,3 +1,12 @@
+Wed Apr 5 16:01:16 1995 Keith Vetter (keithv@fusion.com)
+
+       * cns.h, cns.rc, cns.c: GUI changes: re-order and resize
+           edit boxes, add hidden button for better CR handling.
+        * cns.c: used krb5_us_timeofday instead of krb5_timeofday
+           for timezone/clock skew fix (not tested by tytso yet).
+        * cns.c: added password changing stub with correct interface.
+        * cns.def: changed kwin to cns as the name of the program.
+
 Fri Mar 31 16:47:18 1995 Keith Vetter (keithv@fusion.com)
 
        * cns.c: realms file was not getting saved properly.
index fbf5cd10e1a6b95b8ed1dff17c2666b8864dbcdb..97b4b6bdb948f572cb20f7d5742097be54f06a22 100644 (file)
@@ -235,7 +235,7 @@ position_dialog (
                x + cx < 0 ||
                y + cy < 0)
                center_dialog(hwnd);
-       else
+    else
                MoveWindow(hwnd, x, y, cx, cy, TRUE);
 
 } /* position_dialog */
@@ -492,12 +492,45 @@ change_password (
 #endif
 
 #ifdef KRB5     /* FIXME */
-    MessageBox (NULL, "Changing passwords is not yet implemented", "", MB_ICONEXCLAMATION);
-       return TRUE;
+    char *msg;                                  // Message string
+    krb5_error_code code;                       // Return value
+
+    krb5_error_code //FIXME INTERFACE
+    krb5_change_password(
+          krb5_context context,
+          char *user,
+          char *realm,
+          char *old_password,
+          char *new_password,
+       char **text);
+
+    code = krb5_change_password (k5_context, name, realm, oldpw, newpw, &msg);
+
+    if (msg != NULL) {
+        MessageBox (NULL, msg, NULL, MB_ICONEXCLAMATION);
+        //WHO FREES THIS SPACE??? free (msg);
+    } else if (code)
+        com_err (NULL, code, "while changing password.");
+
+       return (code == 0);
 #endif
 
 } /* change_password */
-
+/*+*/
+#ifdef KRB5
+krb5_error_code //FIXME INTERFACE
+krb5_change_password(
+    krb5_context context,
+       char *user,
+       char *realm,
+       char *old_password,
+       char *new_password,
+    char **text)
+{
+    *text = "Changing passwords is not yet implemented";
+    return -1;
+}
+#endif /* KRB5 */
 /*+
  * Function: Process WM_COMMAND messages for the password dialog.
  *
@@ -1847,6 +1880,7 @@ kwin_command (
        HMENU hmenu;
        char menuitem[MAX_K_NAME_SZ + 3];
        char copyright[128];
+       int id;
        #ifdef KRB4
         char instance[INST_SZ];
         int lifetime;
@@ -1859,6 +1893,7 @@ kwin_command (
                krb5_creds creds;
                krb5_principal server;
                krb5_timestamp now;
+        krb5_int32 sec, usec;
        #endif
 
        #ifdef KRB4
@@ -1885,6 +1920,8 @@ kwin_command (
        }
 
        EnableWindow(GetDlgItem(hwnd, IDD_LOGIN), blogin);
+    id = (blogin) ? IDD_LOGIN : IDD_PASSWORD_CR2;
+    SendMessage(hwnd, DM_SETDEFID, id, 0);
 
        if (HIWORD(lparam) != BN_CLICKED && HIWORD(lparam) != 0 && HIWORD(lparam) != 1)
                return FALSE;
@@ -1914,6 +1951,18 @@ kwin_command (
 
                return TRUE;
 
+    case IDD_PASSWORD_CR2:                      // Make CR == TAB
+               id = GetDlgCtrlID(GetFocus());
+               assert(id != 0);
+
+               if (id == IDD_MAX_EDIT)
+                       PostMessage(hwnd, WM_NEXTDLGCTL,
+                               GetDlgItem(hwnd, IDD_MIN_EDIT), MAKELONG(1, 0));
+               else
+                       PostMessage(hwnd, WM_NEXTDLGCTL, 0, 0);
+
+        return TRUE;
+
        case IDD_LOGIN:
                if (isblocking)
                        return TRUE;
@@ -1964,8 +2013,14 @@ kwin_command (
                        creds.client = principal;
                        creds.server = server;
 
-                code = krb5_timeofday(k5_context, &now);
+                //code = krb5_timeofday(k5_context, &now);
+                //if (code) break;
+                code = krb5_us_timeofday(k5_context, &sec, &usec);
                 if (code) break;
+//if (labs(now-sec) > 60*60) {            // Off by more than an hour
+//    MessageBox (NULL, "DEBUG: timeofday != us_timeofday", NULL, 0);
+//    now = sec;
+//}
                 creds.times.starttime = 0;
                        creds.times.endtime = now + 60L * lifetime;
                        creds.times.renew_till = 0;
index d0f2032c73fa17d2cc7c8f632db4888626cb46df..01fd7f5eac24060f163a8aad9408649acf10ed9e 100644 (file)
@@ -1,9 +1,9 @@
-NAME KWIN
-DESCRIPTION 'KWIN'
-EXETYPE WINDOWS
-STUB 'WINSTUB.EXE'
+NAME            CNS
+DESCRIPTION     'CNS - Cygnus Network Security'
+EXETYPE         WINDOWS
+STUB            'WINSTUB.EXE'
 SEGMENTS _TEXT CLASS 'CODE' PRELOAD
-CODE DISCARDABLE
+CODE            DISCARDABLE
 DATA PRELOAD MULTIPLE MOVEABLE
 HEAPSIZE 20480
 STACKSIZE 20480
index 7579400b8ac7f09c26d961e630c34c7c813b5ed4..1508c09e185d7263d71f1862b623485aa82b3d56 100644 (file)
 
           #define IDD_MIN_TITLE 103
                   #define IDD_LOGIN_NAME_TITLE 103
-                  #define IDD_LOGIN_REALM_TITLE 104
-                  #define IDD_LOGIN_PASSWORD_TITLE 105
+                  #define IDD_LOGIN_PASSWORD_TITLE 104
+                  #define IDD_LOGIN_REALM_TITLE 105
           #define IDD_MAX_TITLE 105
 
           #define IDD_MIN_EDIT 107
                   #define IDD_LOGIN_NAME 107
-                  #define IDD_LOGIN_REALM 108
-                  #define IDD_LOGIN_PASSWORD 109
+                  #define IDD_LOGIN_PASSWORD 108
+                  #define IDD_LOGIN_REALM 109
           #define IDD_MAX_EDIT 109
 
    #endif
@@ -76,8 +76,9 @@
                #define IDD_TICKET_DELETE 112
                #define IDD_LOGIN 113
        #define IDD_MAX_BUTTON 113
+       #define IDD_PASSWORD_CR2 114                 // For better cr handling
 
-       #define IDD_KWIN_LAST 113
+       #define IDD_KWIN_LAST 114
 
 
 #define ID_PASSWORD 200
index 55137252d542e7d5712aa5787eb318a14f7b9889..1a49e2a48f3b7ff7a294def35d976eedab058caa 100644 (file)
@@ -61,15 +61,16 @@ BEGIN
    #endif
    #ifdef KRB5
           CONTROL "&Name", IDD_LOGIN_NAME_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 6, 69, 27, 8
-       CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 140, 69, 26, 8
-          CONTROL "&Password", IDD_LOGIN_PASSWORD_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 207, 69, 36, 8
-       CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 62, 12
-          CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 73, 79, 62, 12
-       CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 207, 79, 62, 12
+          CONTROL "&Password", IDD_LOGIN_PASSWORD_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 95, 69, 36, 8
+       CONTROL "&Realm", IDD_LOGIN_REALM_TITLE, "STATIC", SS_LEFT | WS_CHILD | WS_VISIBLE | WS_GROUP, 184, 69, 26, 8
+       CONTROL "", IDD_LOGIN_NAME, "EDIT", ES_LEFT | ES_AUTOHSCROLL | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 6, 79, 84, 12
+       CONTROL "", IDD_LOGIN_PASSWORD, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_PASSWORD | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 95, 79, 84, 12
+          CONTROL "", IDD_LOGIN_REALM, "EDIT", ES_LEFT | ES_AUTOHSCROLL | ES_UPPERCASE | WS_CHILD | WS_VISIBLE | WS_BORDER | WS_TABSTOP, 184, 79, 84, 12
    #endif
        CONTROL "&Change Password...", IDD_CHANGE_PASSWORD, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 6, 96, 74, 14
        CONTROL "&Delete", IDD_TICKET_DELETE, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 122, 96, 52, 14
        CONTROL "&Login", IDD_LOGIN, "BUTTON", BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_TABSTOP, 216, 96, 52, 14
+   CONTROL "", IDD_PASSWORD_CR2, "BUTTON", BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE, 5000, 5000, 0, 0
 END
 
 #ifdef KRB4
index 6a34620948e5cd02d2f6e8fd1c7405820cf4d063..7c1e5846a6407ff479aec69cba0f54bf52606335 100644 (file)
@@ -19,15 +19,10 @@ On the PC side
 4) nmake -c -f makefile.in             # Configures the makefiles and runs
                                        # ...make in all the subdirectories.
 5) <make sure the config and realms files, krb.con and krb.rea, 
-    are in the top level directory.>
+    are in the windows directory.>
 
 The resulting interesting files will be:
 lib/libkrb5.dll                        # The actual DLL
 lib/libkrb5.lib                        # The library for linking in the DLL
 windows/cns/cns.exe                    # Cygnus Network Security program
 windows/wintel/telnet                  # K5 authenticated telnet program
-
-Note on telnet: since the only k5 telnet daemon at this time is 
-tsx-11.mit.edu port 13131, the port the program connects to is
-hardwired for now to 13131.
-
index 34b6ed30d75e2ecb45fdcacb37cbd318382cbeda..f903d1045f6850ed9e92d8666f4d665d0fd6dd94 100644 (file)
@@ -1,3 +1,8 @@
+Wed Apr 5 16:18:30 1995 Keith Vetter (keithv@fusion.com)
+
+       * screen.c, screen.h, dialog.h, telnet.rc: added an about 
+           box with version number.
+
 Fri Mar 31 16:24:52 1995 Keith Vetter (keithv@fusion.com)
 
        * telnet.c, wt-proto.h: added command line option to set port number
index da4790f74fbe59afb646c7549b2cc74b10e7c57d..cfec5928a15bff9b5e99ea992ebf128bb99b70b0 100644 (file)
@@ -1,4 +1,3 @@
-#define IDM_ABOUT 100
 #define IDM_SHOWCONSOLE 700
 
 #define IDM_OPENTELNETDLG           200
index 2f12ad00c362aaff0eca6b1d24013f96839e3a00..6842b75c9e219433690952b4255eff6fec1e19f7 100644 (file)
@@ -2,7 +2,7 @@
 #include <commdlg.h>
 #include <stdlib.h>
 #include <string.h>
-#include "screen.h"
+#include "telnet.h"
 #include "ini.h"
 
 extern char *cInvertedArray;
@@ -759,6 +759,19 @@ LPARAM lParam;                  /* additional information          */
         case IDM_PASTE:
             Edit_Paste(hWnd);
             break;
+       case IDM_ABOUT:
+               #ifdef KRB4
+                       strcpy(strTmp, "        Kerberos 4 for Windows\n");
+            #endif
+            #ifdef KRB5
+                strcpy(strTmp, "        Kerberos 5 for Windows\n");
+            #endif
+            strcat(strTmp, "\n                Version 1.00\n\n");
+            strcat(strTmp, "          For support, contact:\n");
+            strcat(strTmp, "Cygnus Support");
+            strcat(strTmp, " - (415) 903-1400");
+            MessageBox(NULL, strTmp, "Kerberos", MB_OK);
+            break;
 #ifdef _DEBUG
                case IDM_DEBUG:
                        CheckScreen(fpScr);
index edc4d13687e27b87de0f7ad31c819b6a6d2b4a5b..7a472436f241f26cde6c1aacdbb5d474eb4e94c3 100644 (file)
@@ -127,6 +127,7 @@ typedef struct CONFIG {
 #define IDM_FONT        100
 #define IDM_BACKSPACE   101
 #define IDM_DELETE      102
+#define IDM_ABOUT       103
 
 #define IDM_COPY        200
 #define IDM_PASTE       201
index bcdcdb56930fa1ec5b276e6cafcfcb532f613c2c..cbe082578ba1d14be3cd099de85f0a7d3a6d9ce6 100644 (file)
@@ -14,6 +14,7 @@ BEGIN
                MENUITEM "&Delete", IDM_DELETE
                MENUITEM SEPARATOR
                MENUITEM "&Font...", IDM_FONT
+               MENUITEM "&About...", IDM_ABOUT
        END
        POPUP "&Edit"
        BEGIN