Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Feb 2004 18:31:20 +0100
From:      Rudolf Cejka <cejkar@fit.vutbr.cz>
To:        Pav Lucistnik <pav@FreeBSD.org>
Cc:        freebsd-ports-bugs@FreeBSD.org
Subject:   Re: ports/62069: ftp/tnftpd update
Message-ID:  <20040203173120.GA89191@fit.vutbr.cz>
In-Reply-To: <200401291625.i0TGPvkF004341@freefall.freebsd.org>
References:  <200401291625.i0TGPvkF004341@freefall.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Pav Lucistnik wrote (2004/01/29):
> This does not build on -STABLE:

Hmm, it seems that -stable does not support sysconf(_SC_LOGIN_NAME_MAX) :o|

Here are two more patches, which should fix compilation on both -current
and -stable (cut between ^-- marks):

-- patch-src-ftpd.c:
--- src/ftpd.c-orig	Tue Feb  3 18:16:46 2004
+++ src/ftpd.c	Tue Feb  3 18:19:26 2004
@@ -436,6 +436,7 @@
 	if (EMPTYSTR(confdir))
 		confdir = _DEFAULT_CONFDIR;
 
+#ifdef _SC_LOGIN_NAME_MAX
 	errno = 0;
 	l = sysconf(_SC_LOGIN_NAME_MAX);
 	if (l == -1 && errno != 0) {
@@ -446,6 +447,9 @@
 		curname_len = _POSIX_LOGIN_NAME_MAX;
 	} else 
 		curname_len = (size_t)l;
+#else
+	curname_len = LOGIN_NAME_MAX;
+#endif
 	curname = malloc(curname_len);
 	if (curname == NULL) {
 		syslog(LOG_ERR, "malloc: %m");
--

-- patch-tnftpd.h:
--- tnftpd.h-orig	Wed Dec 17 02:43:41 2003
+++ tnftpd.h	Tue Feb  3 18:14:15 2004
@@ -429,5 +429,9 @@
 #define TM_YEAR_BASE	1900
 
 #if ! defined(LOGIN_NAME_MAX)
+#if defined(MAXLOGNAME)
+# define LOGIN_NAME_MAX MAXLOGNAME
+#elif ! defined(LOGIN_NAME_MAX)
 # define LOGIN_NAME_MAX (9)
+#endif
 #endif
--

-- 
Rudolf Cejka <cejkar at fit.vutbr.cz> http://www.fit.vutbr.cz/~cejkar
Brno University of Technology, Faculty of Information Technology
Bozetechova 2, 612 66  Brno, Czech Republic



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040203173120.GA89191>