Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Oct 2000 12:36:54 -0200 (BRST)
From:      jonny@embratel.net.br
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/22123: New port: pop3gwd
Message-ID:  <20001019143654.9911524D14@eng05.embratel.net.br>

next in thread | raw e-mail | index | archive | help

>Number:         22123
>Category:       ports
>Synopsis:       New port: pop3gwd
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 19 07:40:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Joao Carlos Mendes Luis
>Release:        FreeBSD 4.1.1-STABLE i386
>Organization:
Embratel
>Environment:

>Description:

	This ports has been adapted from the OpenBSD version.

>How-To-Repeat:

>Fix:


# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	pop3gwd
#	pop3gwd/Makefile
#	pop3gwd/files
#	pop3gwd/files/patch-connect_loginc
#	pop3gwd/files/patch-get_remote_datac
#	pop3gwd/files/patch-ioc
#	pop3gwd/files/patch-mainc
#	pop3gwd/files/patch-makefile
#	pop3gwd/files/patch-parse_cmd_linec
#	pop3gwd/files/patch-pop3-gwh
#	pop3gwd/files/patch-relay_datac
#	pop3gwd/files/SECURITY
#	pop3gwd/distinfo
#	pop3gwd/pkg-comment
#	pop3gwd/pkg-descr
#	pop3gwd/pkg-plist
#
echo c - pop3gwd
mkdir -p pop3gwd > /dev/null 2>&1
echo x - pop3gwd/Makefile
sed 's/^X//' >pop3gwd/Makefile << 'END-of-pop3gwd/Makefile'
X#
X# $FreeBSD:$
X#
X# New ports collection makefile for: pop3gwd
X# Date created:                      19 October 2000
X# Whom:                              jonny@jonny.eng.br
X#
X# Based on the OpenBSD port by ianm@cit.nepean.uws.edu.au
X#
X
XPORTNAME=	pop3gwd
XPORTVERSION=	1.2
XCATEGORIES=    	mail net
XMASTER_SITES=   http://www.go.dlr.de/linux/src/			\
X		ftp://ftp.eos.hokudai.ac.jp/pub/mail/pop/	\
X		ftp://ftp.win.ne.jp/pub/network/mail/pop/
X
XMAINTAINER=	jonny@jonny.eng.br
X
XWRKSRC=		${WRKDIR}/${PORTNAME}
X
X.include <bsd.port.mk>
END-of-pop3gwd/Makefile
echo c - pop3gwd/files
mkdir -p pop3gwd/files > /dev/null 2>&1
echo x - pop3gwd/files/patch-connect_loginc
sed 's/^X//' >pop3gwd/files/patch-connect_loginc << 'END-of-pop3gwd/files/patch-connect_loginc'
X# $OpenBSD: patch-connect_loginc,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $
X--- connect_login.c.orig	Thu Jun 19 19:06:28 1997
X+++ connect_login.c	Wed Dec 29 12:23:12 1999
X@@ -42,10 +42,10 @@
X 		if ((remote_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
X 			remote_fd = BAD;
X 		else {
X-		        bzero(&tcp_srv_addr, sizeof(tcp_srv_addr));
X+		        memset(&tcp_srv_addr, 0, sizeof(tcp_srv_addr));
X         		tcp_srv_addr.sin_family = AF_INET;
X 			tcp_srv_addr.sin_port = htons(port);
X-		        bcopy(host_ptr->h_addr_list[0], &tcp_srv_addr.sin_addr, host_ptr->h_length);
X+		        memcpy(&tcp_srv_addr.sin_addr, host_ptr->h_addr_list[0], host_ptr->h_length);
X 			if (connect(remote_fd, (struct sockaddr *) &tcp_srv_addr, sizeof(tcp_srv_addr)) <0) {
X 				close(remote_fd);
X 				remote_fd = BAD;
X@@ -136,7 +136,7 @@
X 	if (result == TRUE) {
X 		/* server replied, check if reply is empty */
X 		/* must save response in case it is good */
X-		strncpy(to_client, input, MAX_IO_LEN);
X+		(void)strlcpy(to_client, input, MAX_IO_LEN);
X 		if ((next_tok = strtok(input, " ")) == NULL) {
X 			/* empty response, POP3 violation */
X 			close(*remote_filedes);
X@@ -159,7 +159,7 @@
X 	syslog(LOG_PRIO, "%s", to_client);
X #endif
X 
X-	strncat(to_client, termin, MAX_IO_LEN);
X+	(void)strlcat(to_client, termin, MAX_IO_LEN);
X 	if ((count = writen(first_filedes, to_client, strlen(to_client), maxwait)) == strlen(to_client))
X 		*out += count;
X 	else
END-of-pop3gwd/files/patch-connect_loginc
echo x - pop3gwd/files/patch-get_remote_datac
sed 's/^X//' >pop3gwd/files/patch-get_remote_datac << 'END-of-pop3gwd/files/patch-get_remote_datac'
X# $OpenBSD: patch-get_remote_datac,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $
X--- get_remote_data.c.orig	Wed Dec 29 12:30:32 1999
X+++ get_remote_data.c	Wed Dec 29 12:31:29 1999
X@@ -39,36 +39,36 @@
X 
X 	/* look for user command, can be USER or QUIT */
X 	if ((next_tok = strtok(input, " ")) != NULL)
X-		strncpy(cmd, next_tok, maxlen);
X+		strlcpy(cmd, next_tok, maxlen);
X 	else {
X 		result = BAD;
X-		strncpy(error, "no command in input", maxlen);
X+		strlcpy(error, "no command in input", maxlen);
X 		cmd[0] = 0;	/* we terminate the string anyway, better be safe than sorry */
X 	}
X 
X 	if (result == GOOD && strcasecmp(cmd, user_c) == 0) {
X 		/* look for hostname to connect to (after last delimiter, if present) */
X 		if (delim_pos != NULL) {
X-			strncpy(hostname, delim_pos+1, MAXHOSTNAMELEN);
X+			strlcpy(hostname, delim_pos+1, MAXHOSTNAMELEN);
X 			*delim_pos = 0;	/* terminate the string here, so strtok will ignore this part */			
X 			if (strlen(hostname) != 0) {
X 				if ((next_tok = strtok(NULL, " ")) != NULL) {
X-					strncpy(username, next_tok, maxlen);
X+					strlcpy(username, next_tok, maxlen);
X 				}
X 				else {
X 					result = BAD;
X-					strncpy(error, "no username in input", maxlen);
X+					strlcpy(error, "no username in input", maxlen);
X 				}
X 			
X 			}
X 			else {
X 				result = BAD;
X-				strncpy(error, "no hostname in input", maxlen);
X+				strlcpy(error, "no hostname in input", maxlen);
X 			}
X 		}
X 		else {
X 			result = BAD;
X-			strncpy(error, "no username/hostname delimiter in input", maxlen);
X+			strlcpy(error, "no username/hostname delimiter in input", maxlen);
X 		}
X 	}
X 	
X@@ -76,7 +76,7 @@
X 	if (result == GOOD) {
X 		if (strcasecmp(cmd, user_c) != 0 && strcasecmp(cmd, quit_c) != 0) {
X 			result = BAD;
X-			strncpy(error, "command must be either USER or QUIT", maxlen);
X+			strlcpy(error, "command must be either USER or QUIT", maxlen);
X 		}
X 	}
X 	
X@@ -133,7 +133,7 @@
X 	if (parse_res == GOOD && strcasecmp(cmd, quit_c) == 0) {
X 		/* set server's hostname and setup farewell */
X 		if (gethostname(server_name, MAXHOSTNAMELEN) != 0)
X-			strncpy(server_name, "localhost", MAXHOSTNAMELEN);
X+			strlcpy(server_name, "localhost", MAXHOSTNAMELEN);
X 		snprintf(output, MAX_IO_LEN, "%s %s %s %s%s", pos_re, server_name,
X 				GREETING, "signing off", termin);
X 		if  ((count = writen(client_filedes, output, strlen(output), maxwait)) == strlen(output))
END-of-pop3gwd/files/patch-get_remote_datac
echo x - pop3gwd/files/patch-ioc
sed 's/^X//' >pop3gwd/files/patch-ioc << 'END-of-pop3gwd/files/patch-ioc'
X# $OpenBSD: patch-ioc,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $
X--- io.c.orig	Wed Dec 29 12:26:16 1999
X+++ io.c	Wed Dec 29 12:27:39 1999
X@@ -52,7 +52,7 @@
X 	
X 	while (++count < maxlen && term_flag == FALSE) {
X 	
X-		bcopy(&master, &copy, sizeof(fd_set));	/* select() trashes copy */
X+		memcpy(&copy, &master, sizeof(fd_set));	/* select() trashes copy */
X 		deadline.tv_sec = maxwait;
X 		deadline.tv_usec = 0;
X 
X@@ -115,7 +115,7 @@
X 	nleft = nbytes;
X 	
X 	do {
X-		bcopy(&master, &copy, sizeof(fd_set));  /* select() trashes copy */
X+		memcpy(&copy, &master, sizeof(fd_set));  /* select() trashes copy */
X 		deadline.tv_sec = maxwait;
X 		deadline.tv_usec = 0;
X 
END-of-pop3gwd/files/patch-ioc
echo x - pop3gwd/files/patch-mainc
sed 's/^X//' >pop3gwd/files/patch-mainc << 'END-of-pop3gwd/files/patch-mainc'
X# $OpenBSD: patch-mainc,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $
X--- main.c.orig	Tue Dec 28 12:16:25 1999
X+++ main.c	Tue Dec 28 12:28:45 1999
X@@ -23,7 +23,7 @@
X static char rcsid[] = "$Id: patch-mainc,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $";
X 
X 
X-void main(int argc, char *argv[]) {
X+int main(int argc, char *argv[]) {
X 	/* default proxy identification and setup */
X 	char delimiter = '#';			/* needed to parse username and hostname */
X 	int timeout = 120;			/* timeout is 2 minutes */
X@@ -60,7 +60,7 @@
X 
X 	/* set server's hostname and setup greeting */
X 	if (gethostname(server_name, MAXHOSTNAMELEN) != 0)
X-		strncpy(server_name, "localhost", MAXHOSTNAMELEN);
X+		(void)strlcpy(server_name, "localhost", MAXHOSTNAMELEN);
X 	snprintf(output, MAX_IO_LEN, "%s %s %s %s%s", pos_reply, server_name, 
X 		GREETING, "ready", terminator);
X 
X@@ -88,5 +88,6 @@
X 
X 	syslog(LOG_PRIO, "signing off (in: %d bytes, out: %d bytes)", in_bytes, out_bytes);
X 	closelog();
X+	return(0);
X }
X 
END-of-pop3gwd/files/patch-mainc
echo x - pop3gwd/files/patch-makefile
sed 's/^X//' >pop3gwd/files/patch-makefile << 'END-of-pop3gwd/files/patch-makefile'
X# $OpenBSD: patch-makefile,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $
X--- Makefile.orig	Thu Jun 19 19:06:28 1997
X+++ Makefile	Wed Dec 29 12:25:33 1999
X@@ -3,22 +3,23 @@
X 
X 
X CC=gcc
X-CFLAGS= -O2
X+CFLAGS= -O2 -Wall
X MODULES=main.o parse_cmd_line.o get_remote_data.o connect_login.o io.o relay_data.o
X DOCS=README COPYING HISTORY
X-INSTALL_DIR=/usr/sbin
X+INSTALL_DIR=${PREFIX}/libexec
X VERSION=1.2
X-DOC_DIR=/usr/doc/pop3gwd-$(VERSION)
X+DOC_DIR=${PREFIX}/share/doc/pop3gwd-$(VERSION)
X 
X 
X in.pop3gwd:	pop3-gw.h $(MODULES)
X 	$(CC) $(CFLAGS) -o $@ $(MODULES)
X 	strip $@
X 	chmod 755 $@
X+all:
X+	make
X 
X install:
X-	make
X-	cp -f in.pop3gwd $(INSTALL_DIR)/
X+	cp -f in.pop3gwd $(INSTALL_DIR)/pop3gwd
X 	[ -d $(DOC_DIR) ] || mkdir $(DOC_DIR)
X 	cp -f $(DOCS) $(DOC_DIR)
X 
END-of-pop3gwd/files/patch-makefile
echo x - pop3gwd/files/patch-parse_cmd_linec
sed 's/^X//' >pop3gwd/files/patch-parse_cmd_linec << 'END-of-pop3gwd/files/patch-parse_cmd_linec'
X# $OpenBSD: patch-parse_cmd_linec,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $
X--- parse_cmd_line.c.orig	Thu Jun 19 19:06:28 1997
X+++ parse_cmd_line.c	Wed Dec 29 12:41:02 1999
X@@ -21,6 +21,7 @@
X /* parse_cmd_line.c:	modify setup according to command line parameters */
X /* ---------------------------------------------------------------------- */
X 
X+#include <ctype.h>
X #include "pop3-gw.h"
X 
X 
X@@ -34,11 +35,11 @@
X 	
X 	
X 	/* there is always at least 1 arg and that's the name of the program */
X-	strncpy(log_id, argv[0], maxlen);
X+	strlcpy(log_id, argv[0], maxlen);
X 
X 	/* arguments must be in the form <id><value>, without blanks in between */
X 	while (count < argc) {
X-		strncpy(value, argv[count]+1, MAX_IO_LEN);
X+		strlcpy(value, argv[count]+1, MAX_IO_LEN);
X 		if (strlen(value) != 0)
X 			switch (*argv[count]) {
X 				case 'd':	if (ispunct(value[0]))
END-of-pop3gwd/files/patch-parse_cmd_linec
echo x - pop3gwd/files/patch-pop3-gwh
sed 's/^X//' >pop3gwd/files/patch-pop3-gwh << 'END-of-pop3gwd/files/patch-pop3-gwh'
X# $OpenBSD: patch-pop3-gwh,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $
X--- pop3-gw.h.orig	Thu Jun 19 19:06:28 1997
X+++ pop3-gw.h	Tue Dec 28 12:15:22 1999
X@@ -96,7 +96,7 @@
X #define BAD	-1
X #define FALSE	0
X #define TRUE	1
X-#ifndef __FreeBSD__
X+#if !defined( BSD4_4 )
X #define MAX(A, B)	((A) > (B) ? (A) : (B))
X #endif
X 
END-of-pop3gwd/files/patch-pop3-gwh
echo x - pop3gwd/files/patch-relay_datac
sed 's/^X//' >pop3gwd/files/patch-relay_datac << 'END-of-pop3gwd/files/patch-relay_datac'
X# $OpenBSD: patch-relay_datac,v 1.1.1.1 2000/01/03 02:22:43 kevlo Exp $
X--- relay_data.c.orig	Wed Dec 29 12:28:21 1999
X+++ relay_data.c	Wed Dec 29 12:29:06 1999
X@@ -39,7 +39,7 @@
X 
X 	while (logged_in == TRUE) {
X 	
X-		bcopy(&master, &copy, sizeof(fd_set));  /* select() trashes copy */
X+		memcpy(&copy, &master, sizeof(fd_set));  /* select() trashes copy */
X 		deadline.tv_sec = maxwait;
X 		deadline.tv_usec = 0;
X 
END-of-pop3gwd/files/patch-relay_datac
echo x - pop3gwd/files/SECURITY
sed 's/^X//' >pop3gwd/files/SECURITY << 'END-of-pop3gwd/files/SECURITY'
X# $OpenBSD: SECURITY,v 1.1.1.1 2000/01/03 02:22:42 kevlo Exp $
X
Xianm@cit.nepean.uws.edu.au	1999/12/29.
X
XMakes good use of snprintf.
X
XMade use of strncpy. I've converted them all to
Xstrlcpy for some performance improvements.
END-of-pop3gwd/files/SECURITY
echo x - pop3gwd/distinfo
sed 's/^X//' >pop3gwd/distinfo << 'END-of-pop3gwd/distinfo'
XMD5 (pop3gwd-1.2.tar.gz) = 529734de6f2e2a576ea1c59b202a56d5
END-of-pop3gwd/distinfo
echo x - pop3gwd/pkg-comment
sed 's/^X//' >pop3gwd/pkg-comment << 'END-of-pop3gwd/pkg-comment'
XApp-level proxy for Mail retrieval behind Firewalls.
END-of-pop3gwd/pkg-comment
echo x - pop3gwd/pkg-descr
sed 's/^X//' >pop3gwd/pkg-descr << 'END-of-pop3gwd/pkg-descr'
XThis program is an application-level gateway, or proxy, designed to allow
Xmail retrieval from POP3 servers by systems that either:
X
X        (a) are behind a firewall or screening router OR
X        (b) do not have an assigned IP number OR
X        (c) must share a SLIP/PPP connection on another system
X
XIt connects to the POP3 server on behalf of the client, performs the login
Xand then passes data both ways until either the client or the server shut
Xdown the connection. In the meanwhile, the connection will appear to have
Xoriginated on the host running the proxy.
END-of-pop3gwd/pkg-descr
echo x - pop3gwd/pkg-plist
sed 's/^X//' >pop3gwd/pkg-plist << 'END-of-pop3gwd/pkg-plist'
Xlibexec/pop3gwd
Xshare/doc/pop3gwd-1.2/COPYING
Xshare/doc/pop3gwd-1.2/HISTORY
Xshare/doc/pop3gwd-1.2/README
X@dirrm share/doc/pop3gwd-1.2
END-of-pop3gwd/pkg-plist
exit


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


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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