🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #3941

problems with nntpclnt-1.6.1

#3941
From: Alexandre Vorobiev
Date: Wed, 08 Nov 1995 00:00
66 lines
3207 bytes
I have the source for nntpclnt-1.6.1.  I run Solaris 2.4 on SparcStations.

Configure does not find getpwent (which exists); this is not the problem,
since there is a built-in support in case getpwent is absent. 
When I compiled the source the first time (compiles fine with
-traditional on gcc 2.6.3), it would not let me post with error
"The name appears to be invalid". I found the problem and fixed it.
Here is the patch:
---------------------------snip--------------------------
*** inews.c-orig        Wed Oct 11 13:49:01 1995
--- inews.c     Tue Oct 10 00:06:34 1995
***************
*** 105,112 ****
                    while (fgets(passwd,sizeof passwd,pfp) != NULL) {
                        if (strncmp(username,passwd,strlen(username)))
                                continue;
!                       if (passwd[(strlen(username)-1)] != ':')
!                               continue;
                        foundit = 1;
                        break;
                        }
--- 105,112 ----
                    while (fgets(passwd,sizeof passwd,pfp) != NULL) {
                        if (strncmp(username,passwd,strlen(username)))
                                continue;
!                       if (passwd[strlen(username)] != ':')
!                               continue; 
                        foundit = 1;
                        break;
                        }
----------------------snip----------------------------
I patched the source, but now inews started segfaulting on me.  I 
narrowed the problem down to one line, however I can't make sense of 
that part of the code:
  file inews.c
  ------------
        cp++;
        for (fullname=cp, i=4; i; i--) { /* magic cookie XXX */
                if (fullname)
                                fullname = index(s,':')+1;
        }
--->>>>        cp = index(fullname,':');
This is the line that segfaults, line 129 (I think).


Next thing I did I compiled it with -DGETPWENT; compiled fine 
but I got a segfault in a different place, also one line:
   file nntpclnt.c
   ---------------
line 160
----->>>>>>    if (cp = getenv("NNTPSERVER")) {
                (void) strcpy(buf, cp);
                return (buf);
        }
 
 the cp = getenv("NNTPSERVER") statement segfaults, which I do not know how
 to fix. I think at this point, if I can get around the last problem, I 
 will be fine.

 Any suggestions would be appreciated.
 Please respond to sasha@cs.swarthmore.edu

 Sasha / sasha@cs.swarthmore.edu


Technical Details
Message-ID: <47pdl5$m89@larch.cc.swarthmore.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.technical.mbox.zip!not-for-mail

Show Full Headers
Complete Article Headers
Message-ID: <47pdl5$m89@larch.cc.swarthmore.edu>
Subject: problems with nntpclnt-1.6.1
Date: Wed, 08 Nov 1995 00:00:00 +0000
From: sasha@condor.sccs.swarthmore.edu (Alexandre Vorobiev)
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.technical.mbox.zip!not-for-mail
X-Deja-AN: 118946804
Distribution: world
Approved: zorch@uunet.UU.NET
Sender: zorch@ftp.UU.NET
Organization: Swarthmore College Computer Society
Newsgroups: news.software.nntp,news.admin.technical