Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 01 Dec 1999 14:29:57 +0900
From:      Akinori MUSHA aka knu <knu@idaemons.org>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/15199: Patch for newsfetch
Message-ID:  <86g0xnz0ru.wl@localhost.local.idaemons.org>

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

>Number:         15199
>Category:       ports
>Synopsis:       Patch for newsfetch
>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:   Tue Nov 30 21:40:01 PST 1999
>Closed-Date:
>Last-Modified:
>Originator:     Akinori MUSHA aka knu
>Release:        FreeBSD 3.3-STABLE i386
>Organization:
A.I.D.
>Environment:

	FreeBSD 3.3-STABLE i386 + ports-current

>Description:

	Newsfetch hardcodes the port number (119) for NNTP, but in
some cases we may need to specify it other than the default number,
for instance ssh's port-forwarding case.

>How-To-Repeat:

>Fix:

	Add the following patches to the port, and newsfetch will also
accept news server's name in 'host:port' style as well as 'host' which
equals to 'host:119'.


	I fedback this to the author of newsfetch a couple month ago,
but had no reply, still I really need it...


--Multipart_Wed_Dec__1_14:29:57_1999-1
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: attachment; filename="patch-ab"
Content-Transfer-Encoding: 7bit

--- newsfetch.c.orig	Thu Jul 23 18:28:56 1998
+++ newsfetch.c	Wed Dec  1 13:56:52 1999
@@ -7,6 +7,7 @@
 
  
 #include <stdio.h>
+#include <string.h>
 #include <signal.h>
 #include <pwd.h>
 #include <sys/types.h>
@@ -28,6 +29,7 @@
 int wait_after_articles = 0, articles_fetched=0, last_than_current;
 int wait_for_time = 0, timeout=READ_TIMEOUT, article_fetching=0;
 int cleanup=1, max_article, news_target=0, first_article, only_list=0;
+int port = 119;
 char group[100], pipe_command[100];
 FILE *rcfp, *rctmpfp, *socket_fp[2];
 char lockfile[100];
@@ -59,6 +61,16 @@
 	getHomedir(homedir);
 	strcpy(hostname,argv[1]);
 
+	{
+	  char *p;
+	  int n;
+
+	  if (NULL != (p = strchr(hostname, ':')) && 0 < (n = atoi(p + 1))) {
+	    port = n;
+	    *p = '\0';
+	  }
+	}
+
 	get_commandline(argc, argv, dirname, rcfile,
                 &cleanup, &wait_after_articles, &wait_for_time, 
 		&command_flag, execute_command,
@@ -75,7 +87,7 @@
 			generateProcmailrc(homedir, rcfile, dirname, pipe_command);
 		}
 
-	socket_id=ConnectServer(hostname,119, 0);
+	socket_id=ConnectServer(hostname, port, 0);
 
 	/* two file descriptor are for portability among diff systems */
 	createFd(socket_id, socket_fp);

--Multipart_Wed_Dec__1_14:29:57_1999-1
Content-Type: text/plain; charset=US-ASCII
Content-Disposition: attachment; filename="patch-ac"
Content-Transfer-Encoding: 7bit

--- newsfetch.1.orig	Tue Apr 14 20:04:25 1998
+++ newsfetch.1	Wed Dec  1 13:29:35 1999
@@ -5,7 +5,7 @@
 .SH SYNOPSIS
 .B newsfetch
 .BI
-hostname
+hostname[:port]
 [
 .BI \-clsyvV
 ]

--Multipart_Wed_Dec__1_14:29:57_1999-1--

>Release-Note:
>Audit-Trail:
>Unformatted:
 --Multipart_Wed_Dec__1_14:29:57_1999-1
 Content-Type: text/plain; charset=US-ASCII
 


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?86g0xnz0ru.wl>