From: Tom Yu Date: Tue, 23 Feb 1999 03:51:39 +0000 (+0000) Subject: * kcmd.c (k4cmd): Move call to krb_realmofhost() to avoid smashing X-Git-Tag: krb5-1.1-beta1~332 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ed917cb241e2c2c7a49fed089d60abdcba6fc3bb;p=krb5.git * kcmd.c (k4cmd): Move call to krb_realmofhost() to avoid smashing hp. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11213 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/appl/bsd/ChangeLog b/src/appl/bsd/ChangeLog index 7c3d772e8..99b1ca0c5 100644 --- a/src/appl/bsd/ChangeLog +++ b/src/appl/bsd/ChangeLog @@ -4,6 +4,9 @@ Mon Feb 22 22:26:32 1999 Tom Yu all the addresses in hp have been iterated through to avoid smashing. [krb5-appl/516] + * kcmd.c (k4cmd): Move call to krb_realmofhost() to avoid smashing + hp. + Wed Feb 17 17:24:11 1999 Tom Yu * klogind.M: Document things a little better, including new diff --git a/src/appl/bsd/kcmd.c b/src/appl/bsd/kcmd.c index 3d160e565..701606548 100644 --- a/src/appl/bsd/kcmd.c +++ b/src/appl/bsd/kcmd.c @@ -501,11 +501,6 @@ k4cmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, ticket, service, realm, strcpy(host_save, hp->h_name); *ahost = host_save; - /* If realm is null, look up from table */ - if ((realm == NULL) || (realm[0] == '\0')) { - realm = krb_realmofhost(host_save); - } - #ifdef POSIX_SIGNALS sigemptyset(&urgmask); sigaddset(&urgmask, SIGURG); @@ -560,6 +555,10 @@ k4cmd(sock, ahost, rport, locuser, remuser, cmd, fd2p, ticket, service, realm, #endif /* POSIX_SIGNALS */ return (-1); } + /* If realm is null, look up from table */ + if ((realm == NULL) || (realm[0] == '\0')) { + realm = krb_realmofhost(host_save); + } lport--; if (fd2p == 0) { write(s, "", 1);