--- ftpd.c.old Wed Nov 29 12:14:14 2000 +++ ftpd.c Wed Nov 29 12:26:33 2000 @@ -173,6 +173,7 @@ int usedefault = 1; /* for data transfers */ int pdata = -1; /* for passive mode */ int family = AF_INET; +unsigned int utmp_len=MAXHOSTNAMELEN; /* for utmp entries */ sig_atomic_t transflag; off_t file_size; off_t byte_count; @@ -277,7 +278,7 @@ return (guest ? path+1 : path); } -char *argstr = "AdDhlMSt:T:u:UvP46"; +char *argstr = "AdDhH:lMSt:T:u:UvP46"; static void usage() @@ -322,6 +323,10 @@ high_data_ports = 1; break; + case 'H': + utmp_len=atoi(optarg); + break; + case 'l': logging++; /* > 1 == extra logging */ break; @@ -2039,6 +2044,8 @@ char hbuf[sizeof(remotehost)]; getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0, 0); + if ((utmp_len == 0) || (strlen(hbuf) > utmp_len)) + getnameinfo(sa, sa->sa_len, hbuf, sizeof(hbuf), NULL, 0, NI_NUMERICHOST); (void) strncpy(remotehost, hbuf, sizeof(remotehost)-1); remotehost[sizeof(remotehost)-1] = '\0';