[920] in Kerberos-V5-bugs

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

K5B4PL3 buglets

daemon@ATHENA.MIT.EDU (Andrew Gross)
Tue Nov 1 01:49:49 1994

Date: Mon, 31 Oct 94 22:49:29 -0800
From: Andrew Gross <drew@drew.sdsc.edu>
To: krb5-bugs@MIT.EDU

Hello,

   Here are 8 minor problems with Kerberos 5 beta 4 pl 3.  I'm sorry
that they are not all in a patch-able form.

Thank you,
Andrew Gross
=========================================================================
1)
   In lib/krb5/posix, configure does not check for setsid() (HAS_SETSID)
which daemon.c uses.  daemon.c is not used anywhere that I have found
so this is pretty minor.

=========================================================================
2)
   In appl/bsd/Makefile.in, for the krlogind and krshd targets,
$(K4LIB) should come after $(KLIB) to get the link to work.

=========================================================================
3)
  In lib/krb5/ccache/file/fcc_reslv.c, krb5_cc_resolve does not
set ccache->magic .

=========================================================================
4)
   In appl/bsd/krlogind.c the comparisons for the window size change
need to be unsigned or it will fail.

=========================================================================
***************
*** 953,960 ****
  		
  	      top:
  		for (cp = fibuf; cp < fibuf+fcc-1; cp++)
! 		  if (cp[0] == magic[0] &&
! 		      cp[1] == magic[1]) {
  		      left = fcc - (cp-fibuf);
  		      n = control(p, cp, left);
  		      if (n) {
--- 957,964 ----
  		
  	      top:
  		for (cp = fibuf; cp < fibuf+fcc-1; cp++)
! 		  if ((unsigned char)cp[0] == magic[0] &&
! 		      (unsigned char)cp[1] == magic[1]) {
  		      left = fcc - (cp-fibuf);
  		      n = control(p, cp, left);
  		      if (n) {
=========================================================================
5)
   These are a couple of tests to make login.c compile more readily on
a NeXT machine.

=========================================================================
diff -b -w -c -r src-ref/appl/bsd/login.c src/appl/bsd/login.c
***************
*** 119,124 ****
--- 119,128 ----
  #define PRIO_OFFSET 0
  #endif
  
+ #ifdef NeXT
+ #define TAB3    XTABS
+ #endif /* NeXT */
+ 
  /* XXX -- do we ever need to test for these? */
  #define uid_type uid_t
  #define gid_type gid_t
***************
*** 205,211 ****
--- 209,217 ----
  #endif /* SETPAG */
  #endif /* KRB4 */
  
+ #ifndef NeXT
  char *getenv();
+ #endif /* NeXT */
  void dofork();
  
  #ifndef HAVE_STRSAVE
***************
*** 409,414 ****
--- 415,423 ----
  	tc.c_cc[VSTART] = CSTART;
  	tc.c_cc[VSTOP] = CSTOP;
  #ifndef CNUL
+ #ifdef NeXT
+ #define CEOL 0
+ #endif /* NeXT */
  #define CNUL CEOL
  #endif
  	tc.c_cc[VEOL] = CNUL;
=========================================================================
6)
   krb5_cc_destroy is called a few lines previous to the adm5_init_link
if statement.

=========================================================================
diff -b -w -c -r src-ref/kadmin/client/kadmin.c src/kadmin/client/kadmin.c
***************
*** 189,195 ****
  
  	/* Initiate Link to Server */
      if ((retval = adm5_init_link(requested_realm, &local_socket))) {
! 	(void) krb5_cc_destroy(cache);
  	exit(1);
      } 
  
--- 189,195 ----
  
  	/* Initiate Link to Server */
      if ((retval = adm5_init_link(requested_realm, &local_socket))) {
! /*DREW	(void) krb5_cc_destroy(cache);*/
  	exit(1);
      } 
  
=========================================================================
7)
   In lib/krb5/krb, compat_recv.c needs to have KRB5_KRB4_COMPAT
defined if a --with-krb4=... is given to configure.  I just copied the
appl/bsd configure.in code to do this.

=========================================================================
diff -b -w -c -r src-ref/lib/krb5/krb/configure.in src/lib/krb5/krb/configure.in
*** src-ref/lib/krb5/krb/configure.in	Wed Oct  5 09:26:43 1994
--- src/lib/krb5/krb/configure.in	Sun Oct 30 23:26:18 1994
***************
*** 9,12 ****
--- 9,19 ----
  SubdirLibraryRule([$(OBJS)])
  KRB_INCLUDE
  ISODE_INCLUDE
+ WITH_KRB4
+ AC_WITH([krb4],
+ ADD_DEF(-DKRB5_KRB4_COMPAT)
+ K4LIB='$(KRB4)/lib/libkrb.a $(KRB4)/lib/libdes.a',
+ echo "warning: no krb4 backwards compatibility support"
+ K4LIB=)
+ AC_SUBST(K4LIB)
  AC_OUTPUT(Makefile,[EXTRA_RULES])
=========================================================================
8)
   In lib/krb5/krb/conv_princ.c all arguments are declared const char *.
The variable instance is then modified.  My compiler (NeXT's variant
of gcc-2.2.2) optimizes most of this routine out due to the
const declaration.

=========================================================================
diff -b -w -c -r src-ref/lib/krb5/krb/conv_princ.c src/lib/krb5/krb/conv_princ.c
*** src-ref/lib/krb5/krb/conv_princ.c	Wed Oct  5 09:26:43 1994
--- src/lib/krb5/krb/conv_princ.c	Sun Oct 30 16:46:09 1994
***************
*** 174,184 ****
       struct krb_convert *p;
       char buf[256];		/* V4 instances are limited to 40 characters */
       krb5_error_code retval;
!      char *domain, *cp;
       
       if (instance) {
  	  if (instance[0] == '\0') {
! 	       instance = 0;
  	       goto not_service;
  	  }
  	  p = sconv_list;
--- 174,185 ----
       struct krb_convert *p;
       char buf[256];		/* V4 instances are limited to 40 characters */
       krb5_error_code retval;
!      char *domain, *cp, *inst_p;
       
+      inst_p=instance;
       if (instance) {
  	  if (instance[0] == '\0') {
! 	       inst_p = 0;
  	       goto not_service;
  	  }
  	  p = sconv_list;
***************
*** 202,212 ****
  		   strcat(buf, domain);
  		   krb5_xfree(domain);
  	       }
! 	       instance = buf;
  	  }
       }
       
  not_service:	
       return(krb5_build_principal(princ, strlen(realm), realm, name,
! 				 instance, 0));
  }
--- 203,213 ----
  		   strcat(buf, domain);
  		   krb5_xfree(domain);
  	       }
! 	       inst_p = buf;
  	  }
       }
       
  not_service:	
       return(krb5_build_principal(princ, strlen(realm), realm, name,
! 				 inst_p, 0));
  }
=========================================================================

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