Package: bsdmainutils
Version: 6.1.3
Severity: important
Tags: patch

Hello,

The bsdmainutils package fails to autobuild on hurd-i386:

make[1]: Entering directory `/build/buildd/bsdmainutils-6.1.3'
cc -include ../../freebsd.h  -g -O2 -c -o banner.o banner.c
cc  -o banner banner.o
cc -include ../../freebsd.h  -g -O2 -c -o calendar.o calendar.c
cc -include ../../freebsd.h  -g -O2 -c -o io.o io.c
io.c: In function 'openfile':
io.c:356: error: 'PATH_MAX' undeclared (first use in this function)
io.c:356: error: (Each undeclared identifier is reported only once
io.c:356: error: for each function it appears in.)
make[2]: *** [io.o] Error 1
make[1]: *** [all] Error 2
make[1]: Leaving directory `/build/buildd/bsdmainutils-6.1.3'
make: *** [build-stamp] Error 2

The full build log can be found at:
http://experimental.ftbfs.de/fetch.php?&pkg=bsdmainutils&ver=6.1.3&arch=hurd-i386&stamp=1137938243&file=log&as=raw

PATH_MAX is not defined on hurd-i386 and the attached patch removes that 
instance and allows the package to build properly.

Best regards,

Chris

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: hurd-i386 (i686-AT386)
Shell:  /bin/sh linked to /bin/bash
Kernel: GNU 0.3
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages bsdmainutils depends on:
ii  bsdutils                 1:2.12-3+hurd.2 Basic utilities from 4.4BSD-Lite
ii  debianutils              2.15.3          Miscellaneous utilities specific t
ii  libc0.3                  2.3.6-3         GNU C Library: Shared libraries an
ii  libncurses5              5.4-9           Shared libraries for terminal hand

bsdmainutils recommends no packages.

-- debconf information excluded
--- bsdmainutils-6.1.3/usr.bin/calendar/io.c	2006-01-02 22:43:26.000000000 +0100
+++ bsdmainutils-6.1.3.patched/usr.bin/calendar/io.c	2006-03-07 23:40:56.000000000 +0100
@@ -335,6 +335,7 @@ openfile()
 	struct stat st;
 	char *home;
 	int fd;
+	int calendarPathLength;
 
 	/* Is there a calendar file in the current directory? */
 	if ((fd = open(calendarFile, O_RDONLY)) != -1 &&
@@ -353,9 +354,11 @@ openfile()
 	if ((chdir(home) == 0 &&
 	    chdir(calendarHome) == 0 &&
 	    (fd = open(calendarFile, O_RDONLY)) != -1)) {
-		if ((calendarPath = (char *) malloc(PATH_MAX)) == NULL)
+		calendarPathLength = strlen(home) +1 + strlen(calendarHome) +1 + strlen(calendarFile) + 1;
+		calendarPath = malloc(calendarPathLength);
+		if (calendarPath == NULL)
 			err(1, NULL);
-		snprintf(calendarPath, PATH_MAX, "%s/%s/%s", home, calendarHome, calendarFile);
+		snprintf(calendarPath, calendarPathLength, "%s/%s/%s", home, calendarHome, calendarFile);
 
 		return fd;
 	}

Reply via email to