Bug 30298 - [PATCH] a2ps-4.13 can't cope with ENOMEM reported by gethostname(3)
Summary: [PATCH] a2ps-4.13 can't cope with ENOMEM reported by gethostname(3)
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Dirk Meyer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-09-04 00:20 UTC by pm
Modified: 2003-06-11 22:24 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (406 bytes, patch)
2001-09-04 00:20 UTC, pm
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description pm 2001-09-04 00:20:01 UTC
	On systems with a very long hostname (>34 chars), a2ps will fail 
	because gethostname(3) reports ENOMEM when the user-supplied buffer
	is too small. The xgethostname() routine in lib/xgethostname.c doesn't
	handle this.

	Maybe it would be better to use MAXHOSTNAMELEN from <sys/param.h> and
	don't adapt the buffer size?

	The included patch fixes PR/26909.

Fix: chdir to $A2PS_ROOTDIR/lib and patch -p0 the following lines:

How-To-Repeat: 	
	Set host name of your machine to >34 chars and execute
	a2ps from the shell.
Comment 1 Pete Fritchman freebsd_committer freebsd_triage 2001-09-04 00:25:06 UTC
Responsible Changed
From-To: freebsd-ports->chuckr

Over to maintainer
Comment 2 Kris Kennaway freebsd_committer freebsd_triage 2003-06-08 01:33:07 UTC
Responsible Changed
From-To: chuckr->freebsd-ports-bugs

Chuck no longer maintains this port
Comment 3 Dirk Meyer freebsd_committer freebsd_triage 2003-06-10 19:16:58 UTC
Responsible Changed
From-To: freebsd-ports-bugs->dinoex

I will take care of it
Comment 4 Dirk Meyer freebsd_committer freebsd_triage 2003-06-11 22:23:54 UTC
State Changed
From-To: open->closed

committed, thanks.