🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
4 messages
4 total messages Started by Bill Neely Mon, 09 Mar 1998 00:00
INN - change port
#26697
Author: Bill Neely
Date: Mon, 09 Mar 1998 00:00
12 lines
941 bytes
Can anyone tell me how to fire up INN (1.5) on a port other than 119.

Thanks.
-- 
Bill
Global Communications Technology
Typography Express, Inc.
(707) 586-3557
http://www.gct-us.com

Re: INN - change port
#26718
Author: st. paul's wort
Date: Mon, 09 Mar 1998 00:00
14 lines
966 bytes
In article <3504B536.33D48839@gct-us.com>,
Bill Neely  <billn@gct-us.com> wrote:
>Can anyone tell me how to fire up INN (1.5) on a port other than 119.

You need to change it in the source.  There is no runtime option for
it in 1.5.x or 1.7.x.

rone
-- 
The finest day that i ever had
Was when i learned to cry on demand

Re: INN - change port
#26722
Author: Todd C Miller
Date: Tue, 10 Mar 1998 00:00
86 lines
3271 bytes
From the keyboard of Bill Neely <billn@gct-us.com>:
> Can anyone tell me how to fire up INN (1.5) on a port other than 119.

This simple patch adds a -P option to inndstart indicating which
port innd should listen on.  I use this to run innd on port 433
(nnsp) nnrpd out of inetd on port 119 (nntp).  I used to just change
NNTP_PORT but there are things like actsync that use NNTP_PORT and
don't give you the option of overriding it.  Just because you want
the server to run on a different port it doesn't follow that all
the client progs should use that port too.

 - todd

*** innd/inndstart.c.DIST	Tue Oct  7 09:18:04 1997
--- innd/inndstart.c	Wed Nov  5 21:04:32 1997
***************
*** 71,76 ****
--- 71,77 ----
      char		buff[BUFSIZ];
      STRING		env[8];
      struct stat		Sb;
+     unsigned short	port;
  
      (void)openlog("inndstart", L_OPENLOG_FLAGS, LOG_INN_PROG);
  
***************
*** 82,87 ****
--- 83,99 ----
      NewsUID = Sb.st_uid;
      NewsGID = Sb.st_gid;
  
+     /* Did they give us -Pport? */
+     for (port = 0, i = 1; av[i]; i++) {
+ 	if (strncmp(av[i], "-P", 2) == 0) {
+ 	    if (av[i][2] != '\0' && (port = atoi(&av[i][2])) != 0)
+ 		    port = htons(port);
+ 	    break;
+ 	}
+     }
+     if (port == 0)
+ 	port = htons(NNTP_PORT);
+ 
      if (setgroups(1, &NewsGID) < 0)
          syslog(L_ERROR, "inndstart cant setgroups %m");
      
***************
*** 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) {
--- 112,118 ----
  	syslog(L_ERROR, "inndstart cant setsockopt %m");
  #endif	/* defined(SO_REUSEADDR) */
      (void)memset((POINTER)&server, 0, sizeof server);
!     server.sin_port = port;
      server.sin_family = AF_INET;
      server.sin_addr.s_addr = htonl(INADDR_ANY);
      if (bind(i, (struct sockaddr *)&server, sizeof server) < 0) {
***************
*** 121,128 ****
      argv[j++] = _PATH_INND;
      argv[j++] = pflag;
      for (i = 1; av[i]; ) {
! 	if (strncmp(av[i], "-p", 2) != 0)
! 	argv[j++] = av[i++];
  	else
  	    i++;
      }
--- 133,140 ----
      argv[j++] = _PATH_INND;
      argv[j++] = pflag;
      for (i = 1; av[i]; ) {
! 	if (av[i][0] != '-' || (av[i][1] != 'p' && av[i][1] != 'P'))
! 	    argv[j++] = av[i++];
  	else
  	    i++;
      }
-- 
     Todd C. Miller    Sysadmin/Consultant     Todd.Miller@courtesan.com

Re: INN - change port
#26748
Author: Fluffy
Date: Tue, 10 Mar 1998 00:00
17 lines
1437 bytes
Bill Neely <billn@gct-us.com> wrote:
: Can anyone tell me how to fire up INN (1.5) on a port other than 119.

Look in include/configdata.h (not in config/config.data, that wouldn't work)
and change the value of NNTP_PORT.  Yes, this means you have build a new
innd to change the port, but how often are you going to do this? =)

Remember that if you change INN's port, clients won't be able to connect to
nnrpd.  Just add nnrpd to inetd (or tcpserver if that's what you use) to run
from the normal port 119 and you should be in business.

If you decide to move binaries manually instead of using the scripts, don't
forget to copy over the new inndstart too, and to make the new binaries'
permissions exactly like the old ones.

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads