[5465] in Athena Bugs

home help back first fref pref prev next nref lref last post

hesiod for 7.1

daemon@ATHENA.MIT.EDU (Mark Rosenstein)
Tue Jul 10 21:32:12 1990

Date: Mon, 9 Jul 90 18:56:15 -0400
From: Mark Rosenstein <mar@MIT.EDU>
To: bugs@MIT.EDU

OK, jik, these diffs fix
	changes.70 #43
	changes.70 #45
	changes.70 #621
	epeisach: "vax 6.4r Hesiod library lint error" Sat, 14 Apr 90 11:40:28 -0400

The source this is taken from is /mit/hesioddev/src/...

This isn't a formal project, but I'm pretty much the project leader
anyway.  If you can find someone to audit them, great.  If not, a few
of them should go in anyway, as they've been in the public release for
a long time and are known to work.

This time I'll enclose the diffs too.
					-Mark

*** /source/bsd-4.3/common/lib/libc/net/res_debug.c	Mon Jul  9 10:48:18 1990
--- ./res_debug.c	Mon Jul  9 18:23:14 1990
***************
*** 222,227 ****
--- 222,228 ----
  	case T_A:
  		switch (class) {
  		case C_IN:
+ 		case C_HS:
  			bcopy(cp, (char *)&inaddr, sizeof(inaddr));
  			if (dlen == 4) {
  				fprintf(file,"\tinternet address = %s\n",
*** /source/bsd-4.3/common/etc/named/db_dump.c	Thu Nov 16 06:41:40 1989
--- ./db_dump.c	Wed Nov 22 17:35:25 1989
***************
*** 365,370 ****
--- 365,371 ----
  			case T_A:
  				switch (dp->d_class) {
  				case C_IN:
+ 				case C_HS:
  					GETLONG(n, cp);
  					n = htonl(n);
  					fprintf(fp, "%s",
*** /source/bsd-4.3/common/etc/named/ns_sort.c	Mon Apr  3 17:19:09 1989
--- ./ns_sort.c	Wed Nov 22 17:35:55 1989
***************
*** 113,118 ****
--- 113,119 ----
  	    case T_A:
  	    	switch (class) {
  	    	case C_IN:
+ 		case C_HS:
  	    		bcopy(cp, (char *)&inaddr, sizeof(inaddr));
  			if (rr1 == NULL)
  				rr1 = cp;
*** /source/bsd-4.3/common/etc/named/xfer.c	Thu Nov 16 06:41:58 1989
--- ./xfer.c	Fri Mar 23 15:26:58 1990
***************
*** 50,56 ****
  char	*savestr();
  
  /* max length of data in RR data field */
! #define MAXDATA		256	/* from db.h */
   
  int	debug = 0; 
  int	quiet = 0;
--- 50,56 ----
  char	*savestr();
  
  /* max length of data in RR data field */
! #define MAXDATA		2048	/* from db_load.c XXX */
   
  int	debug = 0; 
  int	quiet = 0;
***************
*** 1037,1042 ****
--- 1037,1043 ----
  	case T_A:
  		switch (class) {
  		case C_IN:
+ 		case C_HS:
  			GETLONG(n, cp);
  			n = htonl(n);
  			(void) fprintf(dbfp, "%s",
*** /usr/man/man3/hesiod.3	Thu May  3 20:05:42 1990
--- ./hesiod.3	Mon Jul  9 18:38:41 1990
***************
*** 3,13 ****
  .\"
  .\" Original version by Steve Dyer, IBM/Project Athena.
  .\"
! .\"	$Author: probe $
! .\"	$Source: /paris/source/4.3/athena.lib/hesiod/RCS/hesiod.3,v $
  .\"	$Athena: hesiod.3,v 1.3 88/08/07 21:52:25 treese Locked $
! .\"	$Header: /paris/source/4.3/athena.lib/hesiod/RCS/hesiod.3,v 1.5 89/12/03 18:08:32 probe Exp $
! .\"
  .TH HESIOD 3 "2 April 1987"
  .SH NAME
  hesiod \- C Language Hesiod name server Interface Library
--- 3,12 ----
  .\"
  .\" Original version by Steve Dyer, IBM/Project Athena.
  .\"
! .\"	$Author: treese $
! .\"	$Source: /mit/hesioddev/distsrc/hesiod/RCS/hesiod.3,v $
  .\"	$Athena: hesiod.3,v 1.3 88/08/07 21:52:25 treese Locked $
! .\"	$Header: /mit/hesioddev/distsrc/hesiod/RCS/hesiod.3,v 1.4 88/08/07 23:17:54 treese Exp Locker: mar $
  .TH HESIOD 3 "2 April 1987"
  .SH NAME
  hesiod \- C Language Hesiod name server Interface Library
***************
*** 31,37 ****
  containing Hesiod data, or NULL if there is any error.  The
  function
  .I hes_error
! may be called to determine the source of the error.
  .SH FILES
  /usr/include/hesiod.h, /etc/hesiod.conf
  .SH "SEE ALSO"
--- 30,38 ----
  containing Hesiod data, or NULL if there is any error.  The
  function
  .I hes_error
! may be called to determine the source of the error.  It will return
! one of the HES_ER_* codes defined in
! .I hesiod.h.
  .SH FILES
  /usr/include/hesiod.h, /etc/hesiod.conf
  .SH "SEE ALSO"
*** /usr/include/hesiod.h	Thu May  3 20:05:32 1990
--- ./hesiod.h	Mon Jul  9 18:41:15 1990
***************
*** 6,15 ****
   * Original version by Steve Dyer, IBM/Project Athena.
   *
   *	$Author: treese $
!  *	$Athena: hesiod.h,v 1.3 88/08/07 21:52:39 treese Exp $
!  *	$Header: hesiod.h,v 1.3 88/08/07 21:52:39 treese Exp $
   *	$Source: /mit/hesioddev/distsrc/hesiod/RCS/hesiod.h,v $
   *	$Log:	hesiod.h,v $
   * Revision 1.3  88/08/07  21:52:39  treese
   * First public distribution
   * 
--- 6,18 ----
   * Original version by Steve Dyer, IBM/Project Athena.
   *
   *	$Author: treese $
!  *	$Athena: hesiod.h,v 1.3 88/08/07 21:52:39 treese Locked $
!  *	$Header: /mit/hesioddev/distsrc/hesiod/RCS/hesiod.h,v 1.4 88/08/07 23:18:00 treese Exp Locker: mar $
   *	$Source: /mit/hesioddev/distsrc/hesiod/RCS/hesiod.h,v $
   *	$Log:	hesiod.h,v $
+  * Revision 1.4  88/08/07  23:18:00  treese
+  * Second-public-distribution
+  * 
   * Revision 1.3  88/08/07  21:52:39  treese
   * First public distribution
   * 
***************
*** 36,41 ****
--- 39,45 ----
  
  char *hes_to_bind();
  char **hes_resolve();
+ int hes_error();
  
  /* For use in getting post-office information. */
  
***************
*** 45,48 ****
--- 49,56 ----
  	char	*po_name;
  };
  
+ /* Other routines */
+ 
  struct hes_postoffice *hes_getmailhost();
+ struct servent *hes_getservbyname();
+ struct pwent *hes_getpwnam();
*** /source/athena/athena.lib/hesiod/hesiod.c	Thu Nov 16 06:49:52 1989
--- ./hesiod.c	Tue Mar  6 12:48:56 1990
***************
*** 1,9 ****
  /* This file is part of the Hesiod library.
   *
!  *	$Source: /paris/source/4.3/athena.lib/hesiod/RCS/hesiod.c,v $
!  *	$Author: probe $
   *	$Athena: hesiod.c,v 1.5 88/08/07 22:00:44 treese Locked $
   *	$Log:	hesiod.c,v $
   * Revision 1.7  89/11/16  06:49:31  probe
   * Uses T_TXT, as defined in the RFC.
   * 
--- 1,13 ----
  /* This file is part of the Hesiod library.
   *
!  *	$Source: /mit/hesioddev/hesiod.dist/hesiod/RCS/hesiod.c,v $
!  *	$Author: mar $
   *	$Athena: hesiod.c,v 1.5 88/08/07 22:00:44 treese Locked $
   *	$Log:	hesiod.c,v $
+  * Revision 1.3  90/03/06  12:48:28  mar
+  * Allow the environment variable HES_DOMAIN to override the config file
+  * or the compiled in default
+  * 
   * Revision 1.7  89/11/16  06:49:31  probe
   * Uses T_TXT, as defined in the RFC.
   * 
***************
*** 45,51 ****
  #include "mit-copyright.h"
  
  #ifndef lint
! static char rcsid_hesiod_c[] = "$Header: /paris/source/4.3/athena.lib/hesiod/RCS/hesiod.c,v 1.7 89/11/16 06:49:31 probe Exp $";
  #endif
  
  #include <stdio.h>
--- 49,55 ----
  #include "mit-copyright.h"
  
  #ifndef lint
! static char rcsid_hesiod_c[] = "$Header: /mit/hesioddev/hesiod.dist/hesiod/RCS/hesiod.c,v 1.3 90/03/06 12:48:28 mar Exp $";
  #endif
  
  #include <stdio.h>
***************
*** 82,114 ****
  		/* no file or no access uses defaults */
  		/* but poorly formed file returns error */
  		Hes_LHS = DEF_LHS; Hes_RHS = DEF_RHS;
! 		Hes_Errno = HES_ER_OK;
! 		return(Hes_Errno);
! 	}
! 	while(fgets(buf, MAXDNAME+7, fp) != NULL) {
! 		cp = buf;
! 		if (*cp == '#' || *cp == '\n') continue;
! 		while(*cp == ' ' || *cp == '\t') cp++;
! 		key = cp;
! 		while(*cp != ' ' && *cp != '\t' && *cp != '=') cp++;
! 		*cp++ = '\0';
! 		if (strcmp(key, "lhs") == 0) cpp = &Hes_LHS;
! 		else if (strcmp(key, "rhs") == 0) cpp = &Hes_RHS;
! 		else continue;
! 		while(*cp == ' ' || *cp == '\t' || *cp == '=') cp++;
! 		if (*cp != '.') {
! 			Hes_Errno = HES_ER_CONFIG;
! 			return(Hes_Errno);
  		}
! 		len = strlen(cp);
! 		*cpp = calloc((unsigned int) len, sizeof(char));
! 		(void) strncpy(*cpp, cp, len-1);
  	}
  	/* the LHS may be null, the RHS must not be null */
  	if (Hes_RHS == NULL)
  		Hes_Errno = HES_ER_CONFIG;
  	else
! 		Hes_Errno = HES_ER_OK;
  	return(Hes_Errno);
  }
  
--- 86,122 ----
  		/* no file or no access uses defaults */
  		/* but poorly formed file returns error */
  		Hes_LHS = DEF_LHS; Hes_RHS = DEF_RHS;
! 	} else {
! 		while(fgets(buf, MAXDNAME+7, fp) != NULL) {
! 			cp = buf;
! 			if (*cp == '#' || *cp == '\n') continue;
! 			while(*cp == ' ' || *cp == '\t') cp++;
! 			key = cp;
! 			while(*cp != ' ' && *cp != '\t' && *cp != '=') cp++;
! 			*cp++ = '\0';
! 			if (strcmp(key, "lhs") == 0) cpp = &Hes_LHS;
! 			else if (strcmp(key, "rhs") == 0) cpp = &Hes_RHS;
! 			else continue;
! 			while(*cp == ' ' || *cp == '\t' || *cp == '=') cp++;
! 			if (*cp != '.') {
! 				Hes_Errno = HES_ER_CONFIG;
! 				fclose(fp);
! 				return(Hes_Errno);
! 			}
! 			len = strlen(cp);
! 			*cpp = calloc((unsigned int) len, sizeof(char));
! 			(void) strncpy(*cpp, cp, len-1);
  		}
! 		fclose(fp);
  	}
+ 	/* see if the RHS is overridden by environment variable */
+ 	if ((cp = getenv("HES_DOMAIN")) != NULL)
+ 		Hes_RHS = strcpy(malloc(strlen(cp)+1),cp);
  	/* the LHS may be null, the RHS must not be null */
  	if (Hes_RHS == NULL)
  		Hes_Errno = HES_ER_CONFIG;
  	else
! 		Hes_Errno = HES_ER_OK;	
  	return(Hes_Errno);
  }
  



home help back first fref pref prev next nref lref last post