char *tty = NULL;
char *prompt = PASSPROMPT;
char host[MAXHOSTNAMELEN + 1];
+#ifdef FQDN
+char shost[MAXHOSTNAMELEN + 1];
+#endif /*FQDN */
char cwd[MAXPATHLEN + 1];
struct stat cmnd_st;
extern struct interface *interfaces;
inform_user(GLOBAL_NO_HOSTNAME);
#ifdef FQDN
} else {
- if ((h_ent = gethostbyname(host)) == NULL)
+ if ((h_ent = gethostbyname(host)) == NULL) {
log_error(GLOBAL_HOST_UNREGISTERED);
- else
+ } else {
strcpy(host, h_ent -> h_name);
+ if ((p = strchr(host, '.'))) {
+ *p = '\0';
+ strcpy(shost, host);
+ *p = '.';
+ } else {
+ strcpy(shost, host);
+ }
+ }
}
#else
}