Added support for autoconf
The following rules apply to the initial banner message printed by telnetd: if libc contains cgetent and the "default" entry in /etc/gettytab defines an im - use that. else if configured with a specific default im (--enable-default-im) use that else use a sensible default "systemname os-release (hostname) (ttyname)" The im can now contain these vaiables: %s - system name (uname -s) %r - system release (uname -r) %v - system version (uname -v) %m - machine (uname -m) %h - hostname %t - tty %d - date Default for Cray is "Cray UNICOS (%h) (%t)", (this should probably change) for AIX: "%s %v.%r (%h) (%t)" and for everything else: "%s %r (%h) (%t)". These defaults are defined in ext.h If the system does not have uname(2), %s defaults to "Unix" and %r, %v and %m to the-empty-string. Is this clear enough? git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@59 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -35,9 +35,15 @@
|
|||||||
static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
|
static char sccsid[] = "@(#)utility.c 8.4 (Berkeley) 5/30/95";
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
|
#include <config.h>
|
||||||
|
|
||||||
#define PRINTOPTIONS
|
#define PRINTOPTIONS
|
||||||
#include "telnetd.h"
|
#include "telnetd.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_UNAME
|
||||||
|
#include <sys/utsname.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* utility functions performing io related tasks
|
* utility functions performing io related tasks
|
||||||
*/
|
*/
|
||||||
@@ -445,6 +451,9 @@ putf(cp, where)
|
|||||||
register char *cp;
|
register char *cp;
|
||||||
char *where;
|
char *where;
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_UNAME
|
||||||
|
struct utsname name;
|
||||||
|
#endif
|
||||||
char *slash;
|
char *slash;
|
||||||
time_t t;
|
time_t t;
|
||||||
char db[100];
|
char db[100];
|
||||||
@@ -454,6 +463,20 @@ putf(cp, where)
|
|||||||
extern char *strrchr();
|
extern char *strrchr();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* if we don't have uname, set these to sensible values */
|
||||||
|
char *sysname = "Unix",
|
||||||
|
*machine = "",
|
||||||
|
*release = "",
|
||||||
|
*version = "";
|
||||||
|
|
||||||
|
#ifdef HAVE_UNAME
|
||||||
|
uname(&name);
|
||||||
|
sysname=name.sysname;
|
||||||
|
machine=name.machine;
|
||||||
|
release=name.release;
|
||||||
|
version=name.version;
|
||||||
|
#endif
|
||||||
|
|
||||||
putlocation = where;
|
putlocation = where;
|
||||||
|
|
||||||
while (*cp) {
|
while (*cp) {
|
||||||
@@ -480,6 +503,22 @@ putf(cp, where)
|
|||||||
putstr(editedhost);
|
putstr(editedhost);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 's':
|
||||||
|
putstr(sysname);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'm':
|
||||||
|
putstr(machine);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'r':
|
||||||
|
putstr(release);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'v':
|
||||||
|
putstr(version);
|
||||||
|
break;
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
(void)time(&t);
|
(void)time(&t);
|
||||||
(void)strftime(db, sizeof(db), fmtstr, localtime(&t));
|
(void)strftime(db, sizeof(db), fmtstr, localtime(&t));
|
||||||
|
Reference in New Issue
Block a user