ports/62069: ftp/tnftpd update

Rudolf Cejka cejkar at fit.vutbr.cz
Tue Feb 3 17:33:23 UTC 2004


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



More information about the freebsd-ports-bugs mailing list