* conv_creds.c (broken, krb524_convert_creds_plain): Unused code deleted
authorKen Raeburn <raeburn@mit.edu>
Thu, 26 Apr 2001 11:15:12 +0000 (11:15 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 26 Apr 2001 11:15:12 +0000 (11:15 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13208 dc483132-0cff-0310-8789-dd5450dbe970

src/krb524/ChangeLog
src/krb524/Makefile.in
src/krb524/configure.in
src/krb524/conv_creds.c
src/krb524/krb524d.c

index 593ff68660c74c295ce831d619f3b2200946d09f..c11fea0f2aa2626f3bb12e9819055ef529bb06d2 100644 (file)
@@ -1,5 +1,8 @@
 2001-04-26  Ken Raeburn  <raeburn@mit.edu>
 
+       * conv_creds.c (broken, krb524_convert_creds_plain): Unused code
+       deleted.
+
        * sendmsg.c (krb524_sendto_kdc): Updated to use new
        krb5int_locate_server function, via internals-accessor hook.
 
index b49587b253c822d615409354055383dd7f578e02..912d2f43ff30534dad10b45c7464ff209113923a 100644 (file)
@@ -129,3 +129,11 @@ clean-unix:: clean-libs clean-libobjs
 
 $(KRB524_HDR): krb524.h
        $(CP) krb524.h $@
+
+PROG_LIBPATH=-L$(TOPLIBD) $(TCL_LIBPATH)
+PROG_RPATH=$(KRB5_LIBDIR)$(TCL_RPATH)
+
+tcltest: tcltest.o $(KRB524_DEPLIB) $(KRB4COMPAT_DEPLIBS)
+       $(CC_LINK) -o tcltest tcltest.o $(KRB524_LIB) $(KRB4COMPAT_LIBS) \
+               $(TCL_LIBS)
+tcltest.o: tcltest.c
index eca1642cdb0c58a2054e5f64ca13aa079ed043cc..96fbc51008045949d85a03b3335c974315dc73ed 100644 (file)
@@ -4,6 +4,7 @@ AC_PROG_INSTALL
 KRB5_BUILD_LIBRARY_STATIC
 KRB5_BUILD_LIBOBJS
 AC_PROG_AWK
+AC_KRB5_TCL
 AC_CHECK_HEADERS(sys/select.h) dnl
 AC_TYPE_SIGNAL
 
index c1e4b89a356bd48df4f2326560ae498096a58ad5..2834bb42af7e57c5ceae258612a7e4965bda2dea 100644 (file)
@@ -80,52 +80,12 @@ fail:
      return ret;
 }
 
-#if 0
-int broken()
-{
-     if ((ret = krb5_locate_kdc(context, &v5creds->server->realm, &addrs,
-                              &naddrs)))
-         return ret;
-     if (naddrs == 0)
-         ret = KRB5_KDC_UNREACH;
-     else {
-          for (i = 0; i<naddrs; i++) {
-           addrs[i].sin_port = 0; /* use krb524 default port */
-           ret = krb524_convert_creds_addr(context, v5creds, v4creds,
-                                           (struct sockaddr *) &addrs[i]);
-           /* stop trying on success */
-           if (!ret) break;
-           switch(ret) {
-           case ECONNREFUSED:
-           case ENETUNREACH:
-           case ENETDOWN:
-           case ETIMEDOUT:
-           case EHOSTDOWN:
-           case EHOSTUNREACH:
-           case KRB524_NOTRESP:
-             continue;
-           default:
-             break;            /* out of switch */
-           }
-           /* if we fall through to here, it wasn't an "ok" error */
-           break;
-         }
-     }
-     
-     free(addrs);
-     return ret;
-}
-#endif
-
 krb5_error_code
 krb524_convert_creds_plain(context, v5creds, v4creds)
      krb5_context context;
      krb5_creds *v5creds;
      CREDENTIALS *v4creds;
 {
-#if 0
-     krb5_ui_4 addr;
-#endif
      int ret;
      krb5_timestamp endtime;
      char dummy[REALM_SZ];
@@ -162,19 +122,5 @@ krb524_convert_creds_plain(context, v5creds, v4creds)
      if (endtime > v5creds->times.endtime)
         v4creds->issue_date -= endtime - v5creds->times.endtime;
 
-#if 0
-     /* XXX perhaps we should use the addr of the client host if */
-     /* v5creds contains more than one addr.  Q: Does V4 support */
-     /* non-INET addresses? */
-     if (!v5creds->addresses || !v5creds->addresses[0] ||
-        v5creds->addresses[0]->addrtype != ADDRTYPE_INET ||
-        v5creds->addresses[0]->length != sizeof(addr)) {
-         if (krb524_debug)
-              fprintf(stderr, "Invalid v5creds address information.\n");
-         return KRB524_BADADDR;
-     } else
-         memcpy((char *) &addr, v5creds->addresses[0]->contents,
-                sizeof(addr));
-#endif
      return 0;
 }
index ab3d038b927622e1171586e56ff652b6c6b2bafc..80c55054482aa8378a13a44b8835e5452065d3fd 100644 (file)
@@ -65,7 +65,7 @@ krb5_error_code  kdc_get_server_key(krb5_context, krb5_principal,
 static void usage(context)
      krb5_context context;
 {
-     fprintf(stderr, "Usage: %s [-k[eytab]] [-m[aster] [-r realm]] [-nofork]\n", whoami);
+     fprintf(stderr, "Usage: %s [-k[eytab]] [-m[aster] [-r realm]] [-nofork] [-p portnum]\n", whoami);
      cleanup_and_exit(1, context);
 }
 
@@ -99,6 +99,7 @@ int main(argc, argv)
      krb5_context context;
      krb5_error_code retval;
      kadm5_config_params config_params;
+     int port = 0;
 
      retval = krb5_init_context(&context);
      if (retval) {
@@ -126,6 +127,14 @@ int main(argc, argv)
               config_params.mask |= KADM5_CONFIG_REALM;
               config_params.realm = *argv;
          }
+         else if (strcmp(*argv, "-p") == 0) {
+             argv++; argc--;
+             if (argc == 0)
+                 usage (context);
+             port = atoi (*argv);
+             if (port <= 0 || port > 65535)
+                 usage (context);
+         }
          else
               break;
          argv++; argc--;
@@ -148,12 +157,16 @@ int main(argc, argv)
      memset((char *) &saddr, 0, sizeof(struct sockaddr_in));
      saddr.sin_family = AF_INET;
      saddr.sin_addr.s_addr = INADDR_ANY;
-     serv = getservbyname(KRB524_SERVICE, "udp");
-     if (serv == NULL) {
-         com_err(whoami, 0, "service entry not found, using %d", KRB524_PORT);
-         saddr.sin_port = htons(KRB524_PORT);
+     if (port == 0) {
+        serv = getservbyname(KRB524_SERVICE, "udp");
+        if (serv == NULL) {
+            com_err(whoami, 0, "service entry not found, using %d",
+                    KRB524_PORT);
+            saddr.sin_port = htons(KRB524_PORT);
+        } else
+            saddr.sin_port = serv->s_port;
      } else
-         saddr.sin_port = serv->s_port;
+        saddr.sin_port = htons(port);
          
      if ((s = socket(AF_INET, SOCK_DGRAM, 0)) < 0) {
          com_err(whoami, errno, "creating main socket");