From dburr@borg-cube.com  Fri Apr 27 23:40:05 2001
Return-Path: <dburr@borg-cube.com>
Received: from borg-cube.com (226-193.adsl2.netlojix.net [207.71.226.193])
	by hub.freebsd.org (Postfix) with ESMTP id 20CB337B422
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 27 Apr 2001 23:39:54 -0700 (PDT)
	(envelope-from dburr@borg-cube.com)
Received: (from dburr@localhost)
	by borg-cube.com (8.11.3/8.11.3) id f3S6dZ098934;
	Fri, 27 Apr 2001 23:39:35 -0700 (PDT)
	(envelope-from dburr)
Message-Id: <200104280639.f3S6dZ098934@borg-cube.com>
Date: Fri, 27 Apr 2001 23:39:35 -0700 (PDT)
From: dburr@borg-cube.com
Reply-To: dburr@borg-cube.com
To: FreeBSD-gnats-submit@freebsd.org
Cc: dburr@borg-cube.com
Subject: a2ps cannot handle long hostnames
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         26909
>Category:       ports
>Synopsis:       a2ps cannot handle long hostnames
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    chuckr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Apr 27 23:50:00 PDT 2001
>Closed-Date:    Tue Nov 20 17:35:12 PST 2001
>Last-Modified:  Tue Nov 20 17:35:24 PST 2001
>Originator:     Donald Burr of Borg
>Release:        FreeBSD 4.3-RC i386
>Organization:
The Borg Cube - Resistance is Futile! http://www.borg-cube.com/
>Environment:
System: FreeBSD borg-cube.com 4.3-RC FreeBSD 4.3-RC #0: Tue Apr 17 01:17:06 PDT 2001 dburr@borg-cube.com:/usr/srctrees/RELENG_4/src/sys/compile/BORG-CUBE i386
a2ps port version: a2ps-letter-4.13

	
>Description:

If a2ps is run on a machine with a long hostname, it bombs out with a
"cannot allocate memory" error message.

	
>How-To-Repeat:

[dburr@scout:102 dburr]# hostname
scoutship.collective.borg-cube.com
[dburr@scout:103 dburr]# a2ps foo
a2ps: gethostname: Cannot allocate memory
[dburr@scout:104 dburr]# hostname scout.collective.borg-cube.com
[dburr@scout:105 dburr]# a2ps foo
a2ps: cannot open file `foo': No such file or directory
[foo (unprintable): ignored]
[No output produced]
[dburr@scout:106 dburr]# 

	
>Fix:
use a shorter hostname, put a CNAME in your DNS records so that the old
name still works.

	
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->chuckr 
Responsible-Changed-By: dburr 
Responsible-Changed-When: Sun Apr 29 15:28:33 PDT 2001 
Responsible-Changed-Why:  
Over to maintainer. 
. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=26909 

From: Edwin Groothuis <edwin@mavetju.org>
To: freebsd-gnats-submit@FreeBSD.org, dburr@borg-cube.com
Cc: freebsd-ports@freebsd.org, chuckr@FreeBSD.org
Subject: Re: ports/26909: a2ps cannot handle long hostnames
Date: Fri, 9 Nov 2001 12:53:20 +1100

 The following file (patch-lib-xgethostname.c)  will solve the
 problem. Add it the files-directory of a2ps-a4, a2ps-letter and
 a2ps-letterdj and you're off!
 
 I'll write this to the authors (if I can find them) of a2ps.
 
 --- lib/xgethostname.c.orig     Thu Nov  8 17:26:00 2001
 +++ lib/xgethostname.c  Thu Nov  8 17:26:43 2001
 @@ -22,6 +22,7 @@
  #endif
  
  #include <sys/types.h>
 +#include <sys/param.h>
  
  #include <errno.h>
  #ifndef errno
 @@ -38,7 +39,7 @@
  int gethostname ();
  
  #ifndef INITIAL_HOSTNAME_LENGTH
 -# define INITIAL_HOSTNAME_LENGTH 34
 +# define INITIAL_HOSTNAME_LENGTH MAXHOSTNAMELEN
  #endif
  
  char *
 
 
 -- 
 Edwin Groothuis   |              Personal website: http://www.MavEtJu.org
 edwin@mavetju.org |           Interested in MUDs? Visit Fatal Dimensions:
 ------------------+                       http://www.FatalDimensions.org/
State-Changed-From-To: open->closed 
State-Changed-By: petef 
State-Changed-When: Tue Nov 20 17:35:12 PST 2001 
State-Changed-Why:  
Committed, thanks! 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=26909 
>Unformatted:
