[5463] 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:30:04 1990

Date: Tue, 10 Jul 90 15:34:54 -0400
From: Mark Rosenstein <mar@MIT.EDU>
To: bugs@MIT.EDU

This is a second try, hopefully complete.  The diffs I sent yesterday
were only for about half of the files that changed.  Here's a more
detailed changelist as well:

	changes.70 #43: hesiod.h missing declarations and hesiod(3)
	changes.70 #45: byteorder in hes_getservbyname()
	changes.70 #621: support for HES_DOMAIN environment variable
	epeisach: "vax 6.4r Hesiod library lint error" Sat, 14 Apr 90 11:40:28
	support for A/UX: addition of #include <sys/types.h> in resolve.c
	missing Class hesiod support in miscellaneous corners of named
	support for T_TXT in named-xfer

If there are any outstanding Hesiod bugs, please let me know, as I
believe this brings us completely up-to-date.
					-Mark

*** /source/athena/athena.lib/hesiod/hesiod.3	Sun Dec  3 18:08:36 1989
--- /mit/hesioddev/src/hesiod/hesiod.3	Tue Jul 10 15:10:59 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: mar $
! .\"	$Source: /mit/hesioddev/src/hesiod/RCS/hesiod.3,v $
  .\"	$Athena: hesiod.3,v 1.3 88/08/07 21:52:25 treese Locked $
! .\"	$Header: /mit/hesioddev/src/hesiod/RCS/hesiod.3,v 1.6 90/07/10 15:10:43 mar Exp $
  .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,42 ----
  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.
! 
! If the environment variable
! .B HES_DOMAIN
! is set, this domain will override what is in /etc/hesiod.conf.
  .SH FILES
  /usr/include/hesiod.h, /etc/hesiod.conf
  .SH "SEE ALSO"
*** /source/athena/athena.lib/hesiod/hesiod.c	Thu Nov 16 06:49:52 1989
--- /mit/hesioddev/src/hesiod/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);
  }
  
*** /source/athena/athena.lib/hesiod/hesiod.h	Sun Aug  7 21:52:54 1988
--- /mit/hesioddev/src/hesiod/hesiod.h	Mon Jul  9 18:44:47 1990
***************
*** 5,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
   * 
--- 5,21 ----
   *
   * Original version by Steve Dyer, IBM/Project Athena.
   *
!  *	$Author: mar $
!  *	$Athena: hesiod.h,v 1.3 88/08/07 21:52:39 treese Locked $
!  *	$Header: /mit/hesioddev/src/hesiod/RCS/hesiod.h,v 1.5 90/07/09 18:44:30 mar Exp $
!  *	$Source: /mit/hesioddev/src/hesiod/RCS/hesiod.h,v $
   *	$Log:	hesiod.h,v $
+  * Revision 1.5  90/07/09  18:44:30  mar
+  * mention hes_getservbyname(), hes_getpwent()
+  * 
+  * 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 ****
--- 42,48 ----
  
  char *hes_to_bind();
  char **hes_resolve();
+ int hes_error();
  
  /* For use in getting post-office information. */
  
***************
*** 45,48 ****
--- 52,59 ----
  	char	*po_name;
  };
  
+ /* Other routines */
+ 
  struct hes_postoffice *hes_getmailhost();
+ struct servent *hes_getservbyname();
+ struct pwent *hes_getpwnam();
*** /source/athena/athena.lib/hesiod/hesservbyname.c	Wed Oct 18 09:42:50 1989
--- /mit/hesioddev/src/hesiod/hesservbyname.c	Tue Jul 10 15:13:25 1990
***************
*** 12,17 ****
--- 12,19 ----
  #include <stdio.h>
  #include <ctype.h>
  
+ extern char *malloc();
+ 
  #define LISTSIZE 15
  struct servent *
  hes_getservbyname(name, proto)
***************
*** 54,60 ****
  		}
  		aliases[i] = NULL;
  		p->s_name = servicename;
! 		p->s_port = atoi(port);
  		p->s_proto = protoname;
  		p->s_aliases = aliases;
  		return (p);
--- 56,62 ----
  		}
  		aliases[i] = NULL;
  		p->s_name = servicename;
! 		p->s_port = htons((u_short)atoi(port));
  		p->s_proto = protoname;
  		p->s_aliases = aliases;
  		return (p);
*** /source/athena/athena.lib/hesiod/resolve.c	Sun Aug  7 21:59:27 1988
--- /mit/hesioddev/src/hesiod/resolve.c	Tue Jul 10 15:06:44 1990
***************
*** 1,15 ****
  #ifndef lint
! static char *RCS_ID = "$Header: resolve.c,v 1.4 88/08/07 21:58:40 treese Exp $";
  #endif
  /*
!  * $Author: treese $
!  * $Source: /mit/hesioddev/distsrc/hesiod/RCS/resolve.c,v $
!  * $Athena: resolve.c,v 1.4 88/08/07 21:58:40 treese Exp $
   */
  
  #define _RESOLVE_C_
  
  #include <strings.h>
  #include <sys/param.h>
  #include <netinet/in.h>
  #include <sys/errno.h>
--- 1,16 ----
  #ifndef lint
! static char *RCS_ID = "$Header: /mit/hesioddev/src/hesiod/RCS/resolve.c,v 1.6 90/07/10 15:06:30 mar Exp $";
  #endif
  /*
!  * $Author: mar $
!  * $Source: /mit/hesioddev/src/hesiod/RCS/resolve.c,v $
!  * $Athena: resolve.c,v 1.4 88/08/07 21:58:40 treese Locked $
   */
  
  #define _RESOLVE_C_
  
  #include <strings.h>
+ #include <sys/types.h>
  #include <sys/param.h>
  #include <netinet/in.h>
  #include <sys/errno.h>
*** /source/bsd-4.3/common/lib/libc/net/res_debug.c	Mon Jul  9 10:48:18 1990
--- /mit/hesioddev/src/res/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
--- /mit/hesioddev/src/named/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
--- /mit/hesioddev/src/named/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
--- /mit/hesioddev/src/named/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",
***************
*** 1108,1126 ****
  		(void) fprintf(dbfp, "\"%s\"\n", cp);
  		break;
  
! 	case T_TXT:
! 		(void) putc('"', dbfp);
! 		while (cp < (u_char *) cdata + n) {
! 		    if (n = (unsigned char) *cp++) {
! 			for (i = n; i > 0; i--)
! 			  if (*cp == '\n') {
! 			      (void) putc('\\', dbfp);
! 			      (void) putc(*cp++, dbfp);
! 			  } else
! 			    (void) putc(*cp++, dbfp);
! 		    }
  		}
- 		(void) fputs("\"\n", dbfp);
  		break;
  
  	case T_UID:
--- 1109,1130 ----
  		(void) fprintf(dbfp, "\"%s\"\n", cp);
  		break;
  
! 	case T_TXT: {
! 			int strcnt;
! 
! 			(void) putc('"', dbfp);
! 			while (cp < (u_char *) cdata + n) {
! 			    if (strcnt = (unsigned char) *cp++) {
! 				for (i = strcnt; i > 0; i--)
! 				  if (*cp == '\n') {
! 				      (void) putc('\\', dbfp);
! 				      (void) putc(*cp++, dbfp);
! 				  } else
! 				    (void) putc(*cp++, dbfp);
! 			    }
! 			}
! 			(void) fputs("\"\n", dbfp);
  		}
  		break;
  
  	case T_UID:

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