[news.software.nntp] unofficial patch to news 2.11

sob@watson.bcm.tmc.edu (Stan Barber) (09/19/88)

This patch is "unofficial". That is it is not being posted by Rick Adams.
I have had large numbers of questions about NNTP and News 2.11 and had
this patch been posted officially, I probably would not have had to 
answer them. Rick has had this patch sent to him at least twice....
Ah, well. That's life I guess. Anyway, this patch is for news 2.11.14.
If you need this patch in the future, you can retrieve if from the Baylor
College of Medicine Archive Server. Send mail to "archive-server@bcm.tmc.edu".
In the message, put this line:

send public news.patch.15

This patch will be returned in the mail. You will also find the official
patches to nntp 1.5 there as well.

Description:
1. Corrects localize.nntp and Makefile.dst to account for changes made
to integrate the nfs support.
2. Fixes readnews and vnews /tmp space usage. It will now remove all
tmp files it creates. Formerly, the tmp files were not removed.
3. Fixes the 'l' and 'L' commands of vnews and readnews. Formerly, they
were always one less than they should have been.

Fix:
Change directory the the news sources and use patch to apply the following.


*** localize.nntp	Mon Oct 19 02:07:50 1987
--- ../src/localize.nntp	Mon Mar  7 19:52:13 1988
***************
*** 2,30 ****
  # The file "localize.nntp" should be used as a starting point from which
  # to build a localize.sh from which nntp-capable programs can be built.
  # Basically, you can use the regular localize.sh you use and add those line
! # that contain #NNTP, NNTPSRC and SERVERFILE to make it work.
  # The string NNTPSRC should be replaced with the location of your nntp source
! # directory. The string SERVERFILE should be replaced with the location of
! # the serverfile. See the nntp (Version 1.4) instructions for more information.
  # 
! # You will need nntp version 1.4 to make full use of these programs. They
! # make some use of the XHDR extenstion in nntp version 1.4.
  # 
  # You do not need to include any reference to the dbm library. DBM may remain
! # undefined. You may also want to remove $(OTHERS) from the line in the
! # Makefile that starts with "all:".
  # 
  # You may want to include the line that begins with #RESOLVE in localize.sh
! # if you want to link against the resolver library. I use it on my suns.
  # 
- # You will need to create a "mailpaths" file on each host that uses these
- # programs. See the regular news documenation for information on the
- # mailpaths file.
- # 
  # PROBLEMS:
  # 
  # 1. Distribution checking is disabled in postnews. nntp does not provide this
! # information, so postnews cannot check the article before posting.
  # 
  # 2. History file support is marginal. nntp does not provided direct access
  # to the history file information. nntp can tell if an article is not avail-
--- 2,34 ----
  # The file "localize.nntp" should be used as a starting point from which
  # to build a localize.sh from which nntp-capable programs can be built.
  # Basically, you can use the regular localize.sh you use and add those line
! # that contain #NNTP and NNTPSRC to make it work. You will need two
! # localize.sh files. One will be for the SERVER where you build the regular
! # inews and run the nntpd server. The other will be for the nntp clients.
! # On these machines, you will only build readnews, checknews, vnews and 
! # postnews. You only need the parts of the nntp distribution that are in the
! # common directory to build these programs. You will also need the inews 
! # program from nntp distribution.
! #
  # The string NNTPSRC should be replaced with the location of your nntp source
! # directory. 
  # 
! # You will need nntp version 1.5 to make full use of these programs. They
! # make some use of the XHDR extenstion in nntp version 1.5. They will work
! # with nntp 1.3. If you use nntp 1.4, please manually edit nntp.c to include
! # "response_codes.h". Look at the beginning of the file for details.
  # 
  # You do not need to include any reference to the dbm library. DBM may remain
! # undefined.
  # 
  # You may want to include the line that begins with #RESOLVE in localize.sh
! # if you want to link against the resolver library.
  # 
  # PROBLEMS:
  # 
  # 1. Distribution checking is disabled in postnews. nntp does not provide this
! # information, so postnews cannot check the article before posting. However,
! # nntp will return status information if the article fails to post.
  # 
  # 2. History file support is marginal. nntp does not provided direct access
  # to the history file information. nntp can tell if an article is not avail-
***************
*** 33,45 ****
  # 
  # 3. The recording feature is available, but you have to implement it on each
  # host that uses these programs. nntp does not provide this information from
! # the server.
  # 
  # 4. sys file searching is disabled. Again, nntp does not provide access to 
  # this information from the server.
  # 
! # 5. XHDR support is necessary for some functions to work. This can be rewritten
! # to avoid this, but I have not done it yet.
  # 
  # FINALLY
  # 
--- 37,49 ----
  # 
  # 3. The recording feature is available, but you have to implement it on each
  # host that uses these programs. nntp does not provide this information from
! # the server. 
  # 
  # 4. sys file searching is disabled. Again, nntp does not provide access to 
  # this information from the server.
  # 
! # 5. XHDR support is necessary for some functions to work. This can be
! # rewritten to avoid this. nntp 1.5 is available which does support this.
  # 
  # FINALLY
  # 
***************
*** 66,76 ****
  g/^#VMS /d
  g/^#BSD4_3 /d
  g/^#BSD4_1 /d
! g/^all:/s/$(OTHERS)//
  g/#NOTVMS/s/#NOTVMS//
! g/-DDBM/s/-DDBM//
! g/-ldbm/s/-ldbm//
! g/NNTPSRC/s/NNTPSRC/\/usr\/src\/nntp/
  w
  q
  EOF
--- 70,84 ----
  g/^#VMS /d
  g/^#BSD4_3 /d
  g/^#BSD4_1 /d
! g/^BINDIR/s/bin/local\/bin/
! g/^NEWSUSR/s/news/usenet/
! g/^LIBS/s/-ldbm//
! g/^LNRNEWS/s/ln/ln -s/
! g/^RNEWS/s/$(BINDIR)/\/usr\/bin/
! g/^UUXFLAGS/s/-r/-gN -r/
  g/#NOTVMS/s/#NOTVMS//
! g/-DDBM/s/-DDBM/-DNOSHELL/
! g/NNTPSRC/s/NNTPSRC/\/usr\/src\/new\/nntp.1.5/
  w
  q
  EOF
***************
*** 78,84 ****
  cp defs.dist defs.h
  chmod u+w defs.h
  ed defs.h << 'EOF'
! g/NNTPSRC/s/NNTPSRC/\usr\/src\/nntp/
  g/SERVERFILE/s/SERVERFILE/\/usr\/lib\/news\/server/
  w
  q
--- 86,103 ----
  cp defs.dist defs.h
  chmod u+w defs.h
  ed defs.h << 'EOF'
! g/DOXREFS/s/^\/\* //
! g/NICENESS/s/^\/\* //
! g/PATH/s/=/=\/usr/
! g/UUPROG/s/^\/\* //
! g/INTERNET/s/^\/\* //
! g/SENDMAIL/s/^\/\* //
! g/ORGDISTRIB/s/^\/\* //
! g/ GHNAME/s/^\/\* //
! g/ BSD4_2/s/^\/\* //
! g/GENERICPATH/s/^\/\* //
! g/GENERICFROM/s/^\/\* //
! g/NNTPSRC/s/NNTPSRC/\/usr\/src\/new\/nntp.1.5/
  g/SERVERFILE/s/SERVERFILE/\/usr\/lib\/news\/server/
  w
  q
***************
*** 90,92 ****
--- 109,113 ----
  echo "Finally, please set your organization name in defs.h"
  echo "Look for #define MYORG for the string to alter."
  echo "Good Luck."
+ 
+ 
*** nntp.c	Mon Mar  7 04:50:30 1988
--- ../src/nntp.c	Mon Mar  7 05:52:55 1988
***************
*** 21,26 ****
--- 21,33 ----
  
  /* from nntp's common directory */
  #include "conf.h"
+ #ifdef SERVER_HOST
+ /* nntp 1.3 or earlier */
+ #include "response_codes.h"
+ #else
+ /* nntp 1.5 or later */
+ #include "nntp.h"
+ #endif
  
  static char *nntpserver;
  static char ser_line[256];
*** rfuncs.c	Mon Mar  7 04:50:36 1988
--- ../src/rfuncs.c	Mon Mar  7 05:40:31 1988
***************
*** 804,810 ****
  		lg_array = (int *) malloc(alloc_size);
  	}
  #ifdef SERVER
! 	for(i = lowgp; i < highgp; i++){
  #else	/* !SERVER */
  	while ((dir = readdir(dirp)) != NULL) {
  		if (dir->d_ino == 0)
--- 804,810 ----
  		lg_array = (int *) malloc(alloc_size);
  	}
  #ifdef SERVER
! 	for(i = lowgp; i <= highgp; i++){
  #else	/* !SERVER */
  	while ((dir = readdir(dirp)) != NULL) {
  		if (dir->d_ino == 0)
*** defs.dist	Mon Mar  7 04:50:22 1988
--- ../src/defs.dist	Mon Mar  7 20:16:28 1988
***************
*** 127,138 ****
  #define PERHAPS	2	/* indeterminate boolean value			*/
  #define NGDELIM	','	/* delimit character in news group line		*/
  
- /* for NNTP */
- #ifdef SERVER
- # include "NNTPSRC/common/response_codes.h"
- # define SERVER_FILE "SERVERFILE"
- #endif /* SERVER */
- 
  #ifdef M_XENIX
  #define index	strchr
  #define rindex	strrchr
--- 127,132 ----
*** Makefile.dst	Mon Mar  7 20:17:21 1988
--- ../src/Makefile.dst	Mon Mar  7 05:03:51 1988
***************
*** 32,38 ****
  MINDISKFREE = 0
  SPOOL_DISK = /usr/spool
  
! #NNTP NNTPDIR = NNTPLOC
  
  LNRNEWS = ln
  #VMS LNRNEWS = cp	# No links in Eunice
--- 32,38 ----
  MINDISKFREE = 0
  SPOOL_DISK = /usr/spool
  
! #NNTP NNTPDIR = NNTPSRC
  
  LNRNEWS = ln
  #VMS LNRNEWS = cp	# No links in Eunice
***************
*** 44,49 ****
--- 44,50 ----
  # Order is important here
  INST = full
  #NFSCLIENT INST = nfs
+ #NNTP INST = nntp
  
  #NFSCLIENT NFSCLIENT= -DNFSCLIENT
  NFSSPOOLDIR = /nfsnews/$(SPOOLDIR)
***************
*** 128,133 ****
--- 129,135 ----
  	encode decode $(COMPRESS)
  SCRIPTS = sendbatch rmgroup checkgroups
  NFSOTHERS = inews
+ NNTPOTHERS = 
  OTHERS = $(NFSOTHERS) $(UTILS) $(SCRIPTS)
  COMMANDS = readnews checknews postnews vnews
  
***************
*** 138,143 ****
--- 140,147 ----
  
  nfsall: $(P) $(NFSOTHERS) $(COMMANDS)
  
+ nntpall: $(P) $(NNTPOTHERS) $(COMMANDS)
+ 
  install: $(INST)install
  
  fullinstall: all help vnews.help installit
***************
*** 179,184 ****
--- 183,199 ----
  	-rm -f $(DESTDIR)$(BINDIR)/rnews
  #VMS 	vms -v @euninstal
  
+ nntpinstall: nntpall help vnews.help
+ 	chmod 755 ./installit
+ 	-test -d $(DESTDIR)$(BINDIR) || mkdir $(DESTDIR)$(BINDIR)
+ 	-test -d $(DESTDIR)$(LIBDIR) || mkdir $(DESTDIR)$(LIBDIR)
+ 	for i in $(COMMANDS); do \
+ 		./installit -m 755 -o $(NEWSUSR) -g $(NEWSGRP) -s $$i \
+ 			$(DESTDIR)$(BINDIR); \
+ 	done
+ 	cp help vnews.help $(DESTDIR)$(LIBDIR)
+ #VMS 	vms -v @euninstal
+ 
  defs.h:	defs.dist localize.sh Makefile.dst Makefile
  	sh localize.sh
  	@echo Localize has been run. Restart the make.
***************
*** 200,206 ****
  	chown root $(DESTDIR)$(LIBDIR)/inews
  	chmod 6755 $(DESTDIR)$(LIBDIR)/inews
  
! 
  clean:
  	rm -f $(COMMANDS) $(OTHERS) *.o a.out
  	rm -f core index errs getdate.c
--- 215,223 ----
  	chown root $(DESTDIR)$(LIBDIR)/inews
  	chmod 6755 $(DESTDIR)$(LIBDIR)/inews
  
! nntpupdate: 
! 	@echo "There is no update for NNTP clients as yet."
! 	
  clean:
  	rm -f $(COMMANDS) $(OTHERS) *.o a.out
  	rm -f core index errs getdate.c
*** readr.c	Mon Mar  7 04:50:34 1988
--- ../src/readr.c	Mon Mar  7 22:18:56 1988
***************
*** 1101,1107 ****
  			(void) sprintf(bfr,"STAT %ld",tnum);
  			put_server(bfr);
  			(void) get_server(workspace,sizeof(workspace));
! 			if (*workspace != CHAR_OK) {
  				if (rflag)
  					tnum++;
  				else
--- 1101,1107 ----
  			(void) sprintf(bfr,"STAT %ld",tnum);
  			put_server(bfr);
  			(void) get_server(workspace,sizeof(workspace));
! 			if (*workspace != '2') {
  				if (rflag)
  					tnum++;
  				else
***************
*** 1256,1262 ****
  		(void) unlink(ACTIVE);
  #endif /* SORTACTIVE */
  #ifdef SERVER
! 	(void) unlink(active_name());
  	close_server();	
  #endif	/* SERVER */
  	exit(status);
--- 1256,1265 ----
  		(void) unlink(ACTIVE);
  #endif /* SORTACTIVE */
  #ifdef SERVER
! 	if (active_name() != NULL) 
! 		(void) unlink(active_name());
! 	if (article_name() != NULL) 
! 		(void) unlink(article_name());
  	close_server();	
  #endif	/* SERVER */
  	exit(status);
*** funcs2.c	Mon Mar  7 04:50:26 1988
--- ../src/funcs2.c	Mon Mar  7 22:23:01 1988
***************
*** 476,487 ****
  	(void) sprintf(lbuf,"STAT %s",oidbuf);
  	put_server(lbuf);
  	(void) get_server(workspace,sizeof(workspace));
! 	if (*workspace != CHAR_OK)
  		return NULL;
  	(void) sprintf(lbuf,"XHDR xref %s",oidbuf);
  	put_server(lbuf);
  	(void) get_server(workspace,sizeof(workspace));	/* get response */
! 	if (*workspace != CHAR_OK)
  		return NULL;		/* old style nntp */
  	(void) get_server(workspace,sizeof(workspace)); /* get header line */
  	sync_server();	/* get rid of the rest of it */
--- 476,487 ----
  	(void) sprintf(lbuf,"STAT %s",oidbuf);
  	put_server(lbuf);
  	(void) get_server(workspace,sizeof(workspace));
! 	if (*workspace != '2')
  		return NULL;
  	(void) sprintf(lbuf,"XHDR xref %s",oidbuf);
  	put_server(lbuf);
  	(void) get_server(workspace,sizeof(workspace));	/* get response */
! 	if (*workspace != '2')
  		return NULL;		/* old style nntp */
  	(void) get_server(workspace,sizeof(workspace)); /* get header line */
  	sync_server();	/* get rid of the rest of it */
***************
*** 495,501 ****
  		(void) sprintf(lbuf,"XHDR newsgroups %s",oidbuf);
  		put_server(lbuf);
  		(void) get_server(workspace,sizeof(workspace));
! 		if (*workspace != CHAR_OK)
  			return NULL;
  		(void) get_server(workspace,sizeof(workspace));
  		sync_server();
--- 495,501 ----
  		(void) sprintf(lbuf,"XHDR newsgroups %s",oidbuf);
  		put_server(lbuf);
  		(void) get_server(workspace,sizeof(workspace));
! 		if (*workspace != '2')
  			return NULL;
  		(void) get_server(workspace,sizeof(workspace));
  		sync_server();
***************
*** 517,523 ****
  		(void) sprintf(lbuf, "XHDR message-id %d-%d", sm, s);
  		put_server(lbuf);
  		(void) get_server(workspace,sizeof(workspace));
! 		if (*workspace != CHAR_OK)
  			return NULL;
  		while (	get_server(workspace,sizeof(workspace)) >= 0) {
  			if (*workspace == '.'  && strlen(workspace) == 1) 
--- 517,523 ----
  		(void) sprintf(lbuf, "XHDR message-id %d-%d", sm, s);
  		put_server(lbuf);
  		(void) get_server(workspace,sizeof(workspace));
! 		if (*workspace != '2')
  			return NULL;
  		while (	get_server(workspace,sizeof(workspace)) >= 0) {
  			if (*workspace == '.'  && strlen(workspace) == 1) 
*** visual.c	Mon Mar  7 04:50:39 1988
--- ../src/visual.c	Mon Mar  7 22:32:30 1988
***************
*** 684,689 ****
--- 684,690 ----
  		cancel_command();
  		break;
  
+ #ifndef NOSHELL
  	/* escape to shell */
  	case '!': {
  		register char *p;
***************
*** 715,721 ****
  		shcmd(linebuf, flags);
  		break;
  	}
! 
  	/* mail reply */
  	case 'r':
  		reply(FALSE);
--- 716,722 ----
  		shcmd(linebuf, flags);
  		break;
  	}
! #endif 	/* NOSHELL */
  	/* mail reply */
  	case 'r':
  		reply(FALSE);
***************
*** 1196,1201 ****
--- 1197,1203 ----
  	if (rcreadok)
  		rcreadok = 2;	/* have seen >= 1 article */
  #ifdef SERVER
+  	if (article_name() != NULL) (void) unlink(article_name());
  	if (bit == 0  || (fp = getarticle(groupdir, bit, "ARTICLE")) == NULL)
  		goto badart;
  	strcpy(filename, article_name());
***************
*** 1235,1241 ****
  			(void) sprintf(bfr,"STAT %ld",tnum);
  			put_server(bfr);
  			(void) get_server(workspace,sizeof(workspace));
! 			if (*workspace != CHAR_OK) {
  				if (rflag)
  					tnum++;
  				else
--- 1237,1243 ----
  			(void) sprintf(bfr,"STAT %ld",tnum);
  			put_server(bfr);
  			(void) get_server(workspace,sizeof(workspace));
! 			if (*workspace != '2') {
  				if (rflag)
  					tnum++;
  				else
***************
*** 2697,2703 ****
  		(void) unlink(ACTIVE);
  #endif /* SORTACTIVE */
  #ifdef SERVER
! 	(void) unlink(active_name());
  	close_server();	
  #endif	/* SERVER */
  	if (ospeed) {	/* is == 0, we haven't been in raw mode yet */
--- 2699,2708 ----
  		(void) unlink(ACTIVE);
  #endif /* SORTACTIVE */
  #ifdef SERVER
! 	if (active_name() != NULL)
! 		(void) unlink(active_name());
! 	if (article_name() != NULL)
! 		(void) unlink(article_name());
  	close_server();	
  #endif	/* SERVER */
  	if (ospeed) {	/* is == 0, we haven't been in raw mode yet */
Stan           internet: sob@bcm.tmc.edu         Baylor College of Medicine
Olan           uucp: {rice,killer,hoptoad}!academ!sob
Barber         Opinions expressed are only mine.