bin/164038: [PATCH] tzsetup(8): Increase buffer size to hold error messages

Devin Teske dteske at vicor.com
Thu Jan 12 05:00:26 UTC 2012


>Number:         164038
>Category:       bin
>Synopsis:       [PATCH] tzsetup(8): Increase buffer size to hold error messages
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jan 12 05:00:26 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Devin Teske
>Release:        FreeBSD 9.0-RELEASE amd64
>Organization:
FIS Global, Inc.
>Environment:
FreeBSD scribe.vicor.com 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan 3 07:46:30 UTC 2010
root at farrell.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
The prompt buffer is too small to hold error messages, and thus simply executing "tzsetup some/foo" results in:

Cannot read /usr/share/zoneinfo/some/foo: No such file or dir

(truncated portion is "ectory")

Bumping the prompt buffer from 64 bytes to 1024 seems like a modest solution.
>How-To-Repeat:
Exec as root: tzsetup some/foo
Notice error message "Cannot read %s: No such file or directory" is truncated by the 64-byte buffer.
>Fix:
See attached patch.txt

Patch attached with submission follows:

--- usr.sbin/tzsetup/tzsetup.c.orig	Fri Dec  2 11:19:10 2011
+++ usr.sbin/tzsetup/tzsetup.c	Wed Jan 11 18:58:01 2012
@@ -638,7 +638,7 @@ static int
 install_zoneinfo_file(const char *zoneinfo_file)
 {
 	char		buf[1024];
-	char		title[64], prompt[64];
+	char		title[64], prompt[1024];
 	struct stat	sb;
 	ssize_t		len;
 	int		fd1, fd2, copymode;


>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list