From: Ken Raeburn Date: Thu, 26 Apr 2001 11:15:12 +0000 (+0000) Subject: * conv_creds.c (broken, krb524_convert_creds_plain): Unused code deleted X-Git-Tag: krb5-1.3-alpha1~1539 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7fd5893a43da9bc4884404ed23cfcb00899ebd84;p=krb5.git * conv_creds.c (broken, krb524_convert_creds_plain): Unused code deleted git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13208 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/krb524/ChangeLog b/src/krb524/ChangeLog index 593ff6866..c11fea0f2 100644 --- a/src/krb524/ChangeLog +++ b/src/krb524/ChangeLog @@ -1,5 +1,8 @@ 2001-04-26 Ken Raeburn + * 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. diff --git a/src/krb524/Makefile.in b/src/krb524/Makefile.in index b49587b25..912d2f43f 100644 --- a/src/krb524/Makefile.in +++ b/src/krb524/Makefile.in @@ -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 diff --git a/src/krb524/configure.in b/src/krb524/configure.in index eca1642cd..96fbc5100 100644 --- a/src/krb524/configure.in +++ b/src/krb524/configure.in @@ -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 diff --git a/src/krb524/conv_creds.c b/src/krb524/conv_creds.c index c1e4b89a3..2834bb42a 100644 --- a/src/krb524/conv_creds.c +++ b/src/krb524/conv_creds.c @@ -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 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; } diff --git a/src/krb524/krb524d.c b/src/krb524/krb524d.c index ab3d038b9..80c550544 100644 --- a/src/krb524/krb524d.c +++ b/src/krb524/krb524d.c @@ -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");