🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #24873

Re: Q: INN on port 120

#24873
From: John Milburn
Date: Mon, 05 Jan 1998 00:00
85 lines
3302 bytes

cddukes@cc04du.unity.ncsu.edu (Christopher D Dukes) writes:
>Miquel van Smoorenburg <miquels@cistron.nl> wrote:

>>>Could someone tell me how to get INN to run on port 120 ?

>>Well it's hardcoded in the source, not even getservbyname() is used. You'll
>>have to recompile ..

>Hrm, I wonder how hard it would be to hack inndstart to offer an option
>for the port.

Not very hard. With the following applied, call inndstart with "-P 120"
and you will run innd on port 120. Can be added to the "FLAGS" variable
in rc.news. I think Steiner Haug did this many moons ago. Applies well to
INN-1.[457]*.

-jem

*** innd/inndstart.c.orig	Wed Oct  8 00:18:04 1997
--- innd/inndstart.c	Thu Nov 13 22:35:35 1997
***************
*** 62,67 ****
--- 62,69 ----
      struct sockaddr_in	server;
      register int	i;
      register int	j;
+     int			argnext = 1;
+     u_short		nntp_port = NNTP_PORT;
  #if	defined(SO_REUSEADDR)
      int			on;
  #endif	/* defined(SO_REUSEADDR) */
***************
*** 73,78 ****
--- 75,87 ----
      struct stat		Sb;

      (void)openlog("inndstart", L_OPENLOG_FLAGS, LOG_INN_PROG);
+
+     /* Any other options than -P <port> are passed to innd */
+     if (ac >= 3 && strncmp(av[1], "-P", 2) == 0) {
+       nntp_port = atoi(av[2]);
+       argnext += 2;
+       ac -= 2;
+     }

      /* Make sure INND directory exists. */
      if (stat(INNDDIR, &Sb) < 0 || !S_ISDIR(Sb.st_mode)) {
***************
*** 100,106 ****
  	syslog(L_ERROR, "inndstart cant setsockopt %m");
  #endif	/* defined(SO_REUSEADDR) */
      (void)memset((POINTER)&server, 0, sizeof server);
!     server.sin_port = htons(NNTP_PORT);
      server.sin_family = AF_INET;
      server.sin_addr.s_addr = htonl(INADDR_ANY);
      if (bind(i, (struct sockaddr *)&server, sizeof server) < 0) {
--- 109,115 ----
  	syslog(L_ERROR, "inndstart cant setsockopt %m");
  #endif	/* defined(SO_REUSEADDR) */
      (void)memset((POINTER)&server, 0, sizeof server);
!     server.sin_port = htons(nntp_port);
      server.sin_family = AF_INET;
      server.sin_addr.s_addr = htonl(INADDR_ANY);
      if (bind(i, (struct sockaddr *)&server, sizeof server) < 0) {
***************
*** 120,126 ****
  #else
      argv[j++] = _PATH_INND;
      argv[j++] = pflag;
!     for (i = 1; av[i]; ) {
  	if (strncmp(av[i], "-p", 2) != 0)
  	argv[j++] = av[i++];
  	else
--- 129,135 ----
  #else
      argv[j++] = _PATH_INND;
      argv[j++] = pflag;
!     for (i = argnext; av[i]; ) {
  	if (strncmp(av[i], "-p", 2) != 0)
  	argv[j++] = av[i++];
  	else

Technical Details
Message-ID: <68q8sd$3bc$1@rtr.xpat.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <68orhc$nm8$1@news2.soco.de> <68p11s$p59$1@defiant.cistron.nl> <68p1fc$4go$1@uni00nw.unity.ncsu.edu>

Show Full Headers
Complete Article Headers
Message-ID: <68q8sd$3bc$1@rtr.xpat.com>
Subject: Re: Q: INN on port 120
Date: Mon, 05 Jan 1998 00:00:00 +0000
From: jem@xpat.com (John Milburn)
References: <68orhc$nm8$1@news2.soco.de> <68p11s$p59$1@defiant.cistron.nl> <68p1fc$4go$1@uni00nw.unity.ncsu.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 312906490
Followup-To: news.software.nntp
Reply-To: jem@xpat.com (John Milburn)
Originator: jem@xpat.com (John Milburn)
Organization: Xpat, Seoul, Korea
Newsgroups: news.software.nntp