Article View: news.software.nntp
Article #18302Re: INN - Changing the NNTP_PORT
From: Steinar Haug
Date: Thu, 05 Jun 1997 00:00
Date: Thu, 05 Jun 1997 00:00
74 lines
2932 bytes
2932 bytes
[Forrest J. Cavalier III]
| Do you have some modifications to inndstart which permit a -p argument?
Sure. See below.
Steinar Haug, Nethelp consulting, sthaug@nethelp.no
----------------------------------------------------------------------
*** inndstart.c.orig Tue Dec 17 15:40:40 1996
--- inndstart.c Thu Feb 13 12:36:45 1997
***************
*** 60,65 ****
--- 60,67 ----
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) */
***************
*** 72,77 ****
--- 74,86 ----
(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)) {
syslog(L_FATAL, "inndstart cant stat %s %m", INNDDIR);
***************
*** 98,104 ****
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) {
--- 107,113 ----
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) {
***************
*** 118,124 ****
#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
--- 127,133 ----
#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:
<5n79of$mgq@verdi.nethelp.no>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-mailReferences:
<5n411l$j2r$1@news> <3396CE30.41C67EA6@zrz.TU-Berlin.DE> <5n6lqr$eck$1@news1.epix.net>Show Full Headers
Complete Article Headers
Message-ID: <5n79of$mgq@verdi.nethelp.no> Subject: Re: INN - Changing the NNTP_PORT Date: Thu, 05 Jun 1997 00:00:00 +0000 From: sthaug@nethelp.no (Steinar Haug) References: <5n411l$j2r$1@news> <3396CE30.41C67EA6@zrz.TU-Berlin.DE> <5n6lqr$eck$1@news1.epix.net> 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: 246395790 Distribution: inet Cache-Post-Path: dole.uninett.no!unknown@verdi.nethelp.no Organization: Nethelp Consulting, Trondheim, Norway Newsgroups: news.software.nntp