From: Mark Eichin Date: Wed, 13 Mar 1996 20:05:52 +0000 (+0000) Subject: update from cygnus sources. Get local hostname in a consistent manner, X-Git-Tag: krb5-1.0-beta6~380 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=e6c5957eba6884feb311d242ef26859c1cb5ed59;p=krb5.git update from cygnus sources. Get local hostname in a consistent manner, so we ask for the right local service name. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@7622 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/gssftp/ftp/configure.in b/src/appl/gssftp/ftp/configure.in index 5fe000144..95fff062c 100644 --- a/src/appl/gssftp/ftp/configure.in +++ b/src/appl/gssftp/ftp/configure.in @@ -3,6 +3,7 @@ CONFIG_RULES AC_CONST AC_PROG_INSTALL KRB5_SIGTYPE +USE_ANAME CHECK_SIGPROCMASK CHECK_WAIT_TYPE DECLARE_SYS_ERRLIST @@ -11,5 +12,6 @@ AC_HAVE_FUNCS(getcwd getdtablesize) AC_CHECK_HEADERS(sys/select.h) AC_HEADER_CHECK(termios.h,AC_FUNC_CHECK(cfsetispeed,AC_DEFINE(POSIX_TERMIOS))) AC_CHECK_HEADERS(stdlib.h) +KRB5_LIBRARIES V5_USE_SHARED_LIB V5_AC_OUTPUT_MAKEFILE diff --git a/src/appl/gssftp/ftpd/Makefile.in b/src/appl/gssftp/ftpd/Makefile.in index 666bf37b3..16dfeb157 100644 --- a/src/appl/gssftp/ftpd/Makefile.in +++ b/src/appl/gssftp/ftpd/Makefile.in @@ -41,6 +41,7 @@ install:: ${DESTDIR}$(SERVER_MANDIR)/`echo $$f|sed '$(transform)'`.8; \ done + ftpcmd.c: $(srcdir)/ftpcmd.y $(RM) ftpcmd.c y.tab.c $(YACC) $(srcdir)/ftpcmd.y diff --git a/src/appl/gssftp/ftpd/configure.in b/src/appl/gssftp/ftpd/configure.in index b8c99a007..2f60d9081 100644 --- a/src/appl/gssftp/ftpd/configure.in +++ b/src/appl/gssftp/ftpd/configure.in @@ -29,5 +29,6 @@ AC_SUBST([SETENVOBJ]) fi dnl USE_ANAME +KRB5_LIBRARIES V5_USE_SHARED_LIB V5_AC_OUTPUT_MAKEFILE diff --git a/src/appl/gssftp/ftpd/ftpd.c b/src/appl/gssftp/ftpd/ftpd.c index 5a5a287a5..cb531ce82 100644 --- a/src/appl/gssftp/ftpd/ftpd.c +++ b/src/appl/gssftp/ftpd/ftpd.c @@ -1896,6 +1896,7 @@ char *data; char localname[MAXHOSTNAMELEN]; char service_name[MAXHOSTNAMELEN+10]; char **service; + struct hostent *hp; chan.initiator_addrtype = GSS_C_AF_INET; chan.initiator_address.length = 4; @@ -1920,7 +1921,14 @@ char *data; reply(501, "couldn't get local hostname (%d)\n", errno); syslog(LOG_ERR, "Couldn't get local hostname (%d)", errno); return 0; - } + } + if (!(hp = gethostbyname(localname))) { + extern int h_errno; + reply(501, "couldn't canonicalize local hostname (%d)\n", h_errno); + syslog(LOG_ERR, "Couldn't canonicalize local hostname (%d)", h_errno); + return 0; + } + strcpy(localname, hp->h_name); for (service = gss_services; *service; service++) { sprintf(service_name, "%s@%s", *service, localname);