* Makefile.in (check-mac): Add.
authorJohn Gilmore <gnu@toad.com>
Sat, 18 Mar 1995 03:55:46 +0000 (03:55 +0000)
committerJohn Gilmore <gnu@toad.com>
Sat, 18 Mar 1995 03:55:46 +0000 (03:55 +0000)
* compat_recv.c, get_fcreds.c, recvauth.c:  Eliminate Unix socket
#includes, which are now handled by k5-int.h (via k5-config.h).
* conv_princ.c:  Rename variable "comp" to another name; "comp"
apparently bothers the MPW compiler...
* rd_cred.c:  Avoid (void) casts of void functions, for MPW.
* t_walk_rtree.c:  Put com_err.h after k5_int for <sys/types> stuff.
(main):  Declare and initialize the krb5_context that's being
passed to everything.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@5164 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/ChangeLog
src/lib/krb5/krb/Makefile.in
src/lib/krb5/krb/compat_recv.c
src/lib/krb5/krb/conv_princ.c
src/lib/krb5/krb/get_fcreds.c
src/lib/krb5/krb/rd_cred.c
src/lib/krb5/krb/recvauth.c
src/lib/krb5/krb/t_walk_rtree.c

index 6d3e670c54bebe2b58b5b2f02588414d8147d3b2..0bd337cbf73ece66673e991bbed30f75fe7d56f0 100644 (file)
@@ -1,3 +1,14 @@
+Fri Mar 17 19:48:07 1995  John Gilmore  (gnu at toad.com)
+
+       * Makefile.in (check-mac):  Add.
+       * compat_recv.c, get_fcreds.c, recvauth.c:  Eliminate Unix socket
+       #includes, which are now handled by k5-int.h (via k5-config.h).
+       * conv_princ.c:  Rename variable "comp" to another name; "comp"
+       apparently bothers the MPW compiler...
+       * rd_cred.c:  Avoid (void) casts of void functions, for MPW.
+       * t_walk_rtree.c:  Put com_err.h after k5_int for <sys/types> stuff.
+       (main):  Declare and initialize the krb5_context that's being
+       passed to everything.
 
 Fri Mar 10 10:58:59 1995  Chris Provenzano (proven@mit.edu)
 
index 429d2b9cda56561fd05c0407f3e47502d1d811e5..9407ee57e4c5590e996e0f323c07fc1f3b2d2f64 100644 (file)
@@ -1,5 +1,4 @@
 CFLAGS = $(CCOPTS) $(DEFS)
-LDFLAGS = -g
 
 ##DOSBUILDTOP = ..\..\..
 ##DOSLIBNAME=..\krb5.lib
@@ -152,6 +151,7 @@ TEST_PROGS= t_walk_rtree
 check:: check-$(WHAT)
 
 check-unix:: $(TEST_PROGS)
+check-mac:: $(TEST_PROGS)
 
 check-windows::
 
index cb7d4b7b0ff97bbf0669907b099863569a87ae00..8b245ff531f24c278096dd946e0dc80758169960 100644 (file)
 
 #include <stdio.h>
 #include <string.h>
-#ifndef _WINSOCKAPI_
-#include <netinet/in.h>
-#include <sys/socket.h>
-#endif
 
 static int krb_v4_recvauth();
 
index 770df77d2cad3c8a70da002c998c782bcd91141f..e1b90c927b39fcf1c6f74e68d6ae2b8ae295e47d 100644 (file)
@@ -108,27 +108,27 @@ krb5_524_conv_principal(context, princ, name, inst, realm)
     char *realm;
 {
      struct krb_convert *p;
-     krb5_data *comp;
+     krb5_data *compo;
      char *c;
 
      *name = *inst = '\0';
      switch (krb5_princ_size(context, princ)) {
      case 2:
          /* Check if this principal is listed in the table */
-         comp = krb5_princ_component(context, princ, 0);
+         compo = krb5_princ_component(context, princ, 0);
          p = sconv_list;
          while (p->v4_str) {
-              if (strncmp(p->v5_str, comp->data, comp->length) == 0) {
+              if (strncmp(p->v5_str, compo->data, compo->length) == 0) {
                    /* It is, so set the new name now, and chop off */
                    /* instance's domain name if requested */
                    strcpy(name, p->v4_str);
                    if (p->flags & DO_REALM_CONVERSION) {
-                        comp = krb5_princ_component(context, princ, 1);
-                        c = strnchr(comp->data, '.', comp->length);
-                        if (!c || (c - comp->data) > INST_SZ - 1)
+                        compo = krb5_princ_component(context, princ, 1);
+                        c = strnchr(compo->data, '.', compo->length);
+                        if (!c || (c - compo->data) > INST_SZ - 1)
                              return KRB5_INVALID_PRINCIPAL;
-                        strncpy(inst, comp->data, c - comp->data);
-                        inst[c - comp->data] = '\0';
+                        strncpy(inst, compo->data, c - compo->data);
+                        inst[c - compo->data] = '\0';
                    }
                    break;
               }
@@ -137,32 +137,32 @@ krb5_524_conv_principal(context, princ, name, inst, realm)
          /* If inst isn't set, the service isn't listed in the table, */
          /* so just copy it. */
          if (*inst == '\0') {
-              comp = krb5_princ_component(context, princ, 1);
-              if (comp->length >= INST_SZ - 1)
+              compo = krb5_princ_component(context, princ, 1);
+              if (compo->length >= INST_SZ - 1)
                    return KRB5_INVALID_PRINCIPAL;
-              strncpy(inst, comp->data, comp->length);
-              inst[comp->length] = '\0';
+              strncpy(inst, compo->data, compo->length);
+              inst[compo->length] = '\0';
          }
          /* fall through */
      case 1:
          /* name may have been set above; otherwise, just copy it */
          if (*name == '\0') {
-              comp = krb5_princ_component(context, princ, 0);
-              if (comp->length >= ANAME_SZ)
+              compo = krb5_princ_component(context, princ, 0);
+              if (compo->length >= ANAME_SZ)
                    return KRB5_INVALID_PRINCIPAL;
-              strncpy(name, comp->data, comp->length);
-              name[comp->length] = '\0';
+              strncpy(name, compo->data, compo->length);
+              name[compo->length] = '\0';
          }
          break;
      default:
          return KRB5_INVALID_PRINCIPAL;
      }
 
-     comp = krb5_princ_realm(context, princ);
-     if (comp->length > REALM_SZ - 1)
+     compo = krb5_princ_realm(context, princ);
+     if (compo->length > REALM_SZ - 1)
          return KRB5_INVALID_PRINCIPAL;
-     strncpy(realm, comp->data, comp->length);
-     realm[comp->length] = '\0';
+     strncpy(realm, compo->data, compo->length);
+     realm[compo->length] = '\0';
 
      return 0;
 }
index cb6cbd96d3e023b0cd382376f591eac30ed9d406..e0a263049b1eabbf4b34182b31aa0f7e2962ab2e 100644 (file)
 #define NEED_SOCKETS
 #include "k5-int.h"
 #include <stdio.h>
-#ifndef _WINSOCKAPI_
-#include <pwd.h>
-#include <netdb.h>
-#endif
 
 #define KRB5_DEFAULT_LIFE 60*60*8   /* 8 hours */
 /* helper function: convert flags to necessary KDC options */
index d82868bb1d5a7f275f349a1495d25b72dddef365..d8212e5552c197c35a792f972f43b860c7466c9f 100644 (file)
@@ -57,14 +57,20 @@ krb5_rd_cred(context, inbuf, key, creds, sender_addr, recv_addr)
        return retval;
     }
     
-#define cleanup_credmsg() {(void)krb5_xfree(credmsg->enc_part.ciphertext.data); (void)krb5_xfree(credmsg);}
+#define cleanup_credmsg() { \
+       krb5_xfree(credmsg->enc_part.ciphertext.data); \
+       krb5_xfree(credmsg); \
+  }
 
     if (!(scratch = (krb5_data *) malloc(sizeof(*scratch)))) {
        cleanup_credmsg();
        return ENOMEM;
     }
 
-#define cleanup_scratch() {(void)memset(scratch->data, 0, scratch->length); (void)krb5_xfree(scratch->data);}
+#define cleanup_scratch() { \
+       (void)memset(scratch->data, 0, scratch->length); \
+       krb5_xfree(scratch->data); \
+ }
 
     if (retval = encode_krb5_ticket(credmsg->tickets[0], &scratch)) {
        cleanup_credmsg();
@@ -132,7 +138,7 @@ krb5_rd_cred(context, inbuf, key, creds, sender_addr, recv_addr)
     }
     cleanup_scratch();
 
-#define cleanup_mesg() {(void)krb5_xfree(credmsg_enc_part);}
+#define cleanup_mesg() {krb5_xfree(credmsg_enc_part);}
 
     if (retval = krb5_timeofday(context, &currenttime)) {
        cleanup_mesg();
index edfc5ba5b84c6cea41fd9a45b0b07c792a966d6d..8b1e832e630d3310b9a407195faeb7d1e82bb039 100644 (file)
  * convenience sendauth/recvauth functions
  */
 
-
 #define NEED_SOCKETS
 #include "k5-int.h"
-
 #include "com_err.h"
 #include <errno.h>
-
 #include <stdio.h>
 #include <string.h>
-#ifndef _WINSOCKAPI_
-#include <netinet/in.h>
-#endif
 
 extern krb5_flags      krb5_kdc_default_options;
 
index 419c4137e8f85676c2e797aa24726602b0f5ae6f..88ca4e1eef111f375566b8ac0b7f883684fdb4cc 100644 (file)
@@ -3,8 +3,8 @@
  */
 
 #include <stdio.h>
-#include "com_err.h"
 #include "k5-int.h"
+#include "com_err.h"
 
 main(argc, argv)
        int     argc;
@@ -15,7 +15,9 @@ main(argc, argv)
        krb5_principal *tree, *p;
        char *name;
        krb5_error_code retval;
+       krb5_context context;
        
+       krb5_init_context(&context);
        krb5_init_ets(context);
        
        if (argc < 3 && argc > 4) {