Skip Menu |
 

Download (untitled) / with headers
text/plain 2.8KiB
From jik@kamens.brookline.ma.us Wed Feb 12 12:27:26 1997
Received: from MIT.EDU (PACIFIC-CARRIER-ANNEX.MIT.EDU [18.69.0.28]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id MAA10251 for <bugs@RT-11.MIT.EDU>; Wed, 12 Feb 1997 12:27:26 -0500
Received: from jik.saturn.net by MIT.EDU with SMTP
id AA25916; Wed, 12 Feb 97 12:27:24 EST
Received: (from jik@localhost)
by jik.saturn.net (8.8.4/8.8.4)
id MAA23547; Wed, 12 Feb 1997 12:30:48 -0500
Message-Id: <199702121730.MAA23547@jik.saturn.net>
Date: Wed, 12 Feb 1997 12:30:48 -0500
From: "Jonathan I. Kamens" <jik@kamens.brookline.ma.us>
Reply-To: jik@cam.ov.com
To: krb5-bugs@MIT.EDU
Cc: jik@cam.ov.com
Subject: telnet should canonify host name in DISPLAY
X-Send-Pr-Version: 3.99

Show quoted text
>Number: 374
>Category: telnet
>Synopsis: telnet should canonify host name in DISPLAY
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: hartmans
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Wed Feb 12 12:28:00 EST 1997
>Last-Modified: Wed Feb 12 16:06:29 EST 1997
>Originator: Jonathan I. Kamens
>Organization:
OpenVision Technologies, Inc.
Show quoted text
>Release: 1.0
>Environment:
N/A
Show quoted text
>Description:
When telnet notices that the DISPLAY environment variable
starts with ":" or "unix:" and goes to prefix it with the local host
name before exporting it to the remote host, it should try to canonify
the local host name, so that the DISPLAY setting will be valid even if
the remote host is in a different domain. Also, it should check the
return value of gethostname() and not try to use it if it failed.

I believe I submitted this patch previously, but it doesn't
seem to have made it into 1.0.
Show quoted text
>How-To-Repeat:

Show quoted text
>Fix:
--- krb5-1.0/src/appl/telnet/telnet/commands.c Tue Nov 26 20:42:37 1996
+++ krb5-1.0/src/appl/telnet/telnet/commands.c Tue Feb 11 20:31:45 1997
@@ -1727,12 +1727,19 @@
char hbuf[256+1];
char *cp2 = strchr((char *)ep->value, ':');

- gethostname(hbuf, 256);
- hbuf[256] = '\0';
- cp = (char *)malloc(strlen(hbuf) + strlen(cp2) + 1);
- sprintf((char *)cp, "%s%s", hbuf, cp2);
- free(ep->value);
- ep->value = (unsigned char *)cp;
+ if (gethostname(hbuf, 256) == 0) {
+ struct hostent *host;
+
+ hbuf[256] = '\0';
+ host = gethostbyname(hbuf);
+ if (host)
+ strncpy(hbuf, host->h_name, sizeof(hbuf));
+ hbuf[256] = '\0';
+ cp = (char *)malloc(strlen(hbuf) + strlen(cp2) + 1);
+ sprintf((char *)cp, "%s%s", hbuf, cp2);
+ free(ep->value);
+ ep->value = (unsigned char *)cp;
+ }
}
/*
* If USER is not defined, but LOGNAME is, then add
Show quoted text
>Audit-Trail:

Responsible-Changed-From-To: krb5-unassigned->hartmans
Responsible-Changed-By: tlyu
Responsible-Changed-When: Wed Feb 12 16:06:05 1997
Responsible-Changed-Why:

this is actually belongs in the telnet category

Show quoted text
>Unformatted: