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 | |
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')
-rw-r--r-- | libexec/ftpd/ftpcmd.y | 5 | ||||
-rw-r--r-- | libexec/ftpd/ftpd.c | 10 |
2 files changed, 8 insertions, 7 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y index 5951e70..659081b 100644 --- a/libexec/ftpd/ftpcmd.y +++ b/libexec/ftpd/ftpcmd.y @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)ftpcmd.y 8.3 (Berkeley) 4/6/94 - * $Id$ + * $Id: ftpcmd.y,v 1.10 1997/02/22 14:21:27 peter Exp $ */ /* @@ -80,7 +80,8 @@ extern int debug; extern int timeout; extern int maxtimeout; extern int pdata; -extern char hostname[], remotehost[]; +extern char *hostname; +extern char remotehost[]; extern char proctitle[]; extern int usedefault; extern int transflag; 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); |