diff options
author | davidn <davidn@FreeBSD.org> | 1997-07-24 09:26:12 +0000 |
---|---|---|
committer | davidn <davidn@FreeBSD.org> | 1997-07-24 09:26:12 +0000 |
commit | d10a6136b758facd16f85681e0c35e9be5c13040 (patch) | |
tree | cc3a31bccba5ffe28a0498606ab37642e51c7bf7 /libexec/ftpd/ftpd.c | |
parent | 572da9743b5ea2de133fc8ab9add49dc68a59b1e (diff) | |
download | FreeBSD-src-d10a6136b758facd16f85681e0c35e9be5c13040.zip FreeBSD-src-d10a6136b758facd16f85681e0c35e9be5c13040.tar.gz |
Make useage of hostname global variable consistent.
PR: 4135
Based on submitted patch by: blank@fox.uni-trier.de
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r-- | libexec/ftpd/ftpd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 777b3e1..37407a3 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -30,7 +30,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: ftpd.c,v 1.39 1997/05/10 18:58:15 davidn Exp $ + * $Id: ftpd.c,v 1.40 1997/05/21 23:24:41 danny Exp $ */ #if 0 @@ -151,8 +151,8 @@ off_t byte_count; #endif int defumask = CMASK; /* default umask value */ char tmpline[7]; -#ifdef VIRTUAL_HOSTING char *hostname; +#ifdef VIRTUAL_HOSTING char *ftpuser; static struct ftphost { @@ -165,8 +165,6 @@ static struct ftphost { char *loginmsg; } *thishost, *firsthost; -#else -char hostname[MAXHOSTNAMELEN]; #endif char remotehost[MAXHOSTNAMELEN]; char *ident = NULL; @@ -535,7 +533,9 @@ main(argc, argv, envp) /* reply(220,) must follow */ } #ifndef VIRTUAL_HOSTING - (void) gethostname(hostname, sizeof(hostname)); + if ((hostname = malloc(MAXHOSTNAMELEN)) == NULL) + fatal("Ran out of memory."); + (void) gethostname(hostname, MAXHOSTNAMELEN); #endif reply(220, "%s FTP server (%s) ready.", hostname, version); (void) setjmp(errcatch); |